Skip to content
All projects

Tong Masters

Real-time multiplayer Tong-its in the browser, with bots and a guided tutorial.

tong-its, but online?melds3 playersdraw from the stock, or fight
the napkin

What it is

Tong-its is a Filipino rummy game usually played around a table with three people. Tong Masters puts it in the browser: open a room and play with friends, let bots fill the empty seats, or practice solo against bots. A guided tutorial teaches the rules hand by hand.

How it's built

  • Next.js
  • Cloudflare
  • Durable Objects
  • TypeScript
  • D1
  • Vitest
  1. Next.js web appOn Vercel. Runs solo games with the shared rules engine
  2. Game roomsPartyServer on Cloudflare Durable Objects. Same engine and bots
  3. D1 databaseGuest wallets, chip ledger, play stats

What shipped

Tong Masters solo game on desktop: two bots and the player mid-hand, with the stock, the discard pile and the player's cards.
on a big screen
Tong Masters home screen on a phone, with buttons to play solo, play online with friends or learn to play.
and in your pocket

Hard problems

  1. Fair multiplayer with bots in the mix

    Each room runs on a Durable Object that owns the game state, so players only ever see their own hand. Bots take empty seats through the same server rules as people.

    nobody can peek at your hand

  2. One rules engine, tested first

    The rules and the bot live in a pure TypeScript package written test-first with Vitest. The server, solo mode and the tutorial all run the same engine.

    the tests came before the table

  3. Chips that are only for fun

    Virtual chips can never be bought or cashed out, by design. The server keeps the balances and a ledger, so nothing about a player's chips is trusted from the browser.

    no real money, ever

What's next

  • Done: Bots that fill empty seats
  • Done: A guided tutorial that teaches the rules hand by hand
  • Open it up to more players beyond friends and family
  • Add more Filipino card games once the format is right