How atcasanova/jogo works
Board Game Online is a four-player, two-team browser game, with a separate Python reinforcement-learning system and a Node.js game wrapper for training and bot inference. The main player flow is lobby and team setup, turn-based card and piece actions, then replay access after a finished game. The graph also shows the game rules engine and the AI training/inference branch. Source excerpts are partial, so uncertain internal wiring—especially replay persistence—is not drawn.
Main entry points: server.js HTTP and sockets · bot_service.py Bot service · trainer.py Training manager · index.js Lobby UI
Components 20
Game service
- HTTP and sockets
server/server.js - Room lifecycle
server/server.js - Game rules
server/game.js - Board utilities
server/utils.js - Bot manager
server/bot_manager.js
AI system
- Bot service
game-ai-training/bot_service.py - Training environment
game-ai-training/ai/environment.py - AI agents
game-ai-training/ai/bot.py - Training manager
game-ai-training/ai/trainer.py - Training entry
game-ai-training/main.py - Game wrapper
game-ai-training/game/game_wrapper.js - Training game
game-ai-training/game/game.js
Replay access
- Replay routes
server/server.js - Replay utilities
server/replay_utils.js - Replay files
Other components
- Players
- Web browser
Connections 24
- Players → Lobby UI: enters lobby
- Lobby UI → HTTP and sockets: socket events
- HTTP and sockets → Lobby UI: room updates
- HTTP and sockets → Room lifecycle: handles rooms
- Room lifecycle → Game rules: creates and updates
- Game rules → Board utilities: uses board rules
- HTTP and sockets → Bot manager: starts bot play
- Bot manager → Bot service: JSON commands
- Bot service → Training environment: builds state
- Bot service → AI agents: requests actions
- Training environment → Game wrapper: starts game process
- Game wrapper → Training game: uses game rules
- Training entry → Training manager: starts training
- Training manager → Training environment: runs episodes
- Training manager → AI agents: trains models
- Web browser → HTTP and sockets: HTTP and sockets
- HTTP and sockets → Replay routes: serves replay routes
- Replay routes → Replay utilities: resolves replay paths
- Replay routes → Replay files: lists and serves
- Players → Game UI: plays game
- Game UI → HTTP and sockets: game actions
- HTTP and sockets → Game UI: game updates
- Players → Replay UI: opens replay
- Replay UI → HTTP and sockets: requests replay