ecotone-examples/php-ddd-cqrs-event-sourcing-ecotone

dev-master 2022-02-12 08:41 UTC

This package is auto-updated.

Last update: 2022-03-12 08:55:16 UTC


README

alt text

Application shows the how complex systems can be built with ease using PHP. The example using CQRS DDD and Event Sourcing backed by Prooph in Symfony using Ecotone Framework.

Have fun :)

Run using docker-compose

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
  • The application is available under localhost:3000
  • As read model is updated asynchronously, you may need to refresh after performing action to see the changes.

Run on local Kubernetes

In order to set up local cluster with ease follow the instructions from here. And install skaffold for automatic code synchronization to your Kubernetes. You will be able to modify the code and see the changes instantly on same deployment.

Add to your hosts file (/etc/hosts) ecotone.local.dev for your docker ip address (127.0.0.1 for linux)
Run `skaffold dev --tail`
Enter `https://ecotone.local.dev` and enjoy the application :)

If you want to get more information on how it everything play together visit the blog post.

Possible Integrations with Laravel and Ecotone Lite

Application is written in Symfony, however Ecotone integrates with Laravel and can be run alone without any additional framework (Ecotone Lite). All the code that is written in here, will work exactly the same way, when will be run with Laravel or Ecotone Lite.