https://github.com/catsmiaow/nestjs-project-performance
Node.js framework NestJS project for performance
https://github.com/catsmiaow/nestjs-project-performance
fastify nest nestjs node nodejs prisma starter swc typescript vitest
Last synced: about 1 month ago
JSON representation
Node.js framework NestJS project for performance
- Host: GitHub
- URL: https://github.com/catsmiaow/nestjs-project-performance
- Owner: CatsMiaow
- Created: 2021-01-08T08:26:42.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-07T08:28:02.000Z (about 1 month ago)
- Last Synced: 2025-04-10T06:56:47.362Z (about 1 month ago)
- Topics: fastify, nest, nestjs, node, nodejs, prisma, starter, swc, typescript, vitest
- Language: TypeScript
- Homepage:
- Size: 1.51 MB
- Stars: 28
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nestjs-project-performance
Node.js framework NestJS project for performance
If you focus on the performance or features of the module, you can consider using another module as an alternative in NestJS. \
In this example, the changed modules are as follows.- [Fastify](https://docs.nestjs.com/techniques/performance) instead of `Express`
- [MikroORM](https://docs.nestjs.com/recipes/mikroorm) with [@mikro-orm/nestjs](https://mikro-orm.io/docs/usage-with-nestjs) instead of `TypeORM`
- [SWC](https://docs.nestjs.com/recipes/swc#swc) instead of `TypeScript compiler`
- [Vitest](https://docs.nestjs.com/recipes/swc#vitest) with [vitest-mock-extended](https://www.npmjs.com/package/vitest-mock-extended) instead of `Jest`
- [ESM](https://nodejs.org/api/esm.html) instead of `CommonJS`## Configuration
1. Create a `.env` file
- Rename the [.env.sample](.env.sample) file to `.env` to fix it.
2. Edit env config
- Edit the file in the [config/envs](src/config/envs) folder.
- `default`, `development`, `production`, `test`## Installation
```sh
# 1. node_modules
npm ci
# 2. When synchronize database from existing entities
npm run entity:sync
# 2-1. When import entities from an existing database
npm run entity:load
```## Development
```sh
npm run start:dev
```Run [http://localhost:3000](http://localhost:3000)
## Test
```sh
npm test # exclude e2e
npm run test:e2e # only e2e
```## Production
```sh
# define NODE_ENV and PORT
npm run build
# NODE_ENV=production PORT=8000 node dist/app.js
node dist/app.js
```## Implements
- See [app](src/app.ts), [app.module](src/app.module.ts)
- [Exceptions Filter](src/common/exceptions.filter.ts)
- [Logging Context Middleware](src/common/logger-context.middleware.ts)
- [Custom Logger](src/config/logger.config.ts) with nestjs-pino
- [Configuration by Environment](src/config/envs)
- [JWT Authentication](src/auth)
- [CRUD API Sample](src/sample)
- [Unit Test](src/sample/sample.controller.spec.ts)
- [E2E Test](test/e2e)### Links
- [Nest Project Structure](https://github.com/CatsMiaow/node-nestjs-structure)
- [NestJS](https://docs.nestjs.com)
- [Fastify](https://fastify.dev)
- [MikroORM](https://mikro-orm.io)
- [Vitest](https://vitest.dev)