A boilerplate using NodeJs, Express, Sequelize, Apidoc, Eslint, Mocha, Cluster and the best practices.
npm run dev
https://localhost:3000/apidocto see the existing API
npm start # Run the serveur in cluster mode (it also generate the apidoc) npm lint # Check lint error using eslint npm test # run mocha tests npm apidoc # Generate the apidoc
You can configure it in the
The architecture is MVR (Model View Route)
The files are structured in the following manner:
libs (Configurations files and libs) models (Sequelize models) routes (Express routes, the comments in this folder are used to generate the apidoc) test (mocha test, 'npm test' to run it) auth.js (Configuration for JWT auth (JSON Web Tokens)) cluster.js (Used to run in cluster mode. We could use https://github.com/Unitech/pm2 too) index.js (Entry point) ntask.* (SSL certificates)
If you want to have a better understanding of the architecture, I recommend you to read Caio Ribeiro Pereira's book.