A multiplayer Tic-Tac-Toe game implementation using Temporal for state management and synchronization across devices. Inspired by the 4-hour multiplayer game challenge.
tictactoe.mp4
- Room-based multiplayer gameplay
- Real-time updates via WebSockets
- 30-second move timer
- Automatic win/draw detection
- State persistence with Temporal workflows
- Python 3.10+
- Temporal Server
-
Start Temporal Server:
temporal server start-dev --db-filename your_temporal.db --ui-port 8080
-
Run Backend:
cd services/backend pip install -r requirements.txt python server.pyIn a separate terminal:
cd services/backend python worker.py -
Start Frontend:
cd web/frontend python3 -m http.server 8000 -
Play:
- Open
http://localhost:8000in your browser - Create a game room and share the ID
- Second player joins using the room ID
- Open
The application uses Temporal workflows to manage game state and ensure consistency across player sessions. WebSocket connections provide real-time updates between the backend and frontend clients.
MIT License
Inspired by the "Build a multiplayer game in 4 hours" challenge: https://youtu.be/ftYmXoH0V5I