Trust no one. Survive.
Parasite is a lightweight browser-based social deduction game built with Node.js, Express, Socket.IO, and vanilla HTML/CSS/JavaScript. Players create or join a room, receive hidden roles, move between station rooms, complete tasks, report bodies, call meetings, vote, and survive sabotage.
- Real-time multiplayer rooms with Socket.IO
- 4-10 players per room
- Human and parasite roles
- Private parasite team knowledge
- Room-based movement with travel delay
- Tasks, fake tasks, task cooldowns, and task redistribution after human deaths
- Kill cooldowns and body reporting
- Meetings, voting, ties, skips, and ejection results
- Sabotages: lights, reactor, doors, and communications
- Ghost chat for dead players
- In-memory room lifecycle cleanup
- Server-side validation for room IDs, player names, socket ownership, vote targets, and action phases
Humans
- Complete all real tasks.
- Report bodies.
- Call emergency meetings.
- Vote out parasites.
- Fix sabotages.
Humans win when all tasks are completed or all parasites are eliminated.
Parasites
- Eliminate humans.
- Trigger sabotages.
- Blend in using fake tasks.
- Vote strategically during meetings.
Parasites win when living parasites are greater than or equal to living humans, or when reactor meltdown is not fixed in time.
| Room | Purpose | Sabotage Fix |
|---|---|---|
| Lab | Research and analysis | Lights |
| Reactor | Power core | Reactor |
| Security | Surveillance | Doors |
| Storage | Supplies and cargo | None |
| MedBay | Medical treatment | None |
| Communications | Station communications | Comms |
Move -> Tasks -> Sabotage -> Kill
|
Report -> Meeting -> Vote -> Results -> Repeat
- Dead players cannot move, vote, report, kill, fix sabotages, or use normal chat.
- Dead players can use Ghost Chat.
- Humans can report unreported bodies in their current room.
- Players can only vote during the voting phase.
- Players cannot vote for themselves.
- Vote targets must be alive players, or
skip. - Sabotages can only be triggered by living parasites during gameplay.
- Only one sabotage can be active at a time.
- Actions that finish after a phase change are interrupted instead of mutating state.
- Player names must be 2-20 characters and may contain letters, numbers, spaces, underscores, and hyphens.
| Players | Parasites |
|---|---|
| 4-6 | 1 |
| 7-8 | 2 |
| 9-10 | 3 |
- Node.js 18+ recommended
- npm
npm installnpm startThen open:
http://localhost:3000
The server binds to 0.0.0.0 and uses PORT when provided:
PORT=8080 npm startOn Windows PowerShell:
$env:PORT = "8080"
npm startCore game constants live in server/utils/Constants.js.
Important values:
MIN_PLAYERS: 4,
MAX_PLAYERS: 10,
MEETING_DURATION: 30000,
VOTING_DURATION: 20000,
RESULTS_DURATION: 8000,
TASK_COOLDOWN: 3000,
KILL_COOLDOWN: 45000,
SABOTAGE_COOLDOWN: 45000,
REACTOR_TIMER: 45000,
TASKS_PER_PLAYER: 3parasite/
|-- server.js
|-- package.json
|-- public/
| |-- index.html
| |-- css/
| | `-- style.css
| `-- js/
| `-- client.js
`-- server/
|-- core/
| |-- EventValidator.js
| |-- GameState.js
| `-- PhaseManager.js
|-- rooms/
| `-- RoomManager.js
|-- state/
| `-- PlayerManager.js
|-- systems/
| |-- SabotageSystem.js
| |-- TaskSystem.js
| `-- VotingSystem.js
`-- utils/
`-- Constants.js
Browser client
| Socket.IO
Node.js server
|-- RoomManager: room lifecycle and host tracking
|-- PlayerManager: socket-to-player and player state
|-- GameState: per-room gameplay state
|-- PhaseManager: legal phase transitions
|-- EventValidator: input validation
|-- TaskSystem: role assignment, tasks, redistribution
|-- SabotageSystem: sabotage effects and cleanup
`-- VotingSystem: vote casting and tallying
- Game state is stored in memory. Restarting the server clears all rooms.
- This project does not include accounts, persistence, matchmaking, or reconnect recovery yet.
- Socket actions are checked against the connected socket to prevent basic player impersonation.
- Dynamic chat and player-rendered content is escaped in the browser.
- For public deployments, consider adding rate limiting, structured logging, reconnect support, and automated tests before running large public games.
Create render.yaml:
services:
- type: web
name: parasite
env: node
buildCommand: npm install
startCommand: npm start
plan: freerailway login
railway init
railway upfly launch
fly deploynpm install
npm startFor a long-running production process, use a process manager such as PM2:
npm install -g pm2
pm2 start server.js --name parasite
pm2 saveThere is currently no automated test suite. Useful checks:
node --check server.js
node --check public/js/client.jsFor all project JavaScript files on PowerShell:
rg --files -g "*.js" -g "!node_modules/**" | ForEach-Object { node --check $_ }| Layer | Technology |
|---|---|
| Backend | Node.js, Express |
| Real-time | Socket.IO |
| Frontend | Vanilla HTML, CSS, JavaScript |
| Persistence | In memory |
| Build tools | None |
- Real task minigames instead of timed task placeholders
- Room settings UI for task count, cooldowns, durations, and parasite count
- Reconnect support
- Host migration messaging
- Public/private room options
- More roles, maps, and sabotage types
- Automated tests for state transitions, voting, tasks, sabotage, and disconnects
MIT. See LICENSE.



