This application is an example of a Gamification Bounded Context aligned with the Gamification subdomain, a specialized supporting sudbdomain which handles all the gamification related concerns. This bounded countext exposes a REST API endpoint with two different parts. One exposes all the events published in the bounded context, and the other exposes a simple API to interact directly in terms of the subdomain's ubiquitous language.
This application used as an example in the book Domain-Driven Design in PHP by examples in the Integrating Bounded Contexts chapter. It's full eventsourced and it has integration with the Last Wishes application via messaging using RabbitMQ.
In order to run it, previously you should have to run in the command line
cp .env.dist .envThen edit filling the values according to your environment, especially for the SYMFONY__SECRET, SYMFONY__REDIS_DSN and the SYMFONY__ELASTICSEARCH_HOST environment variables.
To run it you should have Docker Toolbox and docker-compose installed and then just execute the following in the command line
composer install
docker-compose up -d
php app/console server:runAnd then, using your browser, access to
http://127.0.0.1:8000/documentation
It also has two AMQP consumers: one that listens to the Lw\Domain\Model\User\UserRegistered event and the other that listens to the Lw\Domain\Model\Wish\WishWasMade. To run the consumer for the Lw\Domain\Model\User\UserRegistered you should run the following in the command line
php app/console rabbitmq:consumer last_will_user_registeredAnd to run the consumer for the Lw\Domain\Model\Wish\WishWasMade just execute the following in the command line
php app/console rabbitmq:consumer last_will_wish_was_madephp bin/phpspec runEnjoy! :)