Loading...
Loading...
A social deduction game based on Secret Hitler, set in a dark medieval fantasy world where Loyalists, Traitors, and a hidden Usurper fight through elections, legislation, and executions. The client is completely untrusted — 13 Supabase Edge Functions handle role assignment, deck shuffling, vote tallying, and win conditions. State syncs to players through Supabase Realtime (Postgres CDC on 6 tables, Broadcast for cursors and emoji reactions, Presence for lobby tracking), backed by a polling fallback for reliability. Works as a standalone web app or embedded inside Discord as an Activity.
Each edge function verifies the caller via an anon-key Supabase client, then mutates through a service-role client — basically a privilege escalation gate per request. The policy deck is rows in Postgres with pile/position columns, and RLS uses a SECURITY DEFINER helper to break the recursive lookup loop. Votes have a 'revealed' column gating SELECT visibility that the server flips atomically after tallying. Realtime is split into Presence for lobby identity and Broadcast for high-frequency stuff like cursors, with a 2-second polling interval as a safety net.
A fully playable social deduction game for 5–10 players in real time, with server-enforced rules, cinematic animations, a progressive decay effect that makes the board feel increasingly ominous, and dual deployment as a web app and Discord Activity. The database spans 10 tables with row-level security, and the game loop covers the full Secret Hitler ruleset — including the less common mechanics like veto power, chaos enactment, and special election pointer restoration.