How duydev/api.cleancode.typescript.boilerplate works
Main Architectural Pattern
This project follows the Clean Architecture pattern (also known as Hexagonal Architecture or Ports and Adapters), which is evident from the directory structure. Here's how to represent the core layers:
Key Components
a. Core Layers (represent as concentric circles or hexagons):
• Domain Layer (innermost) - Contains business entities
• Application Layer - Contains business logic
• Interface Layer - Contains HTTP adapters
• Infrastructure Layer - Contains technical implementations
b. Important Components to Highlight:
• HTTP Server (Interface Layer)
• Logger System (Infrastructure Layer)
• Dependency Container
• Configuration Management
Core Structure (from inside out)
• [Domain Core]
• → Business Entities (user.ts, post.ts, category.ts)
• [Application Layer]
• → Application Services (application.ts)
• [Interface Layer]
• → HTTP Router and Server
• [Infrastructure Layer]
• → Logger
• → Configuration
Component Relationships
• How the HTTP server depends on the router
• Logger integration across layers
• Demonstrate how the dependency container manages instances
• Configuration flow
Specific Elements
a. Domain Layer:
• User Entity
• Post Entity
• Category Entity
b. Application Layer:
• Application Service
• Use Cases (implied by structure)
c. Interface Layer:
• HTTP Router
• Server Configuration
d. Infrastructure Layer:
• Logger Registry
• Debugger
• Environment Configuration
Cross-Cutting Concerns
• How the logger spans across all layers
• How configuration affects different components
• Demonstrate dependency injection flow
Technical Details to Note
• TypeScript implementation
• Environment-based configuration
• Dependency injection container
• Clean Architecture principles
Remember to:
• Use consistent styling
• Notes for important architectural decisions
• Clear boundaries between layers
• Direction of dependencies (always pointing inward)
This will provide a clear visualization of how the boilerplate can be extended while maintaining clean architecture principles and how new features can be added without violating the dependency rule.