How saainikhil/least-count works
Least Count is a real-time multiplayer card game with a React client and an authoritative Socket.IO server, plus a local System Bot mode. The main workflow is to create or join a room, ready up, play setup and turn actions, and view round and final scores; players can also start a bot game or consult rules and customize themes. The README documents reconnect recovery and sanitized player views. Some client and server implementation details are unsampled, so those links rely on README statements rather than inferred source calls.
Main entry points: main.tsx App coordinator · server.ts Socket.IO server · Table.tsx Game table · engine.ts Game engine
Components 19
Web client
- App coordinator
frontend/src/main.tsx - Home screen
frontend/src/pages/HomePage.tsx - Friends rooms
frontend/src/pages/FriendsPage.tsx - Room lobby
frontend/src/pages/LobbyPage.tsx - Game table
frontend/src/components/Table.tsx - Card renderer
frontend/src/components/Card.tsx - Score modal
frontend/src/components/ScoreModal.tsx - Game result modal
frontend/src/components/GameOverModal.tsx - Theme settings
frontend/src/pages/SettingsPage.tsx - Rules guide
frontend/src/pages/RulesPage.tsx - Client game types
frontend/src/types/game.ts
Realtime server
- Socket.IO server
backend/server.ts - Room sessions
backend/server.ts - Viewer state
backend/server.ts
Game runtime
- Game engine
backend/src/game/engine.ts - Game protocol
backend/src/types/game.ts - Engine facade
frontend/src/game/engine.ts - System Bot
frontend/src/game/systemBot.ts
Other components
- Player
Connections 25
- Player → App coordinator: uses
README.md - App coordinator → Socket.IO server: sends room actions
README.md - Socket.IO server → Room sessions: manages sessions
backend/server.ts - Socket.IO server → Game engine: validates actions
README.md - Socket.IO server → Viewer state: broadcasts sanitized views
README.md - Viewer state → App coordinator: sends game state
README.md - App coordinator → Home screen: renders
frontend/src/main.tsx - App coordinator → Friends rooms: renders
frontend/src/main.tsx - App coordinator → Room lobby: renders
frontend/src/main.tsx - App coordinator → Game table: renders
frontend/src/main.tsx - App coordinator → Score modal: renders
frontend/src/main.tsx - App coordinator → Game result modal: renders
frontend/src/main.tsx - App coordinator → Theme settings: renders
frontend/src/main.tsx - App coordinator → Rules guide: renders
frontend/src/main.tsx - App coordinator → Game engine: runs local game
README.md - App coordinator → System Bot: runs bot turns
frontend/src/main.tsx - Game table → Card renderer: renders cards
frontend/src/components/Table.tsx - Game table → Engine facade: scores hand
frontend/src/components/Table.tsx - Engine facade → Game engine: re-exports
frontend/src/game/engine.ts - System Bot → Engine facade: uses rules
frontend/src/game/systemBot.ts - Game engine → Game protocol: uses game types
backend/src/game/engine.ts - Socket.IO server → Game protocol: uses state schemas
backend/server.ts - App coordinator → Client game types: uses client state
frontend/src/main.tsx - Game table → Client game types: renders typed state
frontend/src/components/Table.tsx - Rules guide → Card renderer: shows examples
frontend/src/pages/RulesPage.tsx