Nestjs Architecture
ASecurityNo. A controller should parse transport input, invoke an application service, and shape the HTTP response. Business rules and orchestration belong in services or use cases so they remain reusable and testable outside HTTP. ```ts @Controller('orders') export class OrdersController { constructor(private readonly orders: OrdersService) {} @Post() create(@Body() dto: CreateOrderDto, @CurrentUser() user: User) { return this.orders.create(dto, user.id); } } ``` Keep providers singleton by default a...
- 584 stars
- 0 votes
- 0 copies
- 3 views
- Added September 5, 2026
Security analysis
100/100Pro scans all 11 files and shows the line behind each finding
npx -y skills add HoangNguyen0403/agent-skills-standard --skill nestjs-architecture --agent claude-codeAre you the author of Nestjs Architecture?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-nestjs-architecture-a8088f86)No. A controller should parse transport input, invoke an application service, and shape the HTTP response. Business rules and orchestration belong in services or use cases so they remain reusable and testable outside HTTP.
```ts
@Controller('orders')
export class OrdersController {
constructor(private readonly orders: OrdersService) {}
@Post()
create(@Body() dto: CreateOrderDto, @CurrentUser() user: User) {
return this.orders.create(dto, user.id);
}
}
```
Keep providers singleton by default and map entities to response DTOs before returning them. Put validation in pipes and cross-cutting response/error mapping in interceptors and filters.
Files in this skill
- eval-1.baseline.md
- eval-1.with-skill.md
- eval-2.baseline.md
- eval-2.with-skill.md
- eval-3.baseline.md
- eval-3.with-skill.md
- trigger-1.md
- trigger-2.md
- trigger-3.md
- trigger-4.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.