Skip to content

Symfony 4 and CQRS - Event Sourcing within DDD tactical patterns approach implementation

License

Notifications You must be signed in to change notification settings

anhchienhoang/sf4-cqrs-es-demo

Repository files navigation

Symfony 4 - CQRS-ES Demonstration

A simple products management application for learning and sharing purpose which's based on Symfony 4 and implemented CQRS-ES within DDD tactical patterns approach:

Main using components:

For Event Sourcing (ES), it just implemented a basic concept with a single events stream and synchronous projections. In advanced, it could have multiple streams and asynchronous projections.

Feel free to create your PR if you want to change something to make it better.

Watch the running app on Youtube:

Demo App

Requirements

  • PHP >= 7.3
  • MySQL >= 5.7

Installation

Clone the project

$ git clone https://github.com/anhchienhoang/sf4-cqrs-es-demo.git && cd sf4-cqrs-es-demo

For non-docker developers

Setup PHP dependencies

$ composer install

Run migrations

$ ./bin/console doctrine:migrations:migrate

Build Front-end

$ yarn install && yarn build

or

$ npm install && npm run build

Nginx and PHP pool config you can find here

docker/nginx/conf.d/demo.conf
docker/php/pool.d/demo.conf

For docker developers

Start containers:

$ docker-compose up -d

For the first time, it will take a bit of time to get the page is ready (running composer, npm...) and if you access to the homepage, it will display the waiting text.

If there's a service that's not started yet, please run $ docker-compose up -d again

Build Front-end while developing:

$ docker run -it --volume $(pwd):/app -w=/app node:9.0 /bin/bash -c "npm run watch"

Or

$ ./npm.sh run watch

In order to build FE assests, please run

$ ./npm.sh run build

Next you have to update your hosts file (commonly located at /etc/hosts) with the following

127.0.0.1 demo.local

Open your browser and go to

http://demo.local

Add some products, try to update them and check the data in the database to see how it works :)

About

Symfony 4 and CQRS - Event Sourcing within DDD tactical patterns approach implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published