moeenn / node-api-template

A Project Template for NodeJS (API) Back-end Project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NodeJS API Boilerplate

NodeJS API back-end with the following tools already setup

  • Typescript compiler i.e. tsc
  • Absolute imports with module-alias
  • eslint for static analysis and linting
  • vitest for testing
  • Some basic package.json scripts

Setup

$ npm i --save-dev

Run in Development Mode

$ npm run dev

Run in Production Mode

$ npm run build
$ npm run start

Note: The NODE_ENV environment variable will be set to production when running the app in production mode.

Linting & Formatting code

$ npm run check

Running Tests with Vitest

$ npm test

Generate JWT secret

$ npm run gen:secret

Run database migrations

$ npm run db:migrate

Run database seeders

$ npm run db:seed

About

A Project Template for NodeJS (API) Back-end Project.


Languages

Language:TypeScript 96.7%Language:JavaScript 3.1%Language:Dockerfile 0.2%