backend-structure

Creates NestJS feature modules following the Controller-Service-Entity pattern with TypeORM and Swagger.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/moking55/migrate-plus --skill backend-structure-moking55
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: backend-structure
Source: https://github.com/moking55/migrate-plus/tree/main/.agents/skills/backend-structure
Command: npx skills add https://github.com/moking55/migrate-plus --skill backend-structure-moking55

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When adding new features to a NestJS backend, developers often produce inconsistent module layouts, missing Swagger documentation, or duplicated CRUD boilerplate. This Skill enforces a single architectural pattern so every module in apps/backend/src/modules looks and behaves the same. ## Core Features & Use Cases - Standardized Module Layout: Defines the exact directory structure (dto/, entities/, enum/, interfaces/) and file naming conventions for each feature module. - Base Class Inheritance: Requires controllers to extend BaseControllerOperations and services to extend BaseServiceOperations, eliminating repetitive CRUD code. - Built-in API Documentation: Mandates @ApiTags, @ApiOperation, and @ApiResponse decorators so every endpoint is documented in Swagger automatically. - Use Case: You need a new "orders" feature. Follow this Skill to scaffold orders.controller.ts, orders.service.ts, orders.module.ts, the entity, and DTOs with validation, then register the module in app.module.ts. ## Quick Start Create a new NestJS feature module named orders following the backend structure pattern with entity, DTOs, service, and controller.

Frequently Asked Questions about backend-structure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new NestJS module with CRUD operations?▼

Create a feature folder under apps/backend/src/modules containing the controller, service, module, entity, and DTO files. Extend BaseControllerOperations and BaseServiceOperations to inherit standard CRUD endpoints, then register the module in app.module.ts.

How to structure a NestJS project with TypeORM entities?▼

Place each feature in its own module folder with an entities/ subdirectory. Entities extend BaseCustomEntity, use @Entity with a table name, and register via TypeOrmModule.forFeature in the module imports.

Does NestJS Swagger documentation require manual decorators?▼

Yes, this pattern requires explicit @ApiTags on controllers and @ApiOperation plus @ApiResponse on each endpoint. DTOs use @ApiProperty so request schemas appear automatically in the generated Swagger UI.

How do I add validation to NestJS DTOs?▼

Use class-validator decorators like @IsNotEmpty and @IsString on DTO properties, combined with @ApiProperty for documentation. class-transformer decorators such as @Expose and @Type handle serialization when needed.

When should I override the base service methods in NestJS?▼

Override create or update when the feature needs business logic beyond plain persistence, such as unique constraint checks that throw ConflictException or custom data mapping before saving to the repository.