Api Rest with Symfony 6 + Hexagonal Architecture + DDD & CQRS & Event sourcing.
-
Execute docker-compose:
docker-compose up
-
Enter to the container:
docker exec -it php-app bash
-
Create .env.local configurate emails (EMAIL_ADMIN and EMAIL_FROM) and add this:
DATABASE_URL="mysql://user:123456@db:3306/magazine?serverVersion=5.7"
-
Execute composer install:
composer install
-
Execute this command:
bin/console lexik:jwt:generate-keypair
-
Run migrations:
bin/console doctrine:migrations:migrate
-
Create a new user:
bin/console app:create-user user [email protected] 123456 true
-
In the browser execute http://localhost:8000
-
Configure exchange and queues in rabbitmq:
bin/console app:domain-events:rabbitmq:configure
-
Consume events of a queue, example:
bin/console app:domain-events:rabbitmq:consume app.magazine.post.post_projection_on_post_was_created_event_handler 200 // Dead lettter bin/console app:domain-events:rabbitmq:consume app.magazine.post.post_projection_on_post_was_created_event_handler 200 true
-
For production, generate supervisor consumer files configurations:
bin/console app:domain-events:rabbitmq:generate-supervisor-files
To check elasticsearch projections data: