A Laravel-based API project built with Domain-Driven Design and Clean Architecture principles.
Designed for modularity, testability, and long-term maintainability.
This project follows a layered Clean Architecture:
- Presentation Layer: Controllers, ViewModels
- Application Layer: UseCases, Commands, DTOs, QueryServiceInterfaces
- Domain Layer: Entities, Value Objects, RepositoryInterfaces
- Infrastructure Layer: Eloquent Repositories, QueryServices
- Controller constructs a Command object from request input.
- The Command is passed to a UseCase.
- UseCase invokes domain logic and persists data via a Repository.
- Resulting Entity is mapped to a DTO.
- The DTO is passed to a ViewModel and returned as a JsonResponse.
- PHP 8.x / Laravel 10.x
- MySQL or PostgreSQL
- PHPUnit (Unit/Feature testing)
- Laravel Scout + Elasticsearch (optional)
app/
โโโ Posts/
โโโ Application/
โ โโโ ApplicationTests/
โ โโโ UseCases/
โ โโโ UseCommands/
โ โโโ Dtos/
โ โโโ QueryServiceInterface/
โโโ Domain/
โ โโโ DomainTests/
โ โโโ Entities/
โ โโโ ValueObjects/
โ โโโ RepositoryInterfaces/
โโโ Infrastructure/
โ โโโ InfrastructureTests/
โ โโโ Repositories/
โ โโโ QueryServices/
โโโ Presentation/
โโโ Controllers/
โโโ PresentationTests/
โโโ ViewModels/
โโโ Users/
โโโ Application/
โ โโโ ApplicationTests/
โ โโโ UseCases/
โ โโโ UseCommands/
โ โโโ Dtos/
โ โโโ QueryServiceInterface/
โโโ Domain/
โ โโโ DomainTests/
โ โโโ Entities/
โ โโโ ValueObjects/
โ โโโ RepositoryInterfaces/
โโโ Infrastructure/
โ โโโ InfrastructureTests/
โ โโโ Repositories/
โ โโโ QueryServices/
โโโ Presentation/
โโโ Controllers/
โโโ PresentationTests/
โโโ ViewModels/