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 git@github.com:battermann/connect-4.git - Docker Compose
- Task
Run
task upNote 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 dbThen run each of these commands in a separate terminal window:
task pubtask read-modeltask cmd-apitask ui- Elm UI: Use one out and one in port