A API boilerplate built on top of ExpressJS.
- Database: SQL using Sequelize/PostgreSQL;
- Authentication: Authenticate users with JWT;
- Logs: Logging info with Winston/Morgan;
- Tests: Unit/Integration Tests running with Jest;
- Error handling: Centralized error handling middleware;
- Security:
- Code Analisys: Codecov/Codacy;
- Linting: ESLint/Prettier;
- API Documentation: Swagger/Postman;
This boilerplate is also available with Mongoose/MongoDB on this repository!
Clone the repository
$ git clone https://github.com/lucas-a-pelegrino/node-bloodboiler-sequelized
$ cd node-bloodboiler-sequelizedInstall the dependencies
$ npm install
# or
$ yarn installSetup environment variables (modify/add more variables if needed)
$ cp .env.example .envStart application
# locally:
$ npm run start:dev
$ yarn start:dev
# staging:
$ npm run start:staging
$ yarn start:staging
# production
$ npm start
$ yarn startTesting
# Run tests
$ npm test
$ yarn testBloodboiler comes with Docker support, you can develop and test your code using Docker for minimal configuration, Nodemon takes care of restarting the application inside Docker so you can code locally.
# Code Locally with:
$ npm run docker:dev
# or
$ yarn docker:dev
# Run Test Suites inside Docker:
$ npm run docker:test
# or
$ yarn docker:testNOTE: In order to use the methods listed above, make sure you have Docker installed on your local machine!
You might want to check the API docs as well!
- Collection on Postman;
- Swagger: Just start the application at your desired
host:portand use the route:/api/v1/documentationto open the swagger docs;