How nathanndasilva/carcassonne-multiplayer works
Carcassonne Multiplayer Web is a real-time, up-to-six-player web board game with online rooms, local play, bots, chat, and a shared rules engine. Players join or create a lobby, start a match, draw and place tiles, optionally place meeples, score features, and see final standings; server events synchronize online games. The graph preserves the documented visual board, HUD, and synthesized audio capabilities. Evidence is limited to README statements and indexed excerpts; unsampled subsystem links are omitted where the caller is not shown.
Main entry points: gameStore.ts Client game state · socketClient.ts Socket client · App.tsx Application shell · GameBoard.tsx Interactive board
Components 19
Game client
- Application shell
client/src/App.tsx - Room lobby
client/src/components/Lobby/RoomLobby.tsx - Interactive board
client/src/components/Board/GameBoard.tsx - Game chat
client/src/components/Chat/ChatDrawer.tsx - Client game state
client/src/store/gameStore.ts - Socket client
client/src/socket/socketClient.ts
Realtime server
- Socket server
server/index.ts - Room and turn manager
server/roomManager.ts
Game rules
- Bot decisions
shared/bot.ts - Rules and scoring engine
shared/engine.ts - Tile deck
shared/tileDeck.ts - Game domain types
shared/types.ts
Game presentation
- Game HUD
client/src/components/HUD - Tile and meeple SVG
client/src/components/TileRenderer/TileSVG.tsx - Results and menu
client/src/components/Modals/GameOverModal.tsx - Synthesized audio
client/src/sound/audioEffects.ts
Other components
- Players
- Socket.io transport
- Web browser
Connections 30
- Players → Room lobby: joins or configures
README.md - Application shell → Room lobby: shows before game
client/src/App.tsx - Application shell → Interactive board: shows during game
client/src/App.tsx - Application shell → Game HUD: shows game panels
client/src/App.tsx - Application shell → Game chat: shows chat
client/src/App.tsx - Application shell → Results and menu: shows results
client/src/App.tsx - Room lobby → Socket client: emits room actions
client/src/components/Lobby/RoomLobby.tsx - Room lobby → Client game state: updates local game
client/src/components/Lobby/RoomLobby.tsx - Interactive board → Client game state: reads and updates
client/src/components/Board/GameBoard.tsx - Interactive board → Rules and scoring engine: checks placements
client/src/components/Board/GameBoard.tsx - Interactive board → Socket client: submits tile moves
client/src/components/Board/GameBoard.tsx - Interactive board → Tile and meeple SVG: renders tiles
client/src/components/Board/GameBoard.tsx - Game HUD → Client game state: reads game state
client/src/components/HUD/PlayerScoreboard.tsx - Game HUD → Tile and meeple SVG: renders meeples
client/src/components/HUD/PlayerScoreboard.tsx - Game chat → Socket client: sends messages
client/src/components/Chat/ChatDrawer.tsx - Game chat → Client game state: reads messages
client/src/components/Chat/ChatDrawer.tsx - Results and menu → Client game state: reads final state
client/src/components/Modals/GameOverModal.tsx - Socket client → Client game state: applies server events
client/src/socket/socketClient.ts - Client game state → Synthesized audio: plays turn and score cues
client/src/store/gameStore.ts - Web browser → Socket client: runs connection
- Socket client → Socket.io transport: exchanges events
client/src/socket/socketClient.ts - Socket.io transport → Socket server: delivers events
README.md - Socket server → Room and turn manager: handles room actions
server/index.ts - Socket server → Bot decisions: requests bot move
server/index.ts - Room and turn manager → Rules and scoring engine: validates and scores
server/roomManager.ts - Bot decisions → Rules and scoring engine: evaluates candidate moves
shared/bot.ts - Rules and scoring engine → Tile deck: uses tile definitions
shared/engine.ts - Socket server → Socket.io transport: broadcasts game updates
- Room and turn manager → Game domain types: uses game state types
server/roomManager.ts - Rules and scoring engine → Game domain types: uses domain types
shared/engine.ts