Backend server for a generic board game. Design goals:
- Easy to extend for any turn-based game implementation
- Effortless game hosting and joining, with no authentication
- Typed realtime API via GraphQL subscriptions
- Persistence via Redis so a game can be dropped and picked up at any time by anyone
cd serveryarn installto install JS/TS packagesyarn dev-redisto start Redis in Dockeryarn devto start devserver and auto-generate nexus schema
For deployment, set the env vars:
REDIS_HOST: The host of the Redis serverREDIS_PORT: The port of the Redis server
cd clientyarn installto install JS/TS packagesyarn devto start devserver
For deployment, set the env vars:
REACT_APP_SERVER_ENDPOINT: The URL of the serverREACT_APP_URL_BASE: Used to determine share URLs, etc
There is an assumption that a single game is hosted by a single Node server. Race conditions with Redis when multiple Node servers access the same game are not accounted for.
