A real-time multiplayer Pong game built with Centrifugo WebSocket server, Go backend, and vanilla JavaScript frontend. Players connect via WebSocket for low-latency gameplay, with automatic disconnect handling through Redis presence monitoring.
Live demo: pong.stabalmo.pro
See the Getting Started guide for installation instructions.
| Repository | Description |
|---|---|
| frontend | Vanilla JavaScript game client with canvas rendering and Centrifugo WebSocket integration |
| backend | Go REST API handling game logic, JWT authentication, and Redis presence monitoring |
| iac | Infrastructure as Code for Redis and Centrifugo services |
| terraform | AWS infrastructure provisioning with EKS, ElastiCache Redis, S3, and CloudFront |
- Read the Technical Architecture Guide for in-depth documentation on how Centrifugo, Redis, and Backend work together.
- Learn about Centrifugo real-time messaging server.
- Browse the backend API in the backend repository.
Players authenticate via JWT tokens and connect to Centrifugo WebSocket channels. Game state updates flow through dedicated channels for each player position. When a player disconnects (browser close, network failure, or page refresh), the backend detects this through dual strategies: Redis pub/sub for instant leave events, and presence monitoring for stale connections. The game automatically ends and the lobby resets.
The backend and frontend were largely written using vibe-coding (AI-assisted development). My focus was on system architecture, infrastructure design, and understanding how Centrifugo, Redis, and real-time communication work together. I'm not proficient in Go or Vue/JavaScript, but that didn't stop me from building a working multiplayer game.
This approach lets you focus on what matters most — architecture decisions, SRE practices, and understanding the system as a whole — while AI handles the implementation details. Even Linus Torvalds uses AI assistance for his personal projects.
Contributions are welcomed and encouraged. Pull requests welcome. For major changes, open an issue first.
A real-time multiplayer Pong implementation demonstrating WebSocket-based game architecture with Centrifugo, Go, and vanilla JavaScript.
Created by Danila Alferov (LinkedIn, @Stabalmo)