Nestjs Rest Scaffold

screenshot of Nestjs Rest Scaffold

REST boilerplate to build APIs / microservices using the NestJS framework

Overview:

NestJS is a framework for building server-side applications. This project provides a template that integrates several features of NestJS and allows for easy and quick application development. The goal is to minimize configuration effort and provide out-of-the-box functionality. The project is built with NestJS, Fastify, Prisma, Pino, and Open Telemetry.

Features:

  • Open Telemetry: Instrument, generate, collect, and export telemetry data.
  • Terminus module: Provides a healthcheck route for the application.
  • OpenAPI specification: Generates Swagger documentation for all HTTP routes.
  • Global exception middleware: Allows for catching and customizing exceptions.
  • Global request-logger middleware: Logs incoming and outgoing HTTP requests.
  • Global Cache middleware: Enhances the response time of GET requests.
  • Programmatic access to environment variables through DI: Enables easier access to environment variables.
  • Database ORM with Prisma: Allows for interacting with multiple DB drivers.
  • Programmatic log generation using DI: Provides a way to generate logs.
  • Kafka transporter layer: Example implementation of a producer/consumer interface for Kafka.
  • Husky package with lint-staged: Runs linter, formatter, and tests with pre-commit and pre-push hooks.

Summary:

This project provides a template for building server-side applications using NestJS. It offers a range of features such as Open Telemetry for telemetry data, Terminus for health checks, and an OpenAPI specification for HTTP routes. The project also includes middleware for exception handling, request logging, and caching. It provides a programmatic way to access environment variables and a database ORM with Prisma. The template also includes an example implementation of a Kafka transporter layer. Overall, this project aims to simplify and streamline the development process for server-side applications.