Skip to content

API template with unit and end to end tests, ORM set to multiple databases, endpoint documentation with OpenAPI, migrations and seed to populate the local databases, authorization with an API Key and authentication through Json Web Token.

Notifications You must be signed in to change notification settings

rafaelscariot/nestjs-ms-template

Repository files navigation

API template with unit and end to end tests, ORM set to multiple databases, endpoint documentation with OpenAPI, migrations and seed to populate the local databases, authorization with an API Key and authentication through Json Web Token.

Technologies used:

Installation

$ yarn install

Running the app

# container
$ docker-compose up -d

# migrations and seed
$ yarn db:create

# start in watch mode
$ yarn start:dev

Access the API docs on localhost:3000/api.

Other scripts

start in production mode

$ yarn start:prod

migrations and seed individually

$ yarn migrate
$ yarn seed

database reset

$ yarn db:reset

Tests

controller have an end to end test covering all the request layers. service have a unit test covering the service logic and mocking external things to it.

# all tests
$ yarn test

# unit tests
$ yarn test:unit

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

Stay in touch

About

API template with unit and end to end tests, ORM set to multiple databases, endpoint documentation with OpenAPI, migrations and seed to populate the local databases, authorization with an API Key and authentication through Json Web Token.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published