xxxxxxxxxx
src
│ app.js # App entry point
└───api # Express route controllers for all the endpoints of the app
└───config # Environment variables and configuration related stuff
└───jobs # Jobs definitions for agenda.js
└───loaders # Split the startup process into modules
└───models # Database models
└───services # All the business logic is here
└───subscribers # Event handlers for async task
└───types # Type declaration files (d.ts) for Typescript
Node JS Folder Structure
xxxxxxxxxx
Node JS Folder Structure
.
├── middleware
| └── auth.js
├── config
| └── config.js
├── controllers
| ├── productController.js
| └── userController.js
├── DB
| └── connection.js
├── models
| ├── productModel.js
| └── userModel.js
├── routers
| ├── product.js
| └── user.js
├── node_modules
├── .env
├── package-lock.json
├── package.json
├── server.js # app.js | index.js
└── README.md