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)
$ npm install or yarn
# 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
# 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
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.
This project is MIT licensed.