Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nedcloarbr/nestjs-boilerplate

🐈 NestJS cutom starter boilerplate
https://github.com/nedcloarbr/nestjs-boilerplate

biomejs boilerplate docker fastify nestjs swagger template vitest

Last synced: about 1 month ago
JSON representation

🐈 NestJS cutom starter boilerplate

Awesome Lists containing this project

README

        


Nest Logo

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

A progressive Node.js framework for building efficient and scalable server-side applications.



NPM Version
Package License
NPM Downloads
CircleCI
Coverage
Discord
Backers on Open Collective
Sponsors on Open Collective

Support us


## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript custom starter boilerplate repository.

### Changes

- [`Fastify`](https://fastify.dev/) instead of [Express](https://expressjs.com/)
- [`@nestjs/config`](https://docs.nestjs.com/techniques/configuration) Module initialized
- [`nestjs-prisma`](https://nestjs-prisma.dev/) Module initialized
- `class-validator`, `class-transformer` and `ValidationPipe` [configured](https://docs.nestjs.com/techniques/validation)
- [`BiomeJS`](https://biomejs.dev) configured with `@nedcloarbr/biome-config` instead of [ESLint](https://eslint.org/) and [Prettier](https://prettier.io/)
- [`@nestjs/swagger`](https://docs.nestjs.com/openapi/introduction) Configured
- [`@nestjs/terminus`](https://docs.nestjs.com/recipes/terminus) Health checks for `api` and `prisma`
- [`Vitest`](https://vitest.dev/) with Vitest UI and coverage-v8 instead of [Jest](https://jestjs.io/)
- [`nestjs-otel`](https://github.com/pragmaticivan/nestjs-otel)/[`Open Temeletry`](https://github.com/pragmaticivan/nestjs-otel-prom-grafana-tempo) Pre-configured
- [`Docker`](https://www.docker.com/) compose file

## Installation

```bash
# install packages
$ yarn install

# initialize prisma client and sync with database
$ yarn prisma migrate dev
```

## Running the app

```bash
# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod
```

## Test

```bash
# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:coverage
```

## Using Docker

```bash
# Start container
$ docker compose up -d

# View logs
$ docker compose logs -f
```

## Viewing Metrics

- Swagger: `http://localhost:9000/docs`
- Grafana: `http://localhost:3000`

> [!Warning]
> PORTS THAT CANNOT BE USED IN THIS PROJECT \
> \
> Metrics API(`src/lib/metrics.ts`) \
> `8081` -> OtelSDK \
> \
> Metrics otel-collector(`docker-compose.metrics.yml`) \
> `1888` -> pprof extension \
> `8888` -> Prometheus metrics exposed by the collector \
> `8889` -> Prometheus exporter metrics \
> `13133` -> health_check extension \
> `4317` -> OTLP gRPC receiver \
> `4318` -> OTLP HTTP receiver \
> `55679` -> zpages extension \
> \
> Metrics tempo(`docker-compose.metrics.yml`) \
> `14268` -> jaeger ingest \
> `3200` -> tempo \
> `4317` -> otlp grpc \
> `4318` -> otlp http \
> `9411` -> zipkin \
> \
> Metrics loki(`docker-compose.metrics.yml`) \
> `3100` -> loki \
> \
> Metrics prometheus(`docker-compose.metrics.yml`) \
> `9090` -> prometheus

## Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).

## Stay in touch

- Author
- NestJS [Kamil MyΕ›liwiec](https://kamilmysliwiec.com)
- Boilerplate [NedcloarBR](https://github.com/NedcloarBR)
- Website
- NestJS [https://nestjs.com](https://nestjs.com/)
- Boilerplate [NedcloarBR](https://github.com/NedcloarBR)
- Twitter
- NestJS [@nestframework](https://twitter.com/nestframework)
- Boilerplate [@BrNedcloar](https://twitter.com/BrNedcloar)

## License

Nest is [MIT licensed](LICENSE).