Watch and cheer (by text) as 3 brave snails fight for dominance of the racetrack. Cheering for a snail encourages it to move faster, but eventually they get distracted and slow down (so keep cheering!).
Entry for Zipwhip Hackathon 2020.
- Docker Compose
- Zipwhip API phone number and session key (used for inbound SMS)
- Ngrok.io authentication token (used for proxying webhook to local machine)
Create env.sh:
export ZW_PHONE_NUMBER="<your ZW phone number>"
export ZW_SESSION_KEY="<your key>"
export NGROK_AUTH_TOKEN="<your token>"
or set the values in your shell manually. Run tools/start.sh.
Open src/frontend/index.html in a browser to view.
Control the game state by connecting to Redis and publishing to the commands channel, e.g.:
from redis import Redis
r = Redis()
r.publish('commands', 'next')Docker Compose is used to run 4 components:
- Redis: used for pub/sub channels and storing game state.
- Controller: manages game state and listens for events on Redis pub/sub.
- Sockets: asynchronous Websockets server that publishes game state changes to connected clients.
- Hooks: registers Ngrok endpoint as a webhook in the Zipwhip API, then processes incoming webhook data.
The user interface is a Javascript app that connects to the (local) Websockets server and redraws an HTML canvas with updates to the game state. Cheers and announcments are 'rendered' with CSS animations.
- Send phone number to front-end dynamically
- Delete webhook on registration on shutdown
- Customizable snail names
- Better admin interface than publishing to Redis stream



