Folder structure and best practices for a MERN app

I currently follow this pattern in my projects. I have a question regarding components and containers, and redux. Redux docs say follow the duck pattern which means to have actionTypes, actions, reducers all in a single file.

I'm also concerned about the naming practices. For example, in actions folder, should the file be named as userActions.js or just users.js. Similarly for the reducers folder. In the controller functions I have named it usersController.js, should I rename it to just users.js?

Here is my folder structure:

client
   components
         Login.js
         SignUp.js
   actions
         users.js
         index.js
         actionTypes.js
  reducers
         users.js
         index.js
App.js
index.js
store.js


models
   User.js
controllers
   usersController.js


routes
views
app.js
Start a personal dev blog on your domain for free and grow your readership.

3.4K+ developers have started their personal blogs on Hashnode in the last one month.

Write in Markdown 路 Publish articles on custom domain 路 Gain readership on day zero 路 Automatic GitHub backup and more

No Comments Yet