Muzzamil Khan (Muzza)
All projects

Villagers

Social deduction for one room and one phone per player

Overview

A medieval, mobile-first social-deduction party game - Mafia or Werewolf as a web app. One host creates a game and shares a four-letter code, everyone joins on their own phone, and the discussion happens out loud in the room.

Roles are assigned secretly, then each round cycles through night, dawn, trial, and verdict until the killers are caught or reach parity with the living villagers.

Key features

Per-player state filtering
Each server-sent event stream is filtered for the player receiving it, so a client is never sent a role it should not be able to see.
A night phase that gives nothing away
Every role taps a target on an identical screen, so a shoulder-surfer cannot tell a killer's move from a villager's.
Spectator mode for the big screen
A read-only projected view shows phase, live vote tally, and who is still alive - receiving only public state, never hidden roles.
Reconnection without losing your role
Every player holds a private token, so a refresh reopens the stream and restores both identity and role.
Real-time without a socket server
Server-sent events carry state to clients and plain POSTs carry actions, with Redis as the single source of truth and pub/sub fan-out.

Screenshots

  • The Gathering: Getting eight people into a game takes one code read out loud. Nobody installs anything or makes an account, the host can remove a wrong name before starting, and the settings everyone is about to play under are on the same card as the code.

  • Night, from two phones at once: The same moment in one game, on a killer's phone and a villager's. Both see one grid of names and both tap once, so the person beside you learns nothing from watching you play. Only the private card differs, and it sits face down until its owner taps to look.

  • The Trial: Daytime accusation is the part of the game that happens out loud, so the phone only keeps score. The running tally is public while the vote is still open, which is what lets the room argue about a swing before the host locks it in.

  • Spectator screen: Cast to a TV so the room shares one source of truth. It receives public state only, never a hidden role, so the screen everyone is looking at cannot leak the thing the game depends on keeping secret.

  • The reveal: Every role is published the moment the game is decided, which settles the arguments the round produced and is usually when the table starts a second game.

Stack

  • Next.js
  • TypeScript
  • Redis
  • Server-Sent Events
  • Tailwind CSS
  • Playwright