How volkan35koc/from-village-to-city works
This is a real-time, multiplayer Catan-style game with online rooms and a bot-game option. Players enter through the menu, create or join a room (or request a bot game), then use the game view to interact with the board, take turns, trade, play development cards, and chat. The frontend exchanges game events and state over Socket.IO; the backend manages rooms and delegates game actions to game instances, whose domain model uses a board and player records. Help and building-cost references are also part of the client. Some feature wiring is unsampled, so uncertain links are omitted.
Main entry points: App.jsx Application shell · Game.jsx Game view · HexGrid.jsx Board renderer · GameContext.jsx Game state context
Components 22
Client experience
- Application shell
frontend/src/App.jsx - Main menu
frontend/src/components/MainMenu.jsx - Online lobby
frontend/src/components/Lobby.jsx - Bot setup
frontend/src/components/BotSetup.jsx - Help modal
frontend/src/components/HelpModal.jsx - Game view
frontend/src/components/Game.jsx - Board renderer
frontend/src/components/Board/HexGrid.jsx - Hex tile
frontend/src/components/Board/Hex.jsx - Intersection
frontend/src/components/Board/Intersection.jsx - Road edge
frontend/src/components/Board/Edge.jsx - Trade dialog
frontend/src/components/TradeModal.jsx - Development cards
frontend/src/components/DevCardDisplay.jsx - Game chat
frontend/src/components/Chat.jsx - Building costs
frontend/src/components/BuildingCosts.jsx
Realtime transport
- Socket provider
frontend/src/context/SocketContext.jsx - Game state context
frontend/src/context/GameContext.jsx - Socket.IO server
backend/server.js
Game runtime
- Room manager
backend/game/GameManager.js
Game domain
- Game rules and actions
backend/game/Game.js - Board model
backend/game/Board.js - Player model
backend/game/Player.js
Other components
- Player
Connections 23
- Player → Application shell: uses
- Application shell → Main menu: renders
frontend/src/App.jsx - Application shell → Online lobby: renders
frontend/src/App.jsx - Application shell → Bot setup: renders
frontend/src/App.jsx - Application shell → Help modal: renders
frontend/src/App.jsx - Application shell → Game view: renders
frontend/src/App.jsx - Application shell → Game state context: reads state
frontend/src/App.jsx - Game state context → Socket provider: uses socket
frontend/src/context/GameContext.jsx - Game view → Game state context: reads and acts
frontend/src/components/Game.jsx - Game view → Board renderer: renders
frontend/src/components/Game.jsx - Board renderer → Hex tile: renders
frontend/src/components/Board/HexGrid.jsx - Board renderer → Intersection: renders
frontend/src/components/Board/HexGrid.jsx - Board renderer → Road edge: renders
frontend/src/components/Board/HexGrid.jsx - Game view → Trade dialog: renders
frontend/src/components/Game.jsx - Game view → Development cards: renders
frontend/src/components/Game.jsx - Game view → Game chat: renders
frontend/src/components/Game.jsx - Game view → Building costs: renders
frontend/src/components/Game.jsx - Socket provider → Socket.IO server: connects to
- Game state context → Room manager: sends game events
- Socket.IO server → Room manager: registers connections
backend/server.js - Room manager → Game rules and actions: creates and dispatches
backend/game/GameManager.js - Game rules and actions → Board model: uses board
backend/game/Game.js - Game rules and actions → Player model: uses player records
backend/game/Game.js