๐ŸŒ AIๆœ็ดข & ไปฃ็† ไธป้กต
Skip to content

zigzagdev/portfolio-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Laravel DDD API

A Laravel-based API project built with Domain-Driven Design and Clean Architecture principles.
Designed for modularity, testability, and long-term maintainability.

Architecture

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

API Flow

  1. Controller constructs a Command object from request input.
  2. The Command is passed to a UseCase.
  3. UseCase invokes domain logic and persists data via a Repository.
  4. Resulting Entity is mapped to a DTO.
  5. The DTO is passed to a ViewModel and returned as a JsonResponse.

Tech Stack

  • PHP 8.x / Laravel 10.x
  • MySQL or PostgreSQL
  • PHPUnit (Unit/Feature testing)
  • Laravel Scout + Elasticsearch (optional)

Directory Structure

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/

About

Laravel Portfolio with DDD

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages