How whefter/nestjs-joi works
Main Components
a. Core Components:
• JoiPipe (Central Component)
• JoiPipeModule
• Schema Decorators System
• Validation Groups Handler
• Exception Handling System
b. Integration Points:
• NestJS Framework Integration
• Joi Validation Integration
• Microservices Support
• GraphQL Support
┌─ Application Layer ─────────────────────────────────────┐
• ┌─ NestJS Controllers/Resolvers ─┐ │
• (@Body, @Query, @Param) │ │
• ┬────────────────┘ │
• ↓ │
• ┌─ JoiPipeModule ───────────────────────────────┐ │
• ┌─ JoiPipe Core ─────┐ ┌─ Group Handler ─┐ │ │
• Schema Building │ │ - DEFAULT │ │ │
• Validation │←→│ - CREATE │ │ │
• Error Handling │ │ - UPDATE │ │ │
• ┬────────┘ └───────────────┘ │ │
• ↓ │ │
• ┌─ Decorator System ──┐ │ │
• @JoiSchema │ │ │
• @JoiSchemaOptions │ │ │
• @JoiSchemaExtends │ │ │
• ┘ │ │
• ┘ │
• ┘
┌─ Integration Layer ──────────────────────────────────┐
• ┌─ Joi Integration ─┐ ┌─ Exception Handling ─┐ │
• Schema Validation │ │ BadRequestException │ │
• Options Handling │ │ ValidationException │ │
• ┘ └────────────────────┘ │
• ┘
┌─ Platform Support Layer ────────────────────────────┐
• ┌─ HTTP ─┐ ┌─ GraphQL ─┐ ┌─ Microservices ─┐ │
• ┘ └───────────┘ └─────────────────┘ │
• ┘
Important Elements to Highlight
a. Data Flow:
• How validation requests flow from controllers through the pipe
• How schema building works with decorators
• Error propagation paths
b. Integration Points:
• Clear boundaries between NestJS and Joi
• Where platform-specific handling occurs (HTTP/GraphQL/Microservices)
Additional Notes
• Notes about the injection-enabled mode
• Validation groups system
• Relationship between decorators and schema building
Key Relationships to Emphasize
• JoiPipe's relationship with NestJS's pipe system
• Decorator system's connection to Joi schema building
• Exception handling flow
• Validation logic flow