Demo provides two PHP Microservices
collaborating with each over RabbitMQ.
First Microservice is using Symfony CQRS DDD Aggregates with Doctrine ORM and Event Sourcing
backed by Prooph, modeled in Hexagonal Architecture.
Second Microservice is using Laravel, DDD Aggregates with Eloquent and asynchronous event handling
.
Each service is powered by Ecotone Framework
Laravel application is Customer Service, where customers can report issues.
Whenever new issue is reported, email is send to the customer confirming, that Customer Service is now working on it.
Symfony application provides Backoffice, where we may register employees.
In Backoffice customer issues are correlated with tickets and employees are responsible for handling them.
Employee that works on the tickets provides information about the status.
When ticket is finished, it's closed with summary.
After ticket is closed, correlated issue from Customer Service is also closed and summary email is sent to the customer.
Go to customer_service
(laravel application) http://localhost:3000/ to report issue as a customer.
After reporting the issue as the customer it will be synchronized to backoffice_service
(symfony application) http://localhost:3001/prepared-tickets.
Whenever issue is reported, confirming email will be sent to the customer http://localhost:3004/.
First time email is send however, it's set up for failing, so you may retry it directly from Ecotone Pulse http://localhost:3006/service/customer_service
- Customer Service - Laravel
- Backoffice - Symfony
- Ecotone Pulse
- Mail Server
- RabbitMQ Management Console
- Symfony and Doctrine ORM as Aggregates
- Laravel and Eloquent as Aggregates
- How to implement CQRS
- How to implement Event Handling
- How to handle Asynchronicity
- How to implement Event Sourcing
- Integrating Microservices
Run docker-compose up -d
Shell:
make start # Starts the containers. `make docker_up_detached` would run it in detached (-d) mode.
make help # To see the available usage command
make [tab] # For autocomplete
make sh # to login to the bash of the app container
# Inside the container
console [tab] # To get all the Symfony's available commands including Ecotone ones
exit
# Outside the container
make db_sql # To access the PostgreSQL command CLI on the database container
make stop # To stop the containers and their networks (keep their volumes and images)
make reset # To remove the containers, their networks, their volumes for then restarting from scratch
make clean # To remove everything from Docker and let your computer as if you never used this repo