Skip to main content

Prerequisites

Before installing NestJS CRUD, ensure you have:
  • Node.js 14.x or higher
  • An existing NestJS project (v9.x or higher recommended)
  • TypeScript 4.6 or higher
If you don’t have a NestJS project yet, create one using:

Install core packages

NestJS CRUD requires the core package along with class-transformer and class-validator for request validation.

Install TypeORM integration

To use NestJS CRUD with TypeORM (recommended), install the TypeORM packages:

Install database driver

Install the appropriate database driver for your database:

Configure TypeORM

Create or update your TypeORM configuration in your app module:
app.module.ts
Set synchronize: false in production environments. Use migrations instead to manage database schema changes.

Optional: Install request builder

If you’re building a frontend application and want type-safe query building, install the request builder package:
The request builder allows you to construct API queries in your client code:
frontend-example.ts

Verify installation

Verify that all packages are installed correctly:
You should see output similar to:

TypeScript configuration

Ensure your tsconfig.json has the following compiler options enabled:
tsconfig.json
These options are required for decorators and metadata reflection to work properly.

Next steps

Quickstart

Now that you have NestJS CRUD installed, follow the quickstart guide to build your first CRUD API in minutes.