ts-microservice-boilerplate

TypeScript

Features

  • TypeScript
  • Docker
  • Tests - jest and supertest
  • Module Alias - ex: '@config/foo' instead '../../../../config/foo'
  • Environment variables management with dotenv
  • Logger - Using winston to padronize and format logs. For now, logs will only be transported to console.
  • Express - Basic middlewares (XSS, Helmet, Bodyparser), basic headers (CORS, disable x-powered-by), health check route, http server and requests logs.
  • CI - Github Actions running tests on push in any branch.
  • Example route
  • Auth
  • Code coverage >= 95%

To run the project

Docker compose will install dependencies and up both dev and test environments:

sudo docker-compose up

Docker Compose

If you prefer to not use Docker:

First install the dependencies:

npm install

In development run:

npm run start:dev

To test:

npm test

To reload tests when code changes:

npm test:watch