marcopicasso / sf4-cqrs-es-demo

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.1
  • 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.

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

License:MIT License


Languages

Language:PHP 82.0%Language:HTML 7.9%Language:Dockerfile 6.1%Language:JavaScript 2.2%Language:CSS 1.0%Language:Shell 1.0%