How kaiser-inc/resenhark works
ResenhARK is a code-based social game room: people join without accounts, chat in real time, and play server-authoritative games. The main flow runs from the web room/lobby through HTTP and Socket.IO into room state and game engines, with Redis persistence and projected updates. Hitline supports built-in or Spotify-imported playlists and audio previews; Huehint’s backend is ready while its interface is still being built. Edges reflect the README and shown import/call references; unsampled UI and integrations are connected only where documented or directly evidenced.
Main entry points: socket-gateway.ts Socket event gateway · server.ts API server · room-shell.tsx Room interface · rooms.routes.ts Room HTTP routes
Components 22
Web experience
- Home and join
apps/web/src/components/home-actions.tsx - Room interface
apps/web/src/components/room/room-shell.tsx - Hitline interface
apps/web/src/components/hitline/hitline-board.tsx - Huehint interface
apps/web/src/components/huehint/huehint-board.tsx - Lobby setup
apps/web/src/components/lobby/lobby-panel.tsx
API and realtime
- Room HTTP routes
apps/api/src/app/http/routes/rooms.routes.ts - Socket event gateway
apps/api/src/app/realtime/socket-gateway.ts - Room hub
apps/api/src/app/realtime/room-hub.ts - API server
apps/api/src/app/core/server.ts - Room and membership
apps/api/src/app/domain/room/room.ts - Chat validation
apps/api/src/app/domain/room/chat.ts - Audio delivery
apps/api/src/app/http/routes/audio.routes.ts
Game domain
- Hitline engine
apps/api/src/app/games/hitline/engine.ts - Huehint engine
apps/api/src/app/games/huehint/engine.ts - Game registry
apps/api/src/app/games/registry.ts
Media integrations
- Spotify playlist import
apps/api/src/app/gateways/spotify/spotify-playlist-source.ts - Spotify authorization
apps/api/src/app/gateways/spotify/spotify-auth.ts - Audio preview providers
apps/api/src/app/gateways/audio/chained-preview.ts
State and contracts
- Room persistence
apps/api/src/app/repositories/redis-room-store.ts - Shared event contracts
packages/shared/src/realtime.ts
Other components
- Player
- Redis
Connections 29
- Player → Home and join: creates or joins
README.md - Home and join → Room HTTP routes: creates or joins
README.md - Player → Room interface: uses room
README.md - Room interface → Socket event gateway: sends room events
README.md - Room interface → Room HTTP routes: joins by HTTP
README.md - Lobby setup → Socket event gateway: configures game
README.md - Room interface → Hitline interface: shows game
README.md - Room interface → Huehint interface: shows game
README.md - API server → Room HTTP routes: registers
apps/api/src/app/core/server.ts - API server → Room hub: creates
apps/api/src/app/core/server.ts - API server → Socket event gateway: registers
apps/api/src/app/core/server.ts - Room HTTP routes → Room and membership: creates membership
apps/api/src/app/http/routes/rooms.routes.ts - Room HTTP routes → Room hub: mutates room
apps/api/src/app/http/routes/rooms.routes.ts - Socket event gateway → Room hub: mutates room
apps/api/src/app/realtime/socket-gateway.ts - Socket event gateway → Chat validation: validates messages
apps/api/src/app/realtime/socket-gateway.ts - Socket event gateway → Game registry: dispatches game actions
apps/api/src/app/realtime/socket-gateway.ts - Room hub → Game registry: ticks game
apps/api/src/app/realtime/room-hub.ts - Game registry → Hitline engine: dispatches Hitline
apps/api/src/app/realtime/room-hub.ts - Game registry → Huehint engine: dispatches Huehint
- Room hub → Room persistence: loads and saves
apps/api/src/app/realtime/room-hub.ts - Room persistence → Redis: persists state
- Socket event gateway → Shared event contracts: uses event schemas
apps/api/src/app/realtime/socket-gateway.ts - Room interface → Shared event contracts: shares event protocol
README.md - Lobby setup → Spotify playlist import: imports playlist
README.md - API server → Spotify playlist import: configures source
apps/api/src/main.ts - API server → Spotify authorization: configures authorization
apps/api/src/main.ts - API server → Audio delivery: registers
apps/api/src/app/core/server.ts - Audio delivery → Audio preview providers: resolves preview
apps/api/src/app/http/routes/audio.routes.ts - Hitline engine → Audio delivery: serves current draw audio