- Express.js - fast, unopinionated, minimalist web framework for Node.js
- Cors - CORS middleware
- Compression - compression middleware
- Helmet - secures Express app with various HTTP headers
- express-async-errors - async/await support for ExpressJS
- express-healthcheck - healthcheck middleware for express
- JWT Authorization - including all the common features such as Sign-up, Login, Logout, Forgotten password, Email verification
- bcrypt.js - bcrypt in plain JS with zero dependencies
- Mongoose - MongoDB ORM
DB Seeding
DB Migrations
- Nodemailer - email service
- Mailgun Transport - send email using Mailgun.com
- Joi - object schema data validation library
- Celebrate - joi validation middleware for Express
- Pino - full-featured logging service
- express-pino-logger - express middleware to log with pino
- pino-pretty - prettifier for Pino log lines for development purposes
- es6-error - easily-extendable error for use with ES6 classes
- http-status - utility to interact with HTTP status code in Node.js
- ESLint - pluggable linting utility
- eslint-plugin-node - rules for Node.js
- Prettier - opinionated code formatter
- Husky & lint-staged - run ESLint & Prettier before commiting new code
- Dotenv - loads environment variables from an
.env
file - Nodemon - monitors for any changes and automatically restarts the server
This project uses dotenv for setting environmental variables during development. Simply copy the .env.example
file, rename it to .env
and add your env variables as you see fit.
There is also a src/config.js
file with several configuration options.
npm install
npm run seed
npm start
The server will start at https://localhost:3001
heroku login
heroku create my-app
git init
heroku git:remote -a my-app
git add .
git commit -am "initial commit"
git push heroku master
-| src/
|--| app/: Main application (framework) files.
|--| common/: Reusable common files such as messages, validation rules, services, utils etc.
|--| features/: Features bundled into separate modules
|--| seeds/: DB seed files
|--| config.js: Global application config file
|--| index.js: Application entry file
This project uses Prettier, an opinionated code formatter. In order to format code manually, run npm run format
in app root directory. All the code is also formatted automatically on pre-commit
hook. There is also npm run format-check
for CI purposes to check if code is formatted properly.
Project comes with ESLint configured. It helps you prevent common errors.
There are multiple ways how to run ESLint.
- CLI:
npm run lint
- it runs automatically on
pre-commit
hook - in IDE if supported (Visual Studio Code supports reports)
Project comes with the default Renovate config renovate.json
. It takes care of automated dependency updates and it's free for open-source projects. More about how to configure here.