Add hidden imposter or traitor roles to any game. Transform cooperative board games, party games, or group activities by secretly assigning one player as the imposter, thief, saboteur, or traitor.
Examples: Play Monopoly with a secret thief stealing money, or any co-op game where one player secretly works against the group.
- 🎮 Retro pixel art aesthetic with CRT scanlines
- 🎭 Random imposter selection
- 🔒 Secure room-based gameplay
- 📱 Mobile responsive
- ⚡ Real-time multiplayer with WebSockets
# Install dependencies
npm install
# Run development (client on :3000, server on :3001)
npm start
# Or run separately
npm run dev # Client only
npm run server # Server onlyCreate a .env file (see .env.example):
# Server
CORS_ORIGIN=https://yourdomain.com
PORT=3001
# Client (for build)
VITE_SOCKET_URL=https://yourdomain.com# Build client
npm run build
# Run production server
npm run server:prod- Create Droplet (Ubuntu recommended)
- Install Node.js (v20+)
- Clone repo and install dependencies
- Set environment variables
- Build client:
npm run build - Serve built files: Use nginx/Apache to serve
dist/folder - Run server: Use PM2 or systemd to run
npm run server:prod
Create /etc/systemd/system/imposter.service:
[Unit]
Description=Imposter Game Server
After=network.target
[Service]
Type=simple
User=andrew
WorkingDirectory=/srv/imposter
Environment="NODE_ENV=production"
ExecStart=/bin/bash -c 'export PATH=/home/andrew/.nvm/versions/node/v20.19.5/bin:$PATH && npm run server:prod'
Restart=on-failure
[Install]
WantedBy=multi-user.targetThen enable and start:
sudo systemctl enable imposter
sudo systemctl start imposterserver {
listen 80;
server_name imposter.stapps.io;
# Serve client build
location / {
root /srv/imposter/dist;
try_files $uri $uri/ /index.html;
}
# Proxy WebSocket/API to Node server
location /socket.io/ {
proxy_pass http://localhost:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}WebSockets work fine through Cloudflare. No special configuration needed.
- ✅ Input validation (20 char max, alphanumeric only)
- ✅ Rate limiting (2s cooldown on room creation)
- ✅ Room size limits (max 10 players)
- ✅ Host validation (only host can start game)
- ✅ Stale room cleanup (30min inactivity timeout)
- ✅ Memory leak prevention
- ✅ CORS protection
- Frontend: Preact, Signals, Socket.io-client, Vite
- Backend: Node.js, Express, Socket.io
- Styling: Custom CSS (retro/pixel art theme)
MIT