|app.js
|package.json
|--app
| |--models
| |--user.js
| |--user-schema.js
| |--views
| |--controllers
|--config
| |--authentication.js
| |--credentials.js
| |--routes
| |--page_1.js
| |--page_2.js
| |--login.js
| |--signup.js
| |--database.js
| `--locale
| |--en_us.js
|--public
| |--controllers
|--react
| |--atoms
| |--button.jsx
| |--button.sass
| |--button-responsive.sass
| |--molecules
| |--organisms
| |--templates
| |--pages
|--views
| |--layouts
| |--pages
|--tests
| |--users
| |--admins
- Folder naming can be singular or plural, but should be standardized
- app - holds the whole express code structure
- public - holds the static file. Best if server using a CDN.
- views - contains the static html views
- models - contains the schema for the models and database
- routes - contains the express js routes
- stores - database access layer code
- configs - holds the whole app configuration, including routes endpoints, auth and database config
- helpers - a.k.a. useful utils
- middlewares - the heart of express
- entity - the request params, including validation
- graph - helper to parse the response
- action - config for the services which contains the method, routes, and commands to be dispatcher
- command - triggered by command to handle a specific requests
- store - database access layer
- how reusable is it from the scale of 1 to 10?
- how granular should the files be? preferable 150 loc (line of codes) per file
- each file does only one thing best
- reusable codes are extracted out
- is separated from the server side
- communicates with the server side through REST calls or websocket
###Folder Structure:
- assets (including images, fonts, etc)
- scripts (we do not choose js owing to the variety of compilers available now such as coffeescript, jsx, etc and thus do not want to be tied to a specific technology)
- stylesheets (css, less, sass files resides here)
- data (static data)