Two Players
A web platform for playing classic combinatorial games online, with support for multiple games, room system, and real-time chat.
Why I Built This
While exploring Wikipedia I randomly came across the combinatorial game theory page and found it really interesting. I picked up Lessons in Play based on the recommendations, and on the first chapter it told me to go play some games of Domineering with a friend first. However, I didn’t have dominoes nor a board to play on, looking online I didn’t see any place these classic combinatorial games… So I built one. This project became my way to explore both game theory and full-stack development, and now there is a platform where anyone can play these games with friends online ^^
Play here!: https://two-players.org
Features
- Multiple games: Tic-Tac-Toe, Domineering, Dots and Boxes, and more
- Real-time gameplay with WebSockets
- In-game chat to communicate with your opponent
- Rematch system for playing multiple rounds
- Modern and responsive interface with clean design
Tech Stack
- Backend: Go, PostgreSQL, WebSockets, sqlc, go-migrate
- Frontend: SvelteKit, TypeScript, TailwindCSS, Bun
What I Learned
- Real-time Architecture: Implemented WebSocket-based pub/sub system with goroutine per client pattern, handling concurrent connections with mutex guards and non-blocking channel queues
- Modular Game System: Designed extensible game architecture using factory pattern and interfaces, allowing seamless addition of new games
- Concurrent State Management: Built thread safe room system with lazy loading and automatic cleanup of stale connections
- Database Integration: Managed schema migrations with
go-migrateand generated type-safe queries usingsqlc - Modern Frontend Development: Created reactive UI with SvelteKit components and TailwindCSS, implementing real-time state synchronization
- Production Deployment: Deployed fullstack application on VPS, managing Linux services and PostgreSQL database
Links
Latest Projects
-
Two Players
A web platform for playing classic combinatorial games online, with support for multiple games, room system, and real-time chat.
-
This site!
My personal website. A simple, fast static site serving as my digital portfolio and blog.
-
hntui
A small Hacker News TUI client made while learning Go for CLI/TUI development with Bubble Tea.
Latest Posts
Stats
- Page views: ...
- Time here: 0s
- Full stats: View dashboard →