Clean Architecture, DDD and CQRS using Symfony 6
GPL-3.0 License
git clone https://github.com/k0t9i/TaskManager-php-ddd.git
docker-compose -f ./backend/symfony/docker-compose.yml up -d --build
make setup
. This step installs the composer dependency, generates JWT keys, runs migrations, warms up the cache and reloads the supervisor.make test
- phpunit testsmake code-style
- php-cs-fixer checksmake static-analysis
- psalm checksmake check-all
- all of the aboveSwagger api is available on http://127.0.0.1:8081/api/doc
All data is stored on one server in one database, you can see the database structure via adminer http://127.0.0.1:9080/.
Simple vue3 application is available on http://127.0.0.1:7080/
Projects // Code related to a specific bounded context
Application // Application layer depends only on Domain layer
Command
Handler // Command handlers
Service // Application services
Subscriber // Domain event subscribers
Domain // Domain logic layer does not depend on other layers
Collection
Entity // Entities and aggregate roots
Event // Domain events
Exception // Domain exceptions
Repository // Repository interfaces
ValueObject
Infrastructure // Infrastructure layer depends on Domain and Application layers
Persistence // Entity mapping in database
Repository // Repository realizations
Service
Shared // Common code for all bounded contexts
Command and query buses are synchronous, implemented via the symfony messenger.
The application has two event buses: the domain event bus and the integration event bus.
The domain event bus is synchronous, implemented via the symfony messenger and used inside bounded contexts.
The integration event bus is asynchronous, implemented via the symfony messenger and RabbitMQ (http://127.0.0.1:15673/). Events are received from RabbitMQ through the Symfony Messenger, which is launched using the supervisor.
Projections are collected from domain events using the console command, which is launched using the supervisor.
You can always reload projections from scratch with make projections-reload