Node skeleton app - Suggested folder structure with modular code

PHOTO EMBED

Fri Apr 14 2023 08:47:17 GMT+0000 (Coordinated Universal Time)

Saved by @mindplumber #javascript #uuid #guid

├── app.js
├── config/
│   ├── index.js
│   ├── development.js
│   ├── production.js
│   └── test.js
├── controllers/
│   ├── userController.js
│   └── ...
├── models/
│   ├── user.js
│   └── ...
├── routes/
│   ├── userRoutes.js
│   └── ...
├── services/
│   ├── userService.js
│   └── ...
└── utils/
    ├── logger.js
    └── ...
content_copyCOPY

Here's a brief description of each folder and file: * app.js: The entry point of your application where you initialize and configure your Express app. * config/: This folder contains configuration files for different environments, such as development, production, and test. * controllers/: This folder contains modules that handle incoming HTTP requests and send back HTTP responses. * models/: This folder contains modules that define and interact with your database models. * routes/: This folder contains modules that define your API routes and their associated controller methods. * services/: This folder contains modules that encapsulate business logic and provide an abstraction layer between the controllers and the models. * utils/: This folder contains utility modules, such as a logger or a validator.