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
Screenshots coming soon.
Stack
- Next.js
- TypeScript
- Redis
- Server-Sent Events
- Tailwind CSS
- Playwright