DEV Community

Discussion on: Senior front end dev here, ask me anything!

Collapse
 
faycelbouamoud profile image
faycelbouamoud

How you structure your project in folders/files ? Abd if your project grows in complexity how do you ensure reduce coupling between your modules ?
If you use react what stack you are going to chose to scale your application (mobx, redux, react-router, reach-router ...)?
Do you use event emitter to reduce your application complexity and module dependency?
Do you recommend using css-in-js .. which library do you recommend?
And thank you very much for this post ^^

Collapse
 
kendalmintcode profile image
Rob Kendal {{☕}}

That’s a lot to take in so let me fire some quick answers at cha:

  1. Structure wise, I don’t overthink it. Just get started, you can always change it. I like to keep various assets together, styles in their own folder, and separate out by areas of responsibility. So I have a helpers folder, constants, components and dat handling.

  2. For complex react projects, I lean on react router, and the redux toolkit for state management.

  3. I’m familiar with the event emitter pattern and have used it in the past. But I’ve not found too much place for it in React projects I’ve been a part of, especially with Redux. I do, however, like to introduce data handlers as middle men that handle interaction between the API and Redux. This reduces complexity in my controlling components.

  4. I don’t like css-in-is. It muddies the waters for me; maybe I’m too old school. However, that shouldn’t stop anyone from trying it and seeing if it’s a fit for them. I hear good things about Styled Components (for React)