nodetomic

Minimalist boilerplate for NODEJS, designed for vertical and horizontal scalability.

MIT License

Stars
38

NODETOMIC

Minimalist boilerplate for nodejs, designed for vertical and horizontal scalability.

Technologies

  • Express
  • Redis 6
  • MongoDB 4
  • Swagger 3
  • Webpack 5
  • Babel 7
  • Socket 4
  • Eslint
  • Prettier
  • Jest

Installation

git clone https://github.com/kevoj/nodetomic
cd nodetomic
yarn

Then, you will need to create a .env file in the root of the project

PROJECT_MODE=development
PROJECT_NAME=example-name
SERVER_HOSTNAME=localhost
SERVER_PORT=8000
SERVER_WEBSOCKET_PORT=8001
SWAGGER_HOSTNAME=localhost
SWAGGER_API_DOCS=true
JWT_SECRET_KEY=shhhh
MONGODB_HOSTNAME=127.0.0.1
MONGODB_PORT=27017
MONGODB_DATABASE=example-dev
MONGODB_USERNAME=
MONGODB_PASSWORD=
REDIS_HOSTNAME=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=

Scripts

start

Start the project in development mode with the .env file that is in the root

yarn start

test

Run the unit tests

yarn test

build

Compile the project

yarn build

Docs

Guide

API docs

Scalability

Starting point

cluster mode (NO SHARED STATE)

Add Redis to shared state

Added multiple servers and pm2 load balancing

Added database and load balancer

Added redis cluster and mongodb sharded clusters

Conclusion

Related Projects