UK-Export-Finance / nestjs-template

NestJS template using MSSQL, Docker, Pino.js, Renovate, CommitLint, etc
MIT License
1 stars 1 forks source link

Description

NestJS framework TypeScript starter repository.

Features

Installation

npm install

Running the service (dev)

# start the local SQL database
$ docker compose -f docker-compose.db.yml up --build
# using docker-compose
$ docker compose up --build
# without docker-compose
$ npm run start:dev

Test

# unit tests
$ npm run test

# api tests
$ npm run api-test

Generating new resources

To simplify the generation of new resources, you can use the boilerplate CRUD

nest g resource users

Writing logs using PinoJS

# error
this.logger.error({ id: 'your message here' }, 'context-name');

# log
this.logger.log({ id: 'your message here' }, 'context-name');

Writing Conventional Commits

The most important prefixes you should have in mind are:

  1. fix: which represents bug fixes, and correlates to a SemVer patch.
  2. feat: which represents a new feature, and correlates to a SemVer minor.
  3. feat!:, fix!: or refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.