aarora0301/yellowPages

module structure is not standard

Opened this issue · 0 comments

Please follow this module pattern. This is called component driven structure, the structure you are using was a old process, where we group similar features/types together. Like

models/
controllers/
services/

etc.

Even though this is still used in java, a lot of people started already to move towards component driven structure. Where any feature is considered as a module/component, and has things related to it grouped under one place.

api/
     user/
         model.js
         repository.js
         index.js
pages/
     home/
         view.js
         controller.js
         index.js

For example above, home and user are two different components with grouped functionalities. And they should be exposing stuffs via index.js, so that the whole folder can be treated as module by JS.

Any file that require access to these should import the module itself.
import home from './pages/home'

I explained it before, but putting it here again- to say it clearly once again!