artsy / eigen

The Art World in Your Pocket or Your Trendy Tech Company's Tote, Artsy's mobile app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[RFC] Consolidate directory structure

MounirDhahri opened this issue · comments

Proposal:

Consolidate directory structure in Eigen

src/
|__ components/
    |__ animations/ (If we'll be going with some sort of Lottie animations which are very common in react-native)
    |__ ComponentA/ (We don't necessarily need to create a folder per component here...)
        |__ ComponentA.tsx
    |__ images/
        |__ icons/
        |__ common/
        |__ artist/shows/... (maybe we will have at some point some images that will be used in only one screen)
    |__ utils/ (Colors, Fonts, Spacings, SafeAreaInsets, Dimensions, Top and Bottom Navigation height... and we can be importing those everywhere using JavaScript name alias imports { COLORS } from "@ui/utils")
    |__ ...
|__ utils/
    |__ helpers/
    |__ hooks/ (I am sure we have some custom hooks defined in the app that we can place here)
    |__ NativeModules/
    |__ tracking/
    |__ ... 
|__ screens/ (I would call them screens since we will be handling navigation in react-native and they're usually called screens there)
    |__ ScreenA/
      |__ ScreenA.tsx
          |__ Components
              |__ ScreenAComponentA.tsx (to facilitate file navigation)
              |__ ScreenAComponentB.tsx
    |__ ...
|__ store (The folders structure here will depend on how much data we will be storing but I am sure we will be having a folder structure here close to what we can find in regular redux projects since we will be going with easy-easy)
|__ relay
    |__ middleware
|__ routes (For now it will be just AppRegistry but if we will be handling navigation from react-native, we will need a folder for it)
|__ ...

Reasoning

"Basically, our files are kind of disorganized. It makes it difficult to find things, especially for developers who don’t work day-to-day in the app. We should consolidate the directory structure. I like Chris' idea of mimicking Reaction/Force, to leverage developers' familiarity with those codebases."

Additional Context:

You can see our discussion in jira here

How is this RFC resolved?

We agree on a directory structure

Looks great! My only suggestion would be to change Middlewares to be middleware. The lowercase matches the rest of the directory structure, and the pluralization matches Force.

Resolution

We decided to go with the suggested folders structure

Level of Support

2: Positive feedback.

Additional Context:

See conversation here

Next Steps

We will implement it.

Exceptions

No exceptions so far