What problem does it solve?
This Skill provides best practices and reusable patterns for designing robust REST and GraphQL APIs with NestJS, addressing complexity and maintainability challenges.
Core Features & Use Cases
- Endpoint Design: Establishes consistent resource naming, response patterns, and bulk operations.
- Pagination & Filtering: Implements cursor and offset pagination, supporting complex search queries.
- Validation & DTOs: Defines nested, partial, and typed DTOs for request validation and response serialization.
- Error Handling: Centralized exception filters and domain-specific exceptions for reliable error responses.
- Caching & Invalidation: Uses interceptors and Redis for efficient data caching and cache invalidation strategies.
- Versioning & Rate Limiting: Supports URI and header-based versioning, with customizable rate-limiting guards.
- File Uploads & Streaming: Handles large file uploads/downloads and streaming responses for efficient I/O.
- GraphQL Support: Incorporates DataLoader and resolver best practices.
- OpenAPI Documentation: Automates API docs with decorators and schema references.
- Best Practices: Promotes reusable, organized code with clear separation of concerns.
Quick Start
Use the nestjs-api-patterns skill to implement secure, scalable APIs with layered validation, caching, and versioning.