Skip to content
Yasir Uslu
All work

An installable app for the real table

Okey 101 Scoreboard

An app that replaces the paper scorecard for Okey 101 played at a real table. You enter who finished, how, and the tiles left in hand; penalties and totals follow the rules. It installs like an app, opens without a connection, and the rest of the table follows the score live on their own phones via a QR code.

Status
Live
Tools
Next.js 16 · React 19 · TypeScript · PWA · Service Worker · Upstash Redis · Vitest · Playwright
Okey 101 Scoreboard screenshot

The problem

Paper scorecards invite arithmetic slips and long rule debates: finishing with the okey doubles penalties, opening with pairs doubles a hand, players who never opened take a fixed penalty. The app is used at the table, often on a weak connection and one-handed, so it had to be fast, exact and work offline.

My role

Sole developer: scoring rules, interface, offline support, the live-sharing service and tests.

Approach

  1. 01

    Rules in one place, tested

    Finish types, multipliers and optional penalties live in one pure TypeScript module; the UI only renders results. House-specific values are adjustable in settings, and every finish type is covered by unit tests.

  2. 02

    Installs and opens offline

    It has its own manifest and icons for the home screen. A service worker caches the page and its loaded assets; offline it opens the last version and announces updates when they arrive. The game is stored on the device, so a refresh never loses the table.

  3. 03

    Fast one-handed entry

    On phones a custom number pad with a “next player” key replaces the system keyboard; a saved hand can be undone from the toast, and the screen stays awake during play. Finished tables are kept in history with per-player statistics.

The hard part

Live viewing without a socket server

The hosting doesn’t suit long-lived connections. The scoring phone sends a snapshot of the table on every save; viewers poll every 4 seconds and get a body-less 304 when nothing changed, and stop polling in background tabs. The write key stays on the sharing device and the server keeps only its SHA-256 hash; links expire after two days and creation is rate-limited per IP.