A server-authoritative, real-time multiplayer snake game built with TypeScript and WebSockets.
- https://slither-1.onrender.com/ (Render cold start: wait ~30 seconds for the backend to boot on first load)
- Server-authoritative simulation at 30 ticks/sec
- Client-side interpolation for smooth rendering
- Typed message protocol (
join,move,boost->state,dead,join_ack) - Canvas rendering with name tags, radar minimap, and leaderboard
- Join/death/respawn lifecycle with overlay screens
- WebSocket server simulates game state and broadcasts snapshots.
- Clients send input events only; rendering uses interpolated snapshots.
- Stateless connections (no cookies or sessions).
- Node.js 20, TypeScript 5, Vite 7, HTML Canvas, WebSocket (ws), msgpackr
server/WebSocket game serverclient/Vite + Canvas client
cd server
npm install
npm run devcd client
npm install
VITE_WS_URL=ws://localhost:8080 npm run devnpm run dev- run server with tsxnpm run build- compile TypeScriptnpm run start- run compiled servernpm run test- run testsnpm run bench- run benchmark
npm run dev- start Vite dev servernpm run build- production buildnpm run preview- preview build