An example project of Domain Driven Design using Sylius Resource 2 and following the hexagonal architecture.
This project is based on Domain Driven Design and API Platform 3
This example has been explained during the API Platform conference 2022 (slides, video).
If you want to try to use and tweak that example, you can follow these steps:
- Run
git clone https://github.com/loic425/sylius-dddto clone the project - Run
composer installto install the project - Run
symfony console doctrine:database:createto create the database - Run
symfony console doctrine:schema:createto create the schema - Run
docker-compose up -dto run the containers - Run
symfony serve -dto up your local server - Visit https://localhost:8000/admin and play with your app!
That implementation is pragmatic and far for being uncriticable. It's mainly an conceptual approach to use API Platform in order to defer operations to command and query buses.
It could and should be improved, therefore feel free to submit issues and pull requests if something isn't relevant to your use cases or isn't clean enough.
To ensure that the CI will succeed whenever contributing, make sure that either static analysis and tests are successful by running make ci
For the initial project: Mathias Arlaud with the help of Robin Chalas