How sprorowski/clean-architecture-laravel works
Main Architecture Overview
a. Domain Layer (Core)
b. Application Layer
c. Infrastructure Layer
d. Presenter Layer (Framework)
Detailed Component Breakdown
For each layer, include the following components:
Domain Layer:
• User Entity (User.php)
• Users Repository Interface (Users.php)
• Domain Exceptions
Application Layer:
• Command/Query buses
• Use Cases:
• User Creation
• User Login
• User Loading
Infrastructure Layer:
• Database implementations (EloquentUsers)
• External service integrations
Presenter Layer:
• HTTP Controllers
• Console Commands
• Middleware
• Route definitions
• Service Providers
Flow Representation
a. External Request Flow:
HTTP Request → Presenter → Application → Domain → Infrastructure → Database
b. Response Flow:
Database → Infrastructure → Domain → Application → Presenter → HTTP Response
Component Relationships
• Controllers and their corresponding Command/Query handlers
• Command/Query handlers and Domain entities
• Repository interfaces and their implementations
Specific Implementation Details
• Laravel-specific components (Eloquent, Middleware, Providers)
• Custom implementations (Commands, Queries, Handlers)
• Database layer (MySQL/PostgreSQL)
Additional Elements
Sections for:
• Authentication flow
• API versioning (v1)
• Testing architecture
• Service provider bindings
The relationship between concrete implementations and their interfaces
Key Guidelines:
Notes about important architectural decisions
Special Considerations: