A starter template for any Enterprise Applications, Rest APIs or Microservices with Node.js, Express and Sequelize ORM for MySQL, PostgreSQL or others. This project offers production ready environment with all necessary supports for validation, unit testing, socket, redis and many more.
Clone the repo:
git clone https://github.com/ItzSamdam/Node-Js-Starter-Template.git
cd Node-Js-Starter-Template
Install the dependencies:
yarn install
Set the environment variables:
cp .env.example .env
# open .env and modify the environment variables (if needed)
Running locally:
yarn dev
Running in production:
yarn start
Testing:
# run all tests
yarn test
public\
src\
|--config\ # Environment variables and configuration related things
|--controllers\ # Route controllers (controller layer)
|--daom\ # Data Access Object for models
|--database\ # Migrations and Seed files
|--middlewares\ # Provide Security Layer in app
|--models\ # Sequelize models (data layer)
|--routes\ # Routes
|--services\ # Business logic (service layer)
|--utilities\ # Utilities classes and functions
|--validators\ # Request data validation schemas
|--app.js # Express app
|--cronJobs.js # Job Scheduler
|--server.js # App entry point