A social deduction game where players must figure out who knows the secret word and who doesn't. Built with React, TypeScript, and Vite.
https://imposter-game-tl.netlify.app/
In this game, players are assigned different roles with different knowledge:
- Good Kittens: Know the real word and must help identify the imposters
- Confused Kittens: Know a related (but different) word, making them appear suspicious
- Spy Pups: Don't know any word and must blend in without revealing their ignorance
The goal is for the Good Kittens to identify the Spy Pups, while the Spy Pups try to avoid detection.
- Select the number of players (4-12)
- Choose how many Spy Pups you want (varies by player count)
- Choose how many Confused Kittens you want (varies by player count)
- Select a word pair:
- Choose from existing word pairs
- Or enter custom words
- Option to randomly select from unplayed word pairs
- Each player takes turns viewing their role and word (if they have one)
- Players must keep their role and word secret
- Spy Pups will see "No Word" instead of a word
- Each player gives one word clue related to their given word
- Players must not repeat another player's clue
- Players must not say the given word itself
- Spy Pups must give a clue without knowing the word, making this phase crucial for detection
- Good Kittens try to identify who doesn't know the word
- Spy Pups try to blend in and guess the word
- Confused Kittens may seem suspicious because they know a different word
- After each discussion phase, all players vote to eliminate one player
- If a Spy Pup is eliminated:
- The eliminated Spy Pup can attempt to guess the word
- If they guess correctly, the Spy Pups and Confused Kittens win the game
- If they guess incorrectly, the game continues with the remaining players
- If a Good Kitten or Confused Kitten is eliminated:
- The eliminated player must reveal themselves by checking against the real word in the app
- The game continues with the remaining players
- The game continues with alternating Discussion and Elimination phases until only 2 players remain. Start with the person to the left of the eliminated player.
- End Game Condition:
- If both remaining players are Good Kittens, the Good Kittens win
- If both remaining players are not Good Kittens (i.e., at least one is a Spy Pup or Confused Kitten), the Spy Pups and Confused Kittens win
- 4 players: 0 Spy Pups, up to 1 Confused Kitten
- 5-8 players: Up to 1 Spy Pup, up to 2 Confused Kittens
- 9-12 players: Up to 2 Spy Pups, up to 3 Confused Kittens
The remaining players are always Good Kittens.
- The game includes a collection of word pairs
- Each word pair consists of a main word (for Good Kittens) and a related word (for Confused Kittens)
- Word pairs are tracked in localStorage to avoid repetition
- Custom word pairs can be entered for more variety
- React 19 - UI framework
- TypeScript - Type safety
- Vite - Build tool and dev server
- Tailwind CSS - Styling
- Radix UI - Accessible component primitives
- shadcn/ui - UI component library
- Node.js (v18 or higher)
- npm or yarn
npm installCreate a .env file in the root directory (copy from .env.example):
VITE_API_BASE_URL=http://localhost:3000/apiEnvironment Variables:
VITE_API_BASE_URL- Base URL for the backend API (used for syncing seen words for authenticated users)
npm run devThe app will be available at http://localhost:5173
npm run buildnpm run previewsrc/
├── components/ # React components
│ ├── SetupScreen.tsx # Game setup and configuration
│ ├── RoleRevealScreen.tsx # Individual role reveal
│ ├── PlayersReadyScreen.tsx # Waiting screen before discussion
│ ├── ResultsScreen.tsx # Final word reveal
│ └── ui/ # Reusable UI components
├── constants/
│ └── game.ts # Game configuration constants
├── data/
│ └── words.ts # Word pair database
├── lib/
│ ├── gameLogic.ts # Core game logic (role/word assignment)
│ └── utils.ts # Utility functions
└── types/
└── game.ts # TypeScript type definitions
Roles are randomly shuffled and assigned to players based on the configuration:
- Spy Pups are assigned first
- Confused Kittens are assigned next
- Remaining players become Good Kittens
- All roles are shuffled randomly
- Good Kittens: Receive the main word from the word pair
- Confused Kittens: Receive the related word from the word pair
- Spy Pups: Receive no word
- ✅ Configurable player counts (4-12)
- ✅ Flexible role distribution
- ✅ Word pair selection or custom words
- ✅ Random word pair selection
- ✅ Played word pair tracking (localStorage)
- ✅ Google OAuth authentication (via Appwrite)
- ✅ Server-synced seen words for authenticated users
- ✅ Responsive design
- ✅ Dark mode support