ARTICLE
Designing a Read-Only Live Scoreboard With Guest Sharing
How the Hazari scorekeeper shares a live scoreboard by link: opt-in guest sharing, an unguessable link, owner-only writes, expiry and revocation.
Tags
- Firebase
- Firestore
- Security
- Real-Time
- Hazari
Published November 24, 2026.
The scorekeeper works fully offline, so live sharing had to be an add-on, not a requirement. The design goal was simple to say and tricky to build: friends can watch a game live from a link, they can never change it, and the scorer can switch it off.
Opt-in, and guest by default
Nothing is shared until the scorer taps Start sharing. Only then is an anonymous guest identity created, so local scoring and spectating never create one. Signing in with Google is optional, and linking Google keeps the same identity, so existing links are not orphaned.
The link is the key
Each shared scoreboard has a long random identifier, generated on the device. Anyone who has the link can watch and nobody can list scoreboards or guess one. The database rules deny listing and deny spectator writes, so viewing is the only thing a link allows.
One writer
Only the owner's identity can write or delete a shared scoreboard, and the rules bound the size and shape of what is written. The scorer's phone stays the source of truth: scoring is saved locally first, then published.
Publishing that does not slow scoring
Saved changes are batched into one snapshot and published in order. If a publish fails, it retries with growing delays up to 30 seconds, and a reconnect sends the newest state at once. A successful write counts as confirmed without an extra read. Scoring never waits for any of it.
Expiry and revocation
- Every link expires on its own, within 24 hours of creation.
- Stopping sharing closes the link. If the scorer is offline, the closure is queued and completed when the app reconnects.
- Clearing device data closes every link that device owned, so a reset cannot leave a live scoreboard behind.
- A replacement is a new link, never a resurrection of the old one.
One link for a whole session
When a game ends and the group plays again, the same link follows the new game, so viewers do not need a new link every time. They can also look back at the earlier games in the session.
What viewers never get
A viewer sees names, colours, rules and saved rounds. Drafts, recent names, other games and the scorer's Google profile are never in the shared data.
Testing it
The database rules are tested against a local emulator, along with browser tests covering two sessions at once, guest start, Google linking, reconnecting, expiry and revocation. Those tests use a demo project, never real game data.
To use it, follow the guide on sharing a Hazari scoreboard. For the offline side of the app, see how it works without a connection.
Play it or score it
Play Hazari alone against the computer, or keep score and share the banter with your friends. It is free and works offline.
More Hazari guides
Odds and numbers
- How Rare Is a Troy? The Odds of Every Three-Card Hand in Hazari
- Why Every Hazari Deal Is Worth Exactly 360 Points
- How Many Deals Does a Game of Hazari to 1,000 Take?
- 200,200 Ways to Arrange 13 Cards: Why Hazari Is Harder Than It Looks
Strategy
- How to Arrange Your Cards in Hazari: A Practical Guide to 3-3-3-4
- The Four-Card Group in Hazari: Weakest by Rule, Biggest Prize in the Deal
- 7 Mistakes New Hazari Players Make When Arranging Cards
- One Hazari Deal, Round by Round: A Worked Example with Real Cards
Scoring and house rules
- Scoring Hazari Round by Round: One Full Game to 1,000, Worked Through
- How to Settle a Hazari Scoring Argument in Two Minutes
- Hazari House Rules Checklist: Agree These 8 Things Before the First Deal
- Paper or App? How to Keep Hazari Score Without Arguments
Playing with friends
- Roasting Your Friends at the Hazari Table: Funny Leaderboard Tags
- Let Friends Watch Your Hazari Game Live: How to Share a Scoreboard
- Play Hazari Alone: Practise Against Three Computer Players
Behind the app
- How I Built an Offline Hazari Scoring App Friends Can Watch Live
- How the Hazari Computer Opponent Chooses Its Cards
- Building an Offline-First Scorekeeper: IndexedDB, a Service Worker and No Backend
- টেক্কা, সাহেব, বিবি, গোলাম: Making a Card Game App Natural in Bangla
- Making a React App Findable: Real HTML Pages Before JavaScript Runs