{"id":15029119,"url":"https://github.com/event-engine/php-engine-skeleton","last_synced_at":"2025-07-06T18:34:28.628Z","repository":{"id":48639942,"uuid":"176826564","full_name":"event-engine/php-engine-skeleton","owner":"event-engine","description":"Dockerized PHP skeleton for Event Engine","archived":false,"fork":false,"pushed_at":"2023-04-24T22:51:02.000Z","size":4731,"stargazers_count":13,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-25T17:05:04.715Z","etag":null,"topics":["event-engine","php7","prooph","skeleton-application"],"latest_commit_sha":null,"homepage":"https://event-engine.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/event-engine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-20T22:26:47.000Z","updated_at":"2024-04-25T17:05:04.716Z","dependencies_parsed_at":"2024-09-24T20:09:48.798Z","dependency_job_id":null,"html_url":"https://github.com/event-engine/php-engine-skeleton","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/event-engine%2Fphp-engine-skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/event-engine%2Fphp-engine-skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/event-engine%2Fphp-engine-skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/event-engine%2Fphp-engine-skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/event-engine","download_url":"https://codeload.github.com/event-engine/php-engine-skeleton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248107352,"owners_count":21048909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["event-engine","php7","prooph","skeleton-application"],"created_at":"2024-09-24T20:09:46.174Z","updated_at":"2025-04-09T20:32:23.250Z","avatar_url":"https://github.com/event-engine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-engine-skeleton\n\nDockerized PHP skeleton for [Event Engine](https://event-engine.io)\n\n## Installation\nPlease make sure you have installed [Docker](https://docs.docker.com/engine/installation/ \"Install Docker\") and [Docker Compose](https://docs.docker.com/compose/install/ \"Install Docker Compose\").\n\n```bash\n$ docker run --rm -it -v $(pwd):/app prooph/composer:7.4 create-project event-engine/php-engine-skeleton \u003cyour_project_name\u003e\n$ cd \u003cyour_project_name\u003e\n$ sudo chown $(id -u -n):$(id -g -n) . -R\n$ docker-compose up -d\n$ docker-compose run php php scripts/create_event_stream.php\n```\n\nHead over to `https://localhost` to check if the containers are up and running.\nAccept the self-signed certificate and you should see a \"It works\" message.\n\n## Customization\n\nReplace `MyService` in all files to your appropriate service namespace.\n\n@TODO: add functional and oop flavour branches\n\n## Tutorial\n\n[https://event-engine.io/tutorial/](https://event-engine.io/tutorial/)\n\n### Database\n\nThe skeleton uses a single Postgres database for both write and read model.\n\nYou can connect to the Postgres DB using following credentials (listed also in `app.env`):\n\n```dotenv\nPDO_DSN=pgsql:host=postgres port=5432 dbname=event_engine\nPDO_USER=postgres\nPDO_PWD=dev\n```\n\n*Note: The DB runs insight a docker container. Use `localhost` as host name if you want to connect from your host system!*\n\n### Event Engine Cockpit\n[Cockpit](https://github.com/event-engine/cockpit) is an admin UI for Event Engine. You can access it on port `4444`: [https://localhost:4444](https://localhost:4444).\nThe skeleton is preconfigured with the [cockpit-php-backend handler](https://github.com/event-engine/cockpit-php-backend).\n\n*Note: To avoid CORS issues the Nginx configuration of the Cockpit server is modified to also act as a reverse proxy for requests from Cockpit to the backend.*\n\nYou can execute the built-in `HealthCheck` query to very that Cockpit can access the Event Engine backend.\n\n![HealthCheck](https://github.com/event-engine/php-engine-skeleton/blob/master/docs/assets/cockpit_health_check.png?raw=true)\n\n### RabbitMQ\n\nThe skeleton uses RabbitMQ as a message broker with a preconfigured exchange called `ui-exchange` and a corresponding\nqueue called `ui-queue`. You can open the Rabbit Mgmt UI in the browser: `http://localhost:8081` and login with `user: prooph`\nand `password: prooph`.\n\nThe skeleton also contains a demo JS client which connects to a websocket and consumes messages from the `ui-queue`.\nOpen `http://localhost:8080/ws.html` in your browser and forward events on the queue with `$eventEngine-\u003eon(Event::MY_EVENT, UiExchange::class)`.\nCheck `src/Domain/Api/Listener` for an example.\n\n## Unit and Integration Tests\n\nWe've prepared a `BaseTestCase` located in `tests`. Extend your test cases from that class to get access to some very useful test helpers.\nCheck the tutorial for a detailed explanation.\n\nYou can run the tests using docker:\n\n```bash\ndocker-compose run php php vendor/bin/phpunit\n```\n\n## Troubleshooting\n\nWith the command `docker-compose ps` you can list the running containers. This should look like the following list:\n\n```bash\n                    Name                                   Command               State                             Ports                           \n---------------------------------------------------------------------------------------------------------------------------------------------------\neebuildings_event_engine_projection_1    docker-php-entrypoint php  ...   Up                                                                \neebuildings_nginx_1                      nginx -g daemon off;             Up      0.0.0.0:443-\u003e443/tcp, 0.0.0.0:8080-\u003e80/tcp                \neebuildings_php_1                        docker-php-entrypoint php-fpm    Up      9000/tcp                                                  \neebuildings_postgres_1                   docker-entrypoint.sh postgres    Up      0.0.0.0:5432-\u003e5432/tcp                                    \neebuildings_rabbit_1                     docker-entrypoint.sh rabbi ...   Up      0.0.0.0:8081-\u003e15671/tcp, 15672/tcp,                       \n                                                                                         0.0.0.0:15691-\u003e15691/tcp, 25672/tcp, 4369/tcp, 5671/tcp,  \n                                                                                         5672/tcp \n```\n\nMake sure that all required ports are available on your machine. If not you can modify port mapping in the `docker-compose.yml`.\n\n### Have you tried turning it off and on again?\n\nIf something does not work as expected try to restart the containers first:\n\n```bash\n$ docker-compose down\n$ docker-compose up -d\n```\n\n### Projection reset\n\nThe Event Engine Skeleton uses a single projection process (read more about prooph projections in the [prooph docs](http://docs.getprooph.org/event-store/projections.html#3-4)).\nYou can register your own projections in event engine which are all handled by the one background process that is started automatically\nwith the script `bin/event_engine_projection.php`. Also see `docker-compose.yml`. \nThe projection container is not activated by default. Uncomment it in the `docker-compose.yml` to make use of it. \n\nDocker is configured to restart the projection container in case of a failure. \nIn dev mode, the projection process dies from time to time to catch up with your latest code changes.\n\nIf you recognize that your read models are not up-to-date or you need to reset the read model you can use this command:\n\n```bash\n$ docker-compose run php php bin/reset.php\n```\n\nIf you still have trouble try a step by step approach:\n\n```bash\n$ docker-compose stop event_engine_projection\n$ docker-compose run php php bin/reset.php\n$ docker-compose up -d\n```\n\nYou can also check the projection log with:\n\n```bash\n$ docker-compose logs -f event_engine_projection\n```\n\n### Event Engine Cockpit is not updated\n\nWhen you add new commands or queries in Event Engine the Cockpit UI will not automatically reread the schema from the backend.\nUse the refresh button in the top menu to reload the schema.\n\n\n## Batteries Included\n\nYou know the headline from Docker, right?\nThe Event Engine skeleton follows the same principle. It ships with a default set up so that you can start without messing around with configuration and such.\nThe default set up is likely not what you want to use in production. The skeleton can be and **should be** adapted.\n\nFocus of the skeleton is to provide *an easy to use development environment*, hence it uses default settings of Postgres and RabbitMQ containers.\n**Make sure to secure the containers before you deploy them anywhere!** You should build and use your own docker containers in production anyway.\nAnd if you cannot or don't want to use Docker then provide the needed infrastructure the way you prefer and just point Event Engine to it by adjusting configuration.\n\n## Powered by prooph software\n\n[![prooph software](https://github.com/codeliner/php-ddd-cargo-sample/blob/master/docs/assets/prooph-software-logo.png)](http://prooph.de)\n\nEvent Engine is maintained by the [prooph software team](http://prooph-software.de/). The source code of Event Engine \nis open sourced along with an API documentation and a getting started demo. Prooph software offers commercial support and workshops\nfor Event Engine as well as for the [prooph components](http://prooph.de).\n\nIf you are interested in this offer or need project support please [get in touch](http://getprooph.org/#get-in-touch).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevent-engine%2Fphp-engine-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevent-engine%2Fphp-engine-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevent-engine%2Fphp-engine-skeleton/lists"}