{"id":15014470,"url":"https://github.com/mguinea/laravel-ddd-example","last_synced_at":"2025-10-12T00:21:05.920Z","repository":{"id":41107323,"uuid":"351814763","full_name":"mguinea/laravel-ddd-example","owner":"mguinea","description":"Hexagonal Architecture + DDD + CQRS in PHP using Laravel 8","archived":false,"fork":false,"pushed_at":"2022-12-02T14:31:50.000Z","size":274037,"stargazers_count":93,"open_issues_count":1,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-03T15:40:40.128Z","etag":null,"topics":["best-practices","bounded-context","cqrs","ddd","docker","domain-driven-design","eloquent","hexagonal-architecture","laravel","microservice","modular","monorepo","php","phpunit","scalability","testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mguinea.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-26T14:46:39.000Z","updated_at":"2025-06-19T08:22:27.000Z","dependencies_parsed_at":"2023-01-22T22:31:24.680Z","dependency_job_id":null,"html_url":"https://github.com/mguinea/laravel-ddd-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mguinea/laravel-ddd-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguinea%2Flaravel-ddd-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguinea%2Flaravel-ddd-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguinea%2Flaravel-ddd-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguinea%2Flaravel-ddd-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mguinea","download_url":"https://codeload.github.com/mguinea/laravel-ddd-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguinea%2Flaravel-ddd-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279009493,"owners_count":26084609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["best-practices","bounded-context","cqrs","ddd","docker","domain-driven-design","eloquent","hexagonal-architecture","laravel","microservice","modular","monorepo","php","phpunit","scalability","testing"],"created_at":"2024-09-24T19:45:40.283Z","updated_at":"2025-10-12T00:21:05.903Z","avatar_url":"https://github.com/mguinea.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  Hexagonal Architecture, DDD \u0026 CQRS in Laravel PHP\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://laravel.com/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Laravel-8-FF2D20.svg?style=for-the-badge\u0026logo=laravel\" alt=\"Laravel 8\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.php.net/\"\u003e\u003cimg src=\"https://img.shields.io/badge/PHP-8-777BB4.svg?style=for-the-badge\u0026logo=php\" alt=\"PHP\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.docker.com/\"\u003e\u003cimg src=\"https://img.shields.io/badge/docker-3-2496ED.svg?style=for-the-badge\u0026logo=docker\" alt=\"Docker\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.mysql.com/\"\u003e\u003cimg src=\"https://img.shields.io/badge/mysql-5.7-4479A1.svg?style=for-the-badge\u0026logo=mysql\" alt=\"MySql\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.terraform.io/\"\u003e\u003cimg src=\"https://img.shields.io/badge/terraform-1.3-7B42BC.svg?style=for-the-badge\u0026logo=terraform\" alt=\"Terraform\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://circleci.com/gh/mguinea/laravel-ddd-example/tree/master\"\u003e\u003cimg src=\"https://circleci.com/gh/mguinea/laravel-ddd-example/tree/master.svg?style=svg\" alt=\"CircleCI\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/mguinea/laravel-ddd-example/actions\"\u003e\u003cimg src=\"https://github.com/mguinea/laravel-ddd-example/actions/workflows/php.yml/badge.svg\" alt=\"GithubActions\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  This is a monorepo containing a \u003cstrong\u003ePHP application using Domain-Driven Design (DDD) and Command Query Responsibility Segregation\n  (CQRS) principles\u003c/strong\u003e.\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  It's a basic implementation of a Kanban manager (at this moment, just only manages Board entity with id and name attributes)\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  The main objective of this implementation is to use Laravel as backend framework but instead of using MVC architecture, go for DDD and Hexagonal. \n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://github.com/mguinea/laravel-ddd-example/issues\"\u003eReport a bug\u003c/a\u003e\n  ·\n  \u003ca href=\"https://github.com/mguinea/laravel-ddd-example/issues\"\u003eRequest a feature\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/mguinea/laravel-ddd-example/actions\"\u003e\u003cimg src=\"https://github.com/mguinea/laravel-ddd-example/actions/workflows/php.yml/badge.svg\" alt=\"CI pipeline status\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\n### Requirements\n- [Install Docker](https://www.docker.com/get-started)\n- [Install Docker Compose](https://docs.docker.com/compose/install/)\n\n### Environment\n\n- Clone this project: `git clone https://github.com/mguinea/laravel-ddd-example laravel-ddd-example`\n- Move to the project folder: `cd laravel-ddd-example`\n\n### Execution\n\nInstall all the dependencies and bring up the project with Docker executing:\n\n`make build`\\\n`make up`\\\n`make migrate`\n    \nThen you'll have 1 app available (an API):\n\n- Kanban API: http://localhost:8080/api/v1/kanban/health-check\n\n### API Documentation\n\nOpen API documentation [here](./kanban-api-endpoints.yaml)\n\nPostman API collection [here](./kanban-api-endpoints.postman.json)\n\n### Tests\n\nExecute all test suites: `make tests`\n\n## Project structure and explanation\n\n### Root Folders\n\n#### apps\n\nHere are our implementations of the code we have in our base (src). Here can be any framework, etc...\n\n#### etc\n\n`etc` is for \"Editable Text Configurations\". So here we can put any configuration by xml, yaml etc... like Docker setup.\n\n#### src\n\n`src` is for \"Source\". Here we put all our code base being as independent as possible of any implementation (except is there is in `infrastructure` subfolder).\n\n### Bounded contexts\n\nKanban: Place where the main functionality is implemented. Management of boards...\n\n### Architecture and Structure\n\nThis repository follows the Hexagonal Architecture pattern. Also, it's structured using modules. With this, we can see that the current structure:\n\n*Kanban bounded context* containing *Board module* and *Shared bonded context*.\n\n```\n$ tree -L 3 src\n\nsrc\n├── Kanban\n│   └── Board\n│       ├── Application\n│       ├── Domain\n│       └── Infrastructure\n└── Shared\n    ├── Domain\n    │   ├── Aggregate\n    │   └── Bus\n    └── Infrastructure\n        └── Bus\n```\n\n#### Repositories\n\nRepository pattern\n\nOur repositories try to be as simple as possible usually only containing basic CRUD methods (delete, find, save and list using criteria pattern).\n\n#### CQRS\n\nSymfony Messenger has been used to implement commands, queries and events.\n\n## Infrastructure\n\n### RabbitMQ\n\nThere is a service with RabbitMQ to manage queues. You can access it going to ` http://localhost:15672` and using `guest` as username and password.\n\n## References\n\n- [Bash best practices](https://gist.github.com/leolorenzoluis/0aad69719267536d0b7a79946edbfcb7)\n- [DDD Concepts](https://www.isaqb.org/blog/ddd-confusion-bounded-subdomain-context-module-or-what/)\n- [Ansible best practices](https://docs.ansible.com/ansible/2.8/user_guide/playbooks_best_practices.html#content-organization)\n- [Terraform first steps](https://www.adictosaltrabajo.com/2020/06/19/primeros-pasos-con-terraform-crear-instancia-ec2-en-aws/)\n- [Jenkins in Docker](https://appinventiv.com/blog/jenkins-installation-using-docker-compose/)\n- https://stackoverflow.com/questions/59643458/dockerfile-install-amqp-failed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmguinea%2Flaravel-ddd-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmguinea%2Flaravel-ddd-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmguinea%2Flaravel-ddd-example/lists"}