Spyfall
2025A real-time multiplayer web version of the social deduction game, synced over Firebase.
Spyfall is a social deduction game in which every player is shown the same location except one spy, who does not know the location and must answer questions without revealing that fact. The physical game requires a deck of cards; this project implements it as a web application organized around room codes, so a group can play with nothing more than their phones.
A game is hosted in a single room. One player creates the room and shares a six character code, the remaining players join, and the host configures the round. When the round begins, each player privately receives a role and the location, while the spy learns only that they are the spy. A timer drives the questioning phase, and when it expires the group votes on the identity of the spy.
State and synchronization
The principal engineering problem is synchronization. All game state resides in Firebase Realtime Database as a single object per room code, and every client subscribes to it, yielding one source of truth that no individual player controls. Roles are assigned once at the start of the round, so no reconciliation is required during play, and each client receives only its own view, which is what keeps the location hidden from the spy.
Kicks, early round termination, and vote resolution all pass through the same centralized state. This design arose from a concrete failure observed in early development: as soon as two clients can disagree about the phase of the game, the experience collapses. Routing every transition through the shared state proved to be the substantive work of the project, more than any individual feature.
Implementation
The frontend is React with TypeScript on Vite, styled with Tailwind CSS. Firebase supplies the room store and live updates, which reduced the backend to essentially nothing and allowed the effort to concentrate on the state model. The finished application has been used in real games, which is the most demanding test a project of this kind faces.