https://github.com/battermann/connect-4
Connect 4 implemented with event sourcing and CQRS using Haskell, PureScript, Redis, Postgres, GraphQL/Hasura and Elm
https://github.com/battermann/connect-4
cqrs elm event-sourcing graphql haskell hasura microservices no-frameworks postgres purescript redis
Last synced: about 1 month ago
JSON representation
Connect 4 implemented with event sourcing and CQRS using Haskell, PureScript, Redis, Postgres, GraphQL/Hasura and Elm
- Host: GitHub
- URL: https://github.com/battermann/connect-4
- Owner: battermann
- License: mit
- Created: 2019-12-19T14:09:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T17:45:27.000Z (over 2 years ago)
- Last Synced: 2025-02-25T05:04:49.356Z (about 2 months ago)
- Topics: cqrs, elm, event-sourcing, graphql, haskell, hasura, microservices, no-frameworks, postgres, purescript, redis
- Homepage: http://cosmic-ray.surge.sh/
- Size: 19.5 KB
- Stars: 9
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Connect 4
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## Overview
Components:
- [Command API](https://github.com/battermann/cosmic-ray-api) (Haskell, Postgres) [](https://travis-ci.org/battermann/cosmic-ray-api)
- [Read Model/Query API](https://github.com/battermann/cosmic-ray-rm) (Haskell, Hasura, Postgres) [](https://travis-ci.org/battermann/cosmic-ray-rm)
- [Event Publisher](https://github.com/battermann/cosmic-ray-pub) (PureScript, Redis) [](https://travis-ci.org/battermann/cosmic-ray-pub)
- [UI](https://github.com/battermann/cosmic-ray-ui) (Elm) [](https://travis-ci.org/battermann/cosmic-ray-ui)
## Two player games
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.
## Prerequisites
- Make sure you also clone the git submodules e.g. with `git clone --recursive [email protected]:battermann/connect-4.git`
- [Docker Compose](https://docs.docker.com/compose/)
- [Task](https://taskfile.dev/#/installation)## Run with docker
Run
```shell
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/`.
## Run locally
### Prerequisites for running locally
- Elm
- create-elm-app
- node/npm
- stack
- ...Go to `./ui` and run `npm install`.
### Start services locally
To run the application locally, run:
```shell
task db
```Then run each of these commands in a separate terminal window:
```shell
task pub
``````shell
task read-model
``````shell
task cmd-api
``````shell
task ui
```## Todos
- Elm UI: Use one out and one in port