Skip to content

girordo/nestjs-api

Repository files navigation

Nest Logo Docker logo JWT logo

GitHub last commit

Description

This is a little project just for educational and curiosity purpose. In this project I learned about:

  • How to setup a NestJS project
  • How to use the NestJS tooling (create controllers, services, modules)
  • Concept and how to use Guards
  • JWT Authentication Strategy with Guards
  • How to dockerize an NestJS application with PostgreSQL
  • How to make end-to-end tests (for integration purpose)

Installation

$ npm install or yarn

Running the app

# development
$ npm run start or yarn start

# watch mode
$ npm run start:dev or yarn start:dev

# production mode
$ npm run start:prod or yarn start:prod

Test

# unit tests
$ npm run test or yarn test

# pretest command
$ npm run pretest:e2e or yarn pretest:e2e

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Inspiration

Besides the NestJS official docs I followed this two videos: https://www.youtube.com/watch?v=GHTA143_b-s https://www.youtube.com/watch?v=PfSyDd3Sc5A https://www.youtube.com/watch?v=X7RULL-wIhE

And the repo: https://github.com/NikhilCodes/nestjs-best-practices

All the dockerization and setting up the template can be found on the first video, in the second one I integrate Swagger with the api. In the third video I used the helmet properties but not implement the healthcheck with terminus module. (yet!) Although in the repo I used the middleware CORS code to implement a middleware for my self.

License

This project is MIT licensed.


Made with 💜 by Tarcísio Giroldo

About

NestJS with Prisma, Swagger, JWT and Docker

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published