The Problem
AirPoker was born from a practical dilemma: playing Texas Hold’em with friends in parks or at McDonald’s without hauling around a heavy aluminum case of hundreds of plastic poker chips, risking lost pieces and tedious pot recalculations.
We often had a standard deck of physical playing cards in our backpacks but no chips; other times we had neither cards nor chips but wanted to play a spontaneous game across our smartphones. Existing poker apps in app stores required invasive signups, in-app purchases of play chips, intrusive ads, and public matchmaking with strangers, making a private, frictionless game among friends virtually impossible.
What AirPoker Does
AirPoker is a responsive Progressive Web App built to run instantly on any mobile or desktop browser, offering two distinct gameplay modes:
- Chip Manager for Physical Decks: Players sit around a physical table with real cards dealt by hand, while the web app synchronizes chip stacks, blinds, bets, raises, and exact pot split calculations in real time across everyone’s phones.
- Full Virtual Poker Table: Automated dealing of private pocket cards and community board cards (flop, turn, river), turn timer management, betting animations, and showdown winner determination with algorithmic hand ranking.
Joining a private game room takes seconds via a short room code or direct link, with zero prior registration required.
The Most Complex Technical Challenges
1. Cascading Side-Pot Resolution Algorithm
The most intricate logic in Texas Hold’em involves multi-way all-in scenarios with unequal stack sizes. When three or more players go all-in with different amounts (e.g., Player A with $20, Player B with $50, Player C with $100), the pot must split into a main pot and multiple side pots accessible only to eligible participants. AirPoker implements a deterministic algorithm that tracks player commitments per betting level and distributes each side pot in reverse order of eligibility at showdown.
2. Real-Time Synchronization & Distributed Concurrency
Managing distributed game state on Firestore requires strong guarantees that concurrent actions (such as a timeout fold and a last-millisecond raise) do not produce an inconsistent table state. Using Firestore atomic transactions and onSnapshot reactive listeners, every state mutation is validated and broadcast to all connected devices with sub-second latency.
3. 7-Card Hand Evaluation Engine
At showdown, the algorithm combines each player’s 2 hole cards with the 5 community cards, evaluates the best 5-card hand out of 21 possible combinations, and ranks hands (from high card to royal flush, accounting for kickers and split-pot ties) to award pots accurately.
Tech Stack & Architectural Decisions
- React & TypeScript: Provide strict type safety across the game state machine (table states, valid player actions per turn, hand structures, and pot models).
- Vite & Tailwind CSS: Ultra-fast build times and a high-contrast dark theme optimized for outdoor mobile touchscreens.
- Firebase Anonymous Auth: Enables players to join a room with a single tap, creating a temporary persistent identity for the session without requiring email or password credentials.
- Cloud Firestore: Real-time document database leveraged with an event-driven data model and security rules protecting opponents’ face-down cards.
- Firebase Hosting: Global CDN deployment delivering zero-cost infrastructure and instant worldwide availability.
Outcomes & Key Takeaways
AirPoker demonstrated that a complex, fluid, real-time multiplayer application can run reliably on a zero-cost serverless architecture. The project deepened practical expertise in finite state machine design, distributed state synchronization, and frictionless mobile-first user experience design.