A boilerplate template for NodeJS projects.
- Create a .env file in the root directory with following settings:
PORT=80
MONGO_USERNAME=
MONGO_PASSWORD=
MONGO_PORT=27017
MONGO_DB=mongodb
JWT_KEY=
COOKIE_SECRET=
- With
docker-compose up
you can start the server. - Test your running backend Postman API documentation
Folder | Contains |
---|---|
config | Configurations for packages. |
controllers | Logic behind the routes but delegate the main logic to services. Handle here errors. |
interfaces | Implement your typescript interfaces here. |
middleware | Express middlewares are here implemented. |
models | Mongoose models are here defined |
routes | Define your different routes here. |
services | Main logic divided according to the data they use. This is where database accesses take place. |
Feel free to use commit emojis for some color and easy to understand commit messages.