mirror of
https://github.com/hantsy/nestjs-rest-sample.git
synced 2025-12-08 20:36:27 +00:00
Bumps [glob](https://github.com/isaacs/node-glob) to 11.1.0 and updates ancestor dependencies [glob](https://github.com/isaacs/node-glob) and [@nestjs/cli](https://github.com/nestjs/nest-cli). These dependencies need to be updated together. Updates `glob` from 11.0.3 to 11.1.0 - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](https://github.com/isaacs/node-glob/compare/v11.0.3...v11.1.0) Updates `glob` from 10.4.5 to 10.5.0 - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](https://github.com/isaacs/node-glob/compare/v11.0.3...v11.1.0) Updates `@nestjs/cli` from 11.0.10 to 11.0.11 - [Release notes](https://github.com/nestjs/nest-cli/releases) - [Changelog](https://github.com/nestjs/nest-cli/blob/master/.release-it.json) - [Commits](https://github.com/nestjs/nest-cli/compare/11.0.10...11.0.11) --- updated-dependencies: - dependency-name: glob dependency-version: 11.1.0 dependency-type: indirect - dependency-name: glob dependency-version: 10.5.0 dependency-type: indirect - dependency-name: "@nestjs/cli" dependency-version: 11.0.11 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com>
NestJS Sample
A NestJS RESTful APIs sample project, including:
- Restful APIs satisfies Richardson Maturity Model(Level 2)
- Custom Mongoose integration module instead of @nestjs/mongoose
- Passport/Jwt authentication with simple text secrets
- Fully testing codes with Jest, jest-mock-extended, ts-mockito, @golevelup/ts-jest etc.
- Github actions workflow for continuous testing, code coverage report, docker image building, etc.
Docs
- Getting Started
- Connecting to MongoDB
- Protect your APIs with JWT Token
- Dealing with model relations
- Externalizing the configuration
- Handling user registration
- Testing Nestjs applications
Build
Install the dependencies.
$ npm install
Running the app
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
Test
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Reference
- The official Nestjs documentation
- Unit testing NestJS applications with Jest
- ts-mockito: Mocking library for TypeScript inspired by http://mockito.org/
- Clock-in/out System Series
- Modern Full-Stack Development with Nest.js, React, TypeScript, and MongoDB: Part 1, Part 2
- Code with Hugo - Jest Full and Partial Mock/Spy of CommonJS and ES6 Module Imports
- There is a collection of courses from https://wanago.io/ which is very helpful for building applications with NestJS:
Languages
TypeScript
98.6%
JavaScript
1.2%
Dockerfile
0.2%