skills/smithery.ai/nestjs-module

nestjs-module

SKILL.md

NestJS Module Architecture

This skill defines the responsibilities of the core module files. A module consists of:

  1. Service (.service.ts): Business logic, calculations, and DTO transformation.
  2. Controller (.controller.ts): HTTP routing, documentation (Swagger), and request delegation.
  3. Module (.module.ts): Dependency Injection wiring.

1. Service Pattern (.service.ts)

Responsibilities:

  • Injects the Repository to access data.
  • Implements business rules (e.g., hashing passwords, sanitizing inputs).
  • Transforms raw database results into clean objects (e.g., removing sensitive fields).
  • Throws HTTP exceptions (NotFoundException, ConflictException).
  • NEVER accesses the database directly (always use the Repository).
Installs
2
First Seen
Mar 21, 2026
nestjs-module from smithery.ai