Skip to content
Back to all projects
Deep-Dive Case StudyIn Production

AirPoker

Serverless real-time Texas Hold'em web app: chip manager for physical card games and full virtual poker table with automated side-pot resolution and multi-device state sync.

Role & Contribution

Product Ideation, Architecture, Full-Stack Development & UI/UX

Year

2026

Tech Stack

  • React
  • TypeScript
  • Vite
  • Tailwind CSS
  • Firebase Auth
  • Cloud Firestore
  • Firebase Hosting

Algorithmic Architecture

Cascading Side-Pot Resolution

When multiple players go all-in with unequal chip counts, AirPoker deterministically splits commitments into independent layers.

Example Game Scenario

Player AAll-In

$20

Player BAll-In

$50

Player CCall $100

$100

Resolved Pot Structure

Main Pot$60

$20 from A + $20 from B + $20 from C

Eligible: A, B, C

Side Pot 1$60

$30 from B + $30 from C

Eligible: B, C

Uncalled Surplus (Refund)$50

$50 uncalled from C

Returned directly to: C

Showdown Resolution Rule: Pots are evaluated and awarded from the highest side pot down to the main pot. If Player A holds the absolute best hand, they only win the Main Pot ($60), while Side Pot 1 ($60) goes to the best hand between B and C.

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:

  1. 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.
  2. 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.