Workshop DDD x API Platform
This is a demo project used for the DDD x API Platform Workshop by @chalasr & @mtarld from @coopTilleuls.
Checkout
git clone [email protected]:coopTilleuls/workshop-apip-ddd
Setup
make start
1) Modelling the Domain
git checkout step1-domain
You've got:
- An
api-platform
with Hexagonal Architecture. - Two Bounded Contexts:
Book
andStock
with Aggregates (Entites & VOs)
2) Defining the Application' Use Cases
git checkout step2-application
You've got:
- CRUD-like Commands, Queries, Handlers, Repository interfaces and Domain exceptions allowing to interact with
Book
context.
3) Wire everything to make things works
git checkout step3-infrastructure
make db-reset
Now the Application use cases are exposed through an API using api-platform
, Commands & Queries get handled thanks to symfony/messenger
, and data are persisted thanks to doctrine
.
4) Exercise
git checkout step4-exercise
You have got a test case covering a new use case allowing to borrow a Book from the Stock. The test case is skipped for now - Your turn, make it pass! :)