Follow these steps to set up a new NestJS project:
-
Install Yarn
First, install Yarn globally using npm:npm install --global yarn
-
Install NestJS CLI Globally
Install the NestJS Command Line Interface globally:yarn global add @nestjs/cli
-
Create a New Project
Create a new NestJS project namednestjs-series
:npx @nestjs/cli new nestjs-series
-
Add Validation Libraries
Install theclass-validator
andclass-transformer
libraries for validation:yarn add class-validator class-transformer
-
Add Swagger Documentation Library
Install the Swagger library for API documentation:yarn add @nestjs/swagger
-
Add SQL ORM (TypeORM) Library
Install TypeORM and the PostgreSQL driver:yarn add @nestjs/typeorm typeorm pg
-
Add Express Platform Library
Install the Express platform for NestJS:yarn add @nestjs/platform-express