A real-time multiplayer maths game where players compete head-to-head by solving arithmetic questions as quickly as possible.
Live Demo: https://games.amitesh.work
- User authentication
- Friend requests and social interactions
- Real-time matchmaking
- Multiplayer gameplay using WebSockets
- Live score updates
- Automatic result calculation
- Persistent game history
- Production-ready deployment setup
- Next.js
- TypeScript
- Tailwind CSS
- Node.js / Bun
- WebSockets
- PostgreSQL
- Redis
- BullMQ
- Docker
- Nginx
- AWS
- GitHub Actions (CI/CD)
- Turborepo Monorepo
- WebSocket server for low-latency gameplay.
- Bidirectional communication between players and server.
- Live game state synchronization.
- Queue-based player matching using Redis.
- Efficient opponent discovery and game creation.
-
BullMQ workers handle asynchronous jobs:
- Match creation
- Result processing
- Notifications
-
PostgreSQL stores:
- Users
- Friend relationships
- Match history
- Game statistics
Implemented a queue-driven matchmaking system to avoid race conditions during player pairing.
Used WebSockets and server-authoritative state management to keep both players synchronized.
Separated responsibilities between HTTP services, WebSocket services, workers, and Redis to make the architecture horizontally scalable.
apps/
packages/
ops/
The project uses a Turborepo-based monorepo for sharing code and simplifying development workflows.
git clone https://github.com/DevDesignAmitesh/games
cd games
bun install
docker compose -f ./ops/dev.docker-compose.yml upConfigure environment variables:
cp .env.example .envStart the development servers:
bun dev- Building real-time multiplayer systems
- WebSocket architecture and state synchronization
- Redis-based coordination and queues
- Background job processing with BullMQ
- Production-grade Docker deployments
- CI/CD pipelines
- Monorepo architecture
- Designing scalable backend systems
