Each team gets a buzzer link (/b/[token]); a game opts in with a
"Teams buzz in" checkbox. The database's clock orders the buzzes, so
the result doesn't depend on phone clocks. The control room lists the
order and clears it per question (B); the scoreboard shows who buzzed
first with a ding.
Buzzes follow the existing rules: token-gated route handlers with the
service-role client, RLS on the new table, and data-free realtime pings
on a new buzzer:{eventId} channel.
Needs supabase/migrations/0003_buzzer.sql applied before deploying.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 lines
386 B
TypeScript
10 lines
386 B
TypeScript
// Shared by the server (notify) and the browser (useRefreshChannel). See docs/ARCHITECTURE.md.
|
|
export const REFRESH_EVENT = "refresh";
|
|
|
|
export const channelNames = {
|
|
scoreboard: (scoreboardToken: string) => `sb:${scoreboardToken}`,
|
|
game: (gameId: string) => `game:${gameId}`,
|
|
admin: (eventId: string) => `admin:${eventId}`,
|
|
buzzer: (eventId: string) => `buzzer:${eventId}`,
|
|
};
|