pnpm workspace monorepo using TypeScript. Contains two games:
- Колесо Адептов (Fortune Wheel) — the main app at
/and/watch, with live broadcasting via WebSocket - Multiplayer Russian Roulette — legacy game, accessible at
/game(host) and/spectate(spectator)
- Monorepo tool: pnpm workspaces
- Node.js version: 24
- Package manager: pnpm
- TypeScript version: 5.9
- API framework: Express 5
- Real-time: Socket.io (server) + socket.io-client (frontend)
- Database: PostgreSQL + Drizzle ORM (provisioned, not used for this game)
- Validation: Zod (
zod/v4),drizzle-zod - API codegen: Orval (from OpenAPI spec)
- Build: esbuild (CJS bundle)
- Frontend: React + Vite, Tailwind CSS, Framer Motion, shadcn/ui
artifacts/roulette-game— React + Vite frontend (preview path:/)artifacts/api-server— Express + Socket.io backend (preview path:/api,/socket.io)
- Socket.io namespace:
/wheel(path/socket.io) - Host connects without query params; viewers connect with
?viewer=1 - Server picks random segment on spin, broadcasts rotation + result to all
- Events emitted:
wheelSync,wheelSpinStart,wheelResult - Events from host:
wheelSpin
pages/HostPage.tsx— host at/, shows mallet, can trigger spinpages/ViewerPage.tsx— viewer at/watch, read-onlycomponents/FortuneWheel.tsx— SVG wheel with 11 colored segments, CSS-transition spincomponents/Mallet.tsx— animated 3D mallet triggercomponents/StarField.tsx— stable background star field (useMemo)hooks/useWheelSocket.ts— unified socket hook for both host and viewer
- Manages game state in memory (single room, 5 players max)
- Socket events:
assignedIndex,updatePlayers,sync,startSpin,stopSpin,shotResult,nextTurn,rematch,roomFull, etc.
pnpm run typecheck— full typecheck across all packagespnpm run build— typecheck + build all packagespnpm --filter @workspace/api-spec run codegen— regenerate API hooks and Zod schemas from OpenAPI specpnpm --filter @workspace/db run push— push DB schema changes (dev only)pnpm --filter @workspace/api-server run dev— run API server locallypnpm --filter @workspace/roulette-game run dev— run frontend locally
See the pnpm-workspace skill for workspace structure, TypeScript setup, and package details.