Exemplary event sourcing and CQRS implementation of the game Connect 4 using
- Haskell
- PureScript
- Elm
- Postgres
- Redis
- GraphQL/Hasura
- No ES/CQRS framework
- No bullshit
Components:
- Command API (Haskell, Postgres)
- Read Model/Query API (Haskell, Hasura, Postgres)
- Event Publisher (PureScript, Redis)
- UI (Elm)
The player identity is tied to a browser instance. So to play a two player game ideally you should play on two different devices. If played on the same device make sure to use different browser instances.
- Make sure you also clone the git submodules e.g. with
git clone --recursive [email protected]:battermann/connect-4.git
- Docker Compose
- Task
Run
task up
Note that if this task is run for the first time it will take a very very long time to build the Haskell containers.
Then browse to http://localhost:3000/
.
- Elm
- create-elm-app
- node/npm
- stack
- ...
Go to ./ui
and run npm install
.
To run the application locally, run:
task db
Then run each of these commands in a separate terminal window:
task pub
task read-model
task cmd-api
task ui
- Elm UI: Use one out and one in port