The goal of the project is to provide example of micro-service (distributed) architecture powered by event sourcing.
There are two main applications.
Read more about story around applications in Domain Scenarios
section
Application for client registration and managing.
Written with DDD
style, using Event Sourcing
with CQRS
(part)
Client writes all events to Event Store.
Application for money management.
Written with clean DDD
and Objective Oriented Mapper.
Banking
When client is created in system, account associated with him is created also. One client can only have one account. Whenever new account is created it should receive new member bonus equal to 100$.
Users can transfer money between accounts, which result in debit client which started transaction and credit the one he chose send money to. All transfers should be visible in transfer history. All transfers should contain client data saved at the time when transfer was made.
User can be blocked. Blocked client can't do anything in the system. Blocked client can be reactivated, then he becomes normal client, with all operations on. Blocked account should not be able to transfer any money out. Transfer in, should be still allowed.
User can become VIP.
There should be possibility to see whole client history (changes over time)
To run the project you need to have installed
- Run docker command
sudo docker run -d --restart=always -p 1111:8080 rancher/server
a) Find out your own IP for example192.168.0.13
. You can useifconfig
command.
- I will use 192.168.0.13 as your IP, replace it with your own. (Do not use localhost or 127.0.0.1)
- Go to
http://192.168.0.13:1080/infra/hosts
a) Click onAdd Host
b) Do not change settings and clickSave
c) ChooseCustom
, type of host d) Copy docker command and run it from your console for example:sudo docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock rancher/agent:v0.8.2 http://192.168.0.13:1111/v1/scripts/454960D9BDBB0F694D89:1443607200000:xtVhhKyVGRBeZxvUf4dN5HdjZ6s
and add env variable to the command:sudo docker run -e CATTLE_AGENT_IP=192.168.0.13 -d --privileged -v /var/run/docker.sock:/var/run/docker.sock rancher/agent:v0.8.2 http://192.168.0.13:1111/v1/scripts/454960D9BDBB0F694D89:1443607200000:xtVhhKyVGRBeZxvUf4dN5HdjZ6s
- Go to
http://192.168.0.13:1080/infra/hosts
and check, if host appeared. If it doesn't exists get back to thepoint 1
. - Run
composer install
insideBanking
andClient
folders - Create
access key
on Rancher - Run with your access key information
rancher-compose --access-key {access_key} --secret-key {secret_key} --url {url} -p event_sourcing up
- Wait 2-5 minutes for everything to start and then run
sh startup.sh
from Banking/migration and Client/migration catalog.