DEV Community

Discussion on: React Project Structure Best Practices for Scalable Application

Collapse
 
rezamor profile image
Reza • Edited

Not a good folder structure when you want to apply code splitting or doing micro front-end.
Each module should go into its own folder. the module folder needs to have it is own sub-folders of Views/Pages, Redux (Services), API, etc. It is a variation of ducks folder structure we use in our big projects. You can easily grab the folder and split the code of view and redux. You can also put it into another repository to do micro frontend

Collapse
 
syakirurahman profile image
Syakir Rahman

So, what you're suggesting is a modular architecture. Grouping views and redux folder is a good idea.
Thanks for sharing it.

Collapse
 
miketalbot profile image
Mike Talbot ⭐

Yeah just for reference: webpack et al statically analyse the project and use the results of this to build chunks to be loaded. If you aren't using a good structure it can get messy really quick. Reza's suggestion makes that neat.

Some comments have been hidden by the post's author - find out more