README
August 14, 2024 ยท View on GitHub
This project is a template for a DDD-based Modulith. It uses Symfony and is fully Docker-compatible and can be executed directly with
docker compose up. The modules are integrated via IntegrationEvents, which can be found in the extra Integration
directory.
A rudimentary library application was implemented to illustrate this. This contains the two BoundedContexts Search and
Loan. Books can be added to Search, which then appear as a publication in Loan. Real books can then be purchased
and borrowed in Loan.
Some useful commands for controlling the application and development are listed below.
Build images
docker compose build
Start application
docker compose up
Install dependencies
docker compose exec -T php composer install
Execute messages interactive
docker compose exec -iT php bin/console messenger:consume
Stop application
docker compose down
Generate migration
docker compose exec -T php bin/console doctrine:migrations:diff --em=<EntityManager>
The database migrations are carried out automatically when the application is started
Debugging
- Start application in xDebug-Mode
XDEBUG_MODE=debug docker compose up -d - In the
Settings/Preferencesdialog, go toPHP | Servers - Create a new server:
- Name:
symfony(or whatever you want to use for the variablePHP_IDE_CONFIG) - Host:
localhost(or the one defined using theSERVER_NAMEenvironment variable) - Port:
443 - Debugger:
Xdebug - Check
Use path mappings - Absolute path on the server:
/app
- Name:
- In PHPStorm, open the
Runmenu and click onStart Listening for PHP Debug Connections - Add the
?XDEBUG_SESSION=PHPSTORMquery parameter to the URL of the page you want to debug.
Update the containerization-template
-
Run the script to synchronize your project with the latest version of the skeleton:
curl -sSL https://raw.githubusercontent.com/mano-lis/template-sync/main/template-sync.sh | sh -s -- https://github.com/dunglas/symfony-docker -
Resolve conflicts, if any
-
Run
git cherry-pick --continue