Commands
generate
application
NestJS

NestJS

Nest.js (opens in a new tab) is a NodeJS framework, heavily inspired by Angular, that allows building efficient, reliable, and scalable server-side applications.

Get Started

To create a new NestJS application, use the following Devmy CLI command:

devmy generate application nestjs

Variables

You can configure the initial application with the following parameters:

  • Application name: The name of the application
  • Port: Port to listen on.

Advantages

Axios

Axios (opens in a new tab) is a library for making HTTP requests from Node.js or the browser. In a NestJS application, Axios can be used to handle communications with external APIs easily and flexibly.

Class Transformer and Class Validator

These libraries work together to transform and validate objects in TypeScript. class-transformer allows transforming plain JavaScript objects into instances of classes and vice versa, while class-validator enables applying and verifying validation rules on objects.

More information here:

Cookie Parser

Cookie Parser (opens in a new tab) is a middleware that parses request cookies and populates req.cookies with a key-value object. This is useful in a NestJS application for handling cookie data.

DayJs

Day.js (opens in a new tab) is a date manipulation library that provides an API similar to Moment.js but with smaller size and better performance.

Helmet

Helmet (opens in a new tab) is a middleware that helps secure Express (and thus NestJS) applications by setting various HTTP headers related to security. It is particularly useful for preventing common vulnerabilities like XSS and clickjacking attacks.

Sentry

Sentry (opens in a new tab) is a platform for monitoring application errors and performance. In a NestJS application, Sentry can be used to track exceptions, errors, and performance, providing useful details for debugging and improving applications.

The Sentry configuration has been integrated into the project and uses the following environment variables:

[ApplicationName]_SENTRY_DNS

Swagger

Swagger (opens in a new tab) is a suite of tools for designing, building, and documenting APIs. With NestJS, @nestjs/swagger allows automatic generation of Swagger documentation based on decorators and metadata in the code.

Throttler

Throttler (opens in a new tab) is a module that provides rate limiting for HTTP requests. In a NestJS application, Throttler can be used to prevent abuse and limit the number of requests to certain APIs.