Apply NestJS architecture patterns to build maintainable production-ready TypeScript backends.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "nestjs-patterns" skill from askskill: 1. Download https://raw.githubusercontent.com/affaan-m/ECC/main/skills/nestjs-patterns/SKILL.md 2. Save it as ~/.claude/skills/nestjs-patterns/SKILL.md 3. Reload skills and tell me it's ready
Using NestJS best practices, design a backend architecture for an e-commerce system, including module boundaries, controllers, services, DTOs, guards, interceptors, and configuration management, and explain the folder structure.
A clear layered NestJS architecture plan with module responsibilities, folder structure, and key implementation guidance.
Create a NestJS example for user registration and login, including controllers, services, DTO validation, a unified response format, and exception handling.
A reusable API code template covering request validation, business logic structure, and consistent error handling.
Review the key production practices for a NestJS project, focusing on configuration management, auth guards, logging interceptors, environment variables, security recommendations, and testability.
A production-readiness checklist that improves maintainability, security, and deployment stability.
Production-grade NestJS patterns for modular TypeScript backends.
src/
├── app.module.ts
├── main.ts
├── common/
│ ├── filters/
│ ├── guards/
│ ├── interceptors/
│ └── pipes/
├── config/
│ ├── configuration.ts
│ └── validation.ts
├── modules/
│ ├── auth/
│ │ ├── auth.controller.ts
│ │ ├── auth.module.ts
│ │ ├── auth.service.ts
│ │ ├── dto/
│ │ ├── guards/
│ │ └── strategies/
│ └── users/
│ ├── dto/
│ ├── entities/
│ ├── users.controller.ts
│ ├── users.module.ts
│ └── users.service.ts
└── prisma/ or database/
common/.async function bootstrap() {
const app = await NestFactory.create(AppModule, { bufferLogs: true });
app.useGlobalPipes(
new ValidationPipe({
whitelist: true,
forbidNonWhitelisted: true,
transform: true,
transformOptions: { enableImplicitConversion: true },
}),
);
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));
app.useGlobalFilters(new HttpExceptionFilter());
await app.listen(process.env.PORT ?? 3000);
}
bootstrap();
whitelist and forbidNonWhitelisted on public APIs.@Module({
controllers: [UsersController],
providers: [UsersService],
exports: [UsersService],
})
export class UsersModule {}
@Controller('users')
export class UsersController {
constructor(private readonly usersService: UsersService) {}
@Get(':id')
getById(@Param('id', ParseUUIDPipe) id: string) {
return this.usersService.getById(id);
}
@Post()
create(@Body() dto: CreateUserDto) {
return this.usersService.create(dto);
}
}
@Injectable()
export class UsersService {
constructor(private readonly usersRepo: UsersRepository) {}
async create(dto: CreateUserDto) {
return this.usersRepo.create(dto);
}
}
export class CreateUserDto {
@IsEmail()
email!: string;
@IsString()
@Length(2, 80)
name!: string;
@IsOptional()
@IsEnum(UserRole)
role?: UserRole;
}
class-validator.@UseGuards(JwtAuthGuard, RolesGuard)
@Roles('admin')
@Get('admin/report')
getAdminReport(@Req() req: AuthenticatedRequest) {
return this.reportService.getForUser(req.user.id);
}
@Catch()
export class HttpExceptionFilter implements ExceptionFilter {
catch(exception: unknown, host: ArgumentsHost) {
const response = host.switchToHttp().getResponse<Response>();
const request = host.switchToHttp().getRequest<Request>();
if (exception instanceof HttpException) {
…
Safely automate SSH collection, parsing, and controlled network changes with Netmiko.
Build accessible React and Next.js interfaces with robust UI accessibility patterns.
Unify multi-channel notifications for routing, deduplication, escalation, and inbox consolidation.
Handle Vite config, plugins, optimization, SSR, and project setup issues.
Manage, edit, summarize, and organize Google Workspace files in one workflow.
Build MCP servers and tools with Node/TypeScript using current SDK patterns.
Learn Django architecture, DRF API design, and production-ready development practices.
Apply Nuxt 4 patterns for SSR safety, performance, and data fetching.
Learn FastAPI best practices for architecture, auth, service layers, and testing.
Build authenticated MCP servers in NestJS using familiar controller decorators.
Get idiomatic C# and .NET guidance for architecture, async, and dependency injection.
Learn Laravel production architecture patterns and core backend implementation practices.