{"id":19827007,"url":"https://github.com/jorge07/ddd-playground","last_synced_at":"2025-04-04T19:13:01.743Z","repository":{"id":43484092,"uuid":"65225317","full_name":"jorge07/ddd-playground","owner":"jorge07","description":"Domain-Driven Design in a PHP project using Symfony","archived":false,"fork":false,"pushed_at":"2022-02-28T09:57:57.000Z","size":704,"stargazers_count":598,"open_issues_count":6,"forks_count":85,"subscribers_count":51,"default_branch":"master","last_synced_at":"2025-03-28T18:14:53.478Z","etag":null,"topics":["ddd","docker","learning-ddd","php","php-ddd","rest-api","symfony"],"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/jorge07.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-08-08T17:37:46.000Z","updated_at":"2025-02-11T21:32:45.000Z","dependencies_parsed_at":"2022-08-23T11:21:37.992Z","dependency_job_id":null,"html_url":"https://github.com/jorge07/ddd-playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorge07%2Fddd-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorge07%2Fddd-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorge07%2Fddd-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorge07%2Fddd-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jorge07","download_url":"https://codeload.github.com/jorge07/ddd-playground/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234923,"owners_count":20905854,"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","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":["ddd","docker","learning-ddd","php","php-ddd","rest-api","symfony"],"created_at":"2024-11-12T11:12:16.046Z","updated_at":"2025-04-04T19:13:01.662Z","avatar_url":"https://github.com/jorge07.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"DDD Playground\n==============\n\n\u003e For a more acurated DDD, CQRS and Event Sourcing implementation [see here](https://github.com/jorge07/symfony-4-es-cqrs-boilerplate)\n\n**Wallet API** in Symfony following DDD (Domain Driver Design). \n\n### Examples in the repo\n\n   - [x] **User authentication** based in JWT \n   - [x] **UUID as binary** to improve the performance and create a nightmare for the dba.\n   - [x] Automated tasks with ant.\n   - [x] **Dev and CI environments in Docker**. Boosting build speed with docker **cache layers** in pipeline. Orchestrating with **Docker Compose**.\n   - [x] An example of **table inheritance and discriminator strategy** \n   - [x] How to deal with **EAV** (Entity-Attribute-Value) with **Json data type**.\n   - [x] Code structured in layers as appears in DDD in php book.\n   - [x] Test for api in **behat** accessing via web server (*Acceptance tests*). \n   - [x] Integration test with **Lakion api test case** and **Alice** for fixtures and how to integrate it with **behat**. \n   - [x] **Command Bus** implementation\n   - [x] DomainEvents\n   - [x] Events to RabbitMQ\n   - [x] Events stored in ElasticSearch and Kibana for reading in `:5601`\n   \n\n\n### The folder structure \n\n    src\n      \\\n       |\\ Application     `Contains the Use Cases of the domain system and the Data Transfer Objects`\n       |\n       |\\ Domain          `The system business logic layer`\n       |\n       |\\ Infrastructure  `Its the implementation of the system outside the model. I.E: Persistence, serialization, etc`\n       |\n        \\ UI              `User Interface. This use to be inside the Infrastructure layer, but I don't like it.`\n\n### The tests\n\nThe tests follow the same structure and the *phpunit* tests are tagged with group tags: *unit* or *functional*.\n\nThe *aceptation tests* are inside the test `UI` layer and attack the application from outside using Guzzle.\n\n### The Environment setup\n\nThe environment is in PHP7.1 and the development containers are on `etc/infrastructure/dev/docker-compose.yml`\n\nUp environment with: `docker-compose -f etc/infrastructure/dev/docker-compose.yml up -d`\n\nInstall dependencies: `docker-compose -f etc/infrastructure/dev/docker-compose.yml exec fpm sh -lc 'composer install'`\n\nSetup database, etc with : `docker-compose -f etc/infrastructure/dev/docker-compose.yml exec fpm sh -lc 'ant build'`\n\nStart **async** listeners: `docker-compose -f etc/infrastructure/dev/docker-compose.yml exec fpm sh -lc 'bin/console rabbitmq:multiple-consumer events'`\n\n- Rabbit Management: `:15672`\n![Rabbit](https://i.imgur.com/Wx881tI.png)\n\n- Kibana: `:5601`\n![Kibana](https://i.imgur.com/AKsVA0t.png)\n\n### CI/CD\n\nFollow the `Jenkinsfile` or the `gitlab-ci.yml` file, it's clear enough and contains a simply workflow to:\n\n- build the isolated environment\n- `docker-compose -p` to avoid parallel jobs conflicts\n- provision the environment\n- run the test\n- extract reports\n- Build and store the artifacts (Docker images)\n- Clean the environment\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorge07%2Fddd-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjorge07%2Fddd-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorge07%2Fddd-playground/lists"}