Home

Awesome

Symfony 6 ES CQRS Boilerplate

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

All Contributors

<!-- ALL-CONTRIBUTORS-BADGE:END -->

A boilerplate for DDD, CQRS, Event Sourcing applications using Symfony as framework and running with PHP 8.

push

This is a long living repository that started at v4 and was upgraded to each mayor since then. You can find v4 and v5 versions at the following branches:

symfony-5 branch

symfony-4 branch

Documentation

Buses

Creating an Application Use Case

Adding Projections

Async executions

UI workflow

Xdebug configuration

Kubernetes Deployment

Architecture

Architecture

Implementations

Use Cases

User

API Doc

Stack

Project Setup

ActionCommand
Setupmake start
Run Testsmake phpunit
Static Analisysmake style
Code Stylemake cs
Code style checkmake cs-check
PHP Shellmake s=php sh
Xdebugmake xoff/xon
Build Artifactsmake artifact

PHPStorm integration

PHPSTORM has native integration with Docker compose. That's nice but will stop your php container after run the test scenario. That's not nice when using fpm. A solution could be use another container just for that purpose but is way slower and I don't want. For that reason I use ssh connection.

IMPORTANT

ssh in the container it's ONLY for that reason and ONLY in the DEV TAG, if you've ssh installed in your production container, you're doing it wrong...*

Click here for the detailed instructions about how to setup the PHP remote interpreter in PHPStorm.

If you're already familiar with it, here a quick configuration reference:

HostDirection
Docker 4 maclocalhost
Dinghy$ dinghy ip

Port: 2323

Filesystem mapping: {PROJECT_PATH} -> /app

Xdebug

To ease your development process, you can use Xdebug with PHPSTORM.

  1. Add a Docker interpreter

    Docker PHP interpreter

  2. Enable Xdebug listenning. Don't forget to also activate Xdebug helper from your browser.

    Xdebug activation

    Additionally, you can check Break at first line in PHP scripts to ensure your debug is working.

  3. Make a request from you API at http://127.0.0.1/api/doc for example. You should see this popup:

    Xdebug mapping

    Click on Accept and you should be ready to debug ! Start placing breakpoints on your code and enjoy debugging !

Note for Windows users:

You might need to update docker-os= to docker-os=windows in Makefile or specify its value on command line like $ make start docker-os=windows.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tr> <td align="center"><a href="http://tacon.eu"><img src="https://avatars2.githubusercontent.com/u/2017676?v=4" width="100px;" alt=""/><br /><sub><b>Luis</b></sub></a><br /><a href="https://github.com/jorge07/symfony-6-es-cqrs-boilerplate/commits?author=Lutacon" title="Code">💻</a></td> <td align="center"><a href="https://github.com/cv65kr"><img src="https://avatars0.githubusercontent.com/u/9404962?v=4" width="100px;" alt=""/><br /><sub><b>Kajetan</b></sub></a><br /><a href="https://github.com/jorge07/symfony-6-es-cqrs-boilerplate/commits?author=cv65kr" title="Code">💻</a></td> <td align="center"><a href="https://coderslab.pl"><img src="https://avatars0.githubusercontent.com/u/2781079?v=4" width="100px;" alt=""/><br /><sub><b>Krzysztof Kowalski</b></sub></a><br /><a href="https://github.com/jorge07/symfony-6-es-cqrs-boilerplate/commits?author=kowalk" title="Code">💻</a></td> <td align="center"><a href="http://patryk.it"><img src="https://avatars3.githubusercontent.com/u/17459288?v=4" width="100px;" alt=""/><br /><sub><b>Patryk Woziński</b></sub></a><br /><a href="https://github.com/jorge07/symfony-6-es-cqrs-boilerplate/commits?author=patrykwozinski" title="Code">💻</a></td> <td align="center"><a href="https://github.com/jon-ht"><img src="https://avatars3.githubusercontent.com/u/17051512?v=4" width="100px;" alt=""/><br /><sub><b>jon-ht</b></sub></a><br /><a href="https://github.com/jorge07/symfony-6-es-cqrs-boilerplate/commits?author=jon-ht" title="Code">💻</a></td> </tr> </table> <!-- markdownlint-enable --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the all-contributors specification. Contributions of any kind welcome!