nestjs-patterns
NestJS architecture patterns for modules, controllers, providers, DTO validation, guards, interceptors, config, and production-grade TypeScript backends. Use when building or reviewing a NestJS backend — modules, providers, DTO validation, guards, or interceptors.
Target: Software development & testing. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original English text
Topics in the source
- NestJS Development Patterns
- When to Activate
- Project Structure
- Bootstrap and Global Validation
- Modules, Controllers, and Providers
- DTOs and Validation
- Auth, Guards, and Request Context
- Exception Filters and Error Shape
Production-grade NestJS patterns for modular TypeScript backends. Building NestJS APIs or services Structuring modules, controllers, and providers Adding DTO validation, guards, interceptors, or exception filters Configuring environment-aware settings and database integrations Testing NestJS units or HTTP endpoints Keep domain code inside feature modules. Put cross-cutting filters, decorators, guards, and interceptors in common/. Keep DTOs close to the module that owns them. Always enable whitelist and forbidNonWhitelisted on public APIs. Prefer one global validation pipe instead of repeating validation config per route. Controllers should stay thin: parse HTTP input, call a provider, return response DTOs. Put business logic in injectable services, not controllers. Export only the providers other modules genuinely need. Validate every request DTO with class-validator. Use dedicated response DTOs or serializers instead of returning ORM entities directly. Avoid leaking internal fields such as password hashes, tokens, or audit columns. Keep auth strategies and guards module-local unless they are truly shared. Encode coarse access rules in guards, then do resource-specific authorizatio
This is an excerpt. Refer to the complete source and its current requirements.
- Source repository
- affaan-m/ECC
- Source file
- pi/core/skills/nestjs-patterns/SKILL.md
- Fixed revision
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T15:01:43.150Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.