Unleash Peak Productivity
Build NestJS APIs
Lightning Fast.
Automate boilerplate, embrace declarative power, and ship features faster than ever with NestJS CRUD Automator.
Why Automator?
Experience a paradigm shift in NestJS development. More power, less boilerplate.
Real-time Generation
Controllers, DTOs, and validation created in-memory. No files, pure speed.
Decorator-Driven
Rich, declarative API using TypeScript decorators for ultimate configuration.
Smart Conventions
Sensible defaults minimize explicit setup, maximizing your efficiency.
Highly Extensible
Override or extend any part. Your code, your rules, our automation.
See it in Action
Follow these simple steps to build a fully functional CRUD API in minutes.
/app/entities/user.typescript
1import { Entity, Column } from 'typeorm';
2import { ApiPropertyDescribe, EApiPropertyDescribeType } from '@elsikora/nestjs-crud-automator';
3
4@Entity()
5export class User {
6@ApiPropertyDescribe({ type: EApiPropertyDescribeType.UUID, isPrimary: true })
7id: string;
8
9@ApiPropertyDescribe({ type: EApiPropertyDescribeType.STRING })
10email: string;
11}▋Less Code, More Power
See how NestJS CRUD Automator drastically reduces boilerplate. Drag the slider to compare.
Traditional NestJS
With Automator
// --- traditional.controller.ts ---
import {
Controller, Get, Post, Body,
Param, Patch, Delete, Query,
HttpCode, HttpStatus, NotFoundException
} from '@nestjs/common';
import { TraditionalService } from './traditional.service';
import {
CreateProductDto, UpdateProductDto,
ProductQueryDto, ProductResponseDto
} from './dto';
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
@ApiTags('Traditional Products')
@Controller('traditional-products')
export class TraditionalController {
constructor(private readonly service: TraditionalService) {}
@Post()
@ApiOperation({ summary: 'Create a new product' })
@ApiResponse({ status: 201, type: ProductResponseDto })
@ApiResponse({ status: 400, description: 'Bad Request' })
async create(
@Body() createDto: CreateProductDto
): Promise<ProductResponseDto> {
// const product = await this.service.create(createDto);
// return new ProductResponseDto(product);
return {} as any; // Placeholder
}
@Get()
@ApiOperation({ summary: 'Get all products' })
@ApiResponse({ status: 200, type: [ProductResponseDto] })
async findAll(
@Query() query: ProductQueryDto
): Promise<ProductResponseDto[]> {
// const products = await this.service.findAll(query);
// return products.map(p => new ProductResponseDto(p));
return [] as any; // Placeholder
}
@Get(':id')
@ApiOperation({ summary: 'Get a product by ID' })
@ApiResponse({ status: 200, type: ProductResponseDto })
@ApiResponse({ status: 404, description: 'Product not found' })
async findOne(@Param('id') id: string): Promise<ProductResponseDto> {
// const product = await this.service.findOne(id);
// if (!product) throw new NotFoundException();
// return new ProductResponseDto(product);
return {} as any; // Placeholder
}
@Patch(':id')
@ApiOperation({ summary: 'Update a product' })
@ApiResponse({ status: 200, type: ProductResponseDto })
@ApiResponse({ status: 404, description: 'Product not found' })
async update(
@Param('id') id: string,
@Body() updateDto: UpdateProductDto
): Promise<ProductResponseDto> {
// const product = await this.service.update(id, updateDto);
// return new ProductResponseDto(product);
return {} as any; // Placeholder
}
@Delete(':id')
@HttpCode(HttpStatus.NO_CONTENT)
@ApiOperation({ summary: 'Delete a product' })
@ApiResponse({ status: 204, description: 'Product deleted' })
@ApiResponse({ status: 404, description: 'Product not found' })
async remove(@Param('id') id: string): Promise<void> {
// await this.service.remove(id);
}
}
// --- traditional.service.ts ---
// ... Full service implementation ...
// --- dto/create-product.dto.ts ---
// ... DTO definition with class-validator ...
// --- dto/product-response.dto.ts ---
// ... DTO definition with class-transformer Expose ...// --- product.entity.ts ---
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
import { ApiPropertyDescribe, EApiPropertyDescribeType, EApiPropertyStringType } from '@elsikora/nestjs-crud-automator';
@Entity()
export class Product {
@PrimaryGeneratedColumn('uuid')
@ApiPropertyDescribe({ type: EApiPropertyDescribeType.UUID, isPrimary: true })
id: string;
@Column()
@ApiPropertyDescribe({
type: EApiPropertyDescribeType.STRING,
properties: { create: { body: { isRequired: true } }, update: { body: { isRequired: false } } }
})
name: string;
@Column({type: 'decimal'})
@ApiPropertyDescribe({
type: EApiPropertyDescribeType.NUMBER,
properties: { create: { body: { isRequired: true } }, update: { body: { isRequired: false } } }
})
price: number;
}
// --- product.service.ts ---
import { Injectable } from '@nestjs/common';
import { ApiService, ApiServiceBase, ApiFunction } from '@elsikora/nestjs-crud-automator';
import { Product } from './product.entity';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
@Injectable()
@ApiService({ entity: Product })
export class ProductService extends ApiServiceBase<Product> {
constructor(@InjectRepository(Product) public readonly repository: Repository<Product>) { super(); }
@ApiFunction() public create; @ApiFunction() public getList;
@ApiFunction() public get; @ApiFunction() public update;
@ApiFunction() public delete;
}
// --- product.controller.ts ---
import { Controller } from '@nestjs/common';
import { ApiController } from '@elsikora/nestjs-crud-automator';
import { ProductService } from './product.service';
import { Product } from './product.entity';
@Controller('products')
@ApiController({
entity: Product,
routes: {
create: { documentation: { summary: 'Create a new product' } },
getList: { documentation: { summary: 'Get all products' } },
get: { documentation: { summary: 'Get a product by ID' } },
update: { documentation: { summary: 'Update a product' } },
delete: { documentation: { summary: 'Delete a product' } }
}
})
export class ProductController {
constructor(public readonly service: ProductService) {}
}Get Started in Seconds
Install @elsikora/nestjs-crud-automator and its peer dependencies.
npm install @elsikora/nestjs-crud-automator class-validator class-transformer @nestjs/swagger typeorm @nestjs/typeormInstalls the main package and required peer dependencies: class-validator, class-transformer, @nestjs/swagger, typeorm, @nestjs/typeorm.
For more details on setup and configuration, please refer to the full documentation.
Beyond the Basics
Tackle complex, real-world scenarios with advanced patterns built right into the Automator.
Dynamic & Polymorphic DTOs
Craft DTOs that adapt their structure based on field values. Perfect for complex, evolving data models.
Field-Level RBAC
Fine-grained control over data visibility. Show or hide specific fields based on user roles or custom guards.
Smart Relation Handling
Automatically load, validate, and link related entities by ID during create/update operations. Effortlessly.
Correlation ID Tracing
Built-in interceptor for robust request tracing. Simplify debugging in distributed systems with ease.