A sample NestJS project demonstrating RESTful APIs.
Features include:
- APIs that meet Richardson Maturity Model Level 2
- A custom Mongoose integration module (instead of
@nestjs/mongoose) - Passport/JWT authentication using simple text secrets
- Comprehensive tests built with Jest,
jest-mock-extended,ts-mockito,@golevelup/ts-jest, etc. - GitHub Actions workflows for continuous testing, coverage reporting, Docker image builds, and more
- Getting Started
- Connecting to MongoDB
- Securing APIs with JWT
- Handling Model Relationships
- Externalizing Configuration
- User Registration
- Testing NestJS Applications
Make sure you have Node.js and npm installed, then run the following commands in the project directory to install dependencies:
npm installStart the application:
# development
npm run start
# watch mode
npm run start:dev
# production
npm run start:prodRun tests:
# unit tests
npm run test
# end-to-end tests
npm run test:e2e
# coverage report
npm run test:cov- Official NestJS documentation
- Unit testing NestJS applications with Jest
- ts-mockito – a TypeScript mocking library
- Clock‑in/out System Series
- Modern full‑stack NestJS/React/TypeScript/MongoDB – Part 1 & Part 2
- Jest full & partial mocks/spies of module imports
Helpful courses from wanago.io: