NestJS CRUD is a microframework for building RESTful services with automatic CRUD endpoint generation, advanced query parsing, and TypeORM integration.
Why NestJS CRUD?
Building CRUD endpoints for every entity in your application is repetitive and time-consuming. NestJS CRUD eliminates this boilerplate by automatically generating fully-featured REST endpoints with a single decorator.Key features
Zero boilerplate
Generate complete CRUD APIs with a single
@Crud() decorator. No need to write repetitive endpoint handlers.Advanced querying
Built-in support for filtering, pagination, sorting, relations, nested relations, and field selection through query parameters.
TypeORM integration
Seamless integration with TypeORM. Extend
TypeOrmCrudService and get instant database operations.Type-safe validation
Automatic request validation using class-validator and class-transformer decorators on your entities.
Swagger documentation
Auto-generated OpenAPI documentation for all CRUD endpoints. Works seamlessly with
@nestjs/swagger.Highly customizable
Override individual endpoints, customize query behavior, configure route options, and add authentication per route.
What you get automatically
When you apply the@Crud() decorator to a controller, you automatically get these endpoints:
| Endpoint | Method | Description |
|---|---|---|
/ | GET | Get many entities with filtering, pagination, sorting |
/:id | GET | Get a single entity by ID |
/ | POST | Create a new entity |
/:id | PATCH | Update an existing entity |
/:id | PUT | Replace an existing entity |
/:id | DELETE | Delete an entity |
Query capabilities
Every GET endpoint comes with powerful query parsing out of the box:Packages
The NestJS CRUD ecosystem consists of three main packages:@nestjsx/crud
The core package providing the@Crud() decorator, route generation, validation, and helper decorators.
@nestjsx/crud-typeorm
TypeORM integration providingTypeOrmCrudService with ready-to-use database operations.
@nestjsx/crud-request
Request builder/parser for frontend applications. Build type-safe API queries in your client code.Database support
Through TypeORM integration, NestJS CRUD supports:- PostgreSQL
- MySQL / MariaDB
- SQLite
- Microsoft SQL Server
- Oracle
- CockroachDB
- And all other TypeORM-supported databases
Next steps
Installation
Install and configure NestJS CRUD in your project
Quickstart
Build your first CRUD API in minutes