An opinionated boilerplate for Node web APIs focused on separation of concerns and scalability.
- Multilayer folder structure
- Code organization inspired by DDD and Clean Architecture focused on codebase scalability.
- Instant feedback and reload
- Use Nodemon to automatically reload the server after a file change when on development mode, makes the development faster and easier.
- Scalable and easy to use web server
- Use Koajs for requests routing and middlewares. There are some essential middlewares for web APIs already setup, like koa-bodyparser, koa-compress, koa-cors, koa-router and koa-respond.
- Database integration
- Mongoose, is already integrated, you just have to run the docker container.
- Logging
- The Bristol logger an Insanely configurable logging for Node.js
- Clone the repository with
git clone --depth=1 https://github.com/andersondsl/koajs-mongo-docker
- Run docker-compose up, to spin up mngo container and a workspace for development
- Access
http://localhost:3000/users
and you're ready to go!
This boilerplate is open to suggestions and contributions, documentation contributions are also important!