What problem does it solve?
Backend development often suffers from inconsistent patterns, poor error handling, and tightly coupled code. This Skill provides a clear, layered architecture and best practices for Node.js/Express/TypeScript microservices, ensuring maintainability, testability, and robust error management.
Core Features & Use Cases
- Layered Architecture: Enforces separation of concerns (Routes → Controllers → Services → DAOs) for clean, testable code.
- Structured Error Handling: Utilizes custom error classes and
asyncHandler middleware for consistent, predictable error responses.
- Zod Validation & Clerk Auth: Integrates Zod for type-safe input validation and Clerk for secure authentication.
- Pino Logging: Implements structured logging with Pino for better observability and debugging.
- Use Case: When developing a new API endpoint, follow this Skill to define routes, implement controllers, apply validation, handle authentication, and ensure proper error handling and logging, all within a consistent architectural framework.
Quick Start
To create a new API endpoint for user profile updates:
- Define the route in
routes/users.ts, delegating to a controller function.
- Implement the controller in
controllers/users.controller.ts, wrapping it with asyncHandler.
- Use
validateRequest middleware with a Zod schema for input validation.
- Apply
requireAuthClerk middleware to protect the route.
- Perform database operations using DAOs from
@quantum/data-access.
- Log relevant events using
logger.info().