# kminh-wow/game_hub architecture

> Architecture diagram of the GitHub repository kminh-wow/game_hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kminh-wow/game_hub
- Repository: https://github.com/kminh-wow/game_hub

## Overview

Game Hub is a browser-based collection of nine single- and multiplayer games. Players visit the hub, choose a game, and play in a browser; multiplayer games use shared lobby, room, and WebSocket infrastructure, while Quoridor has its own server flow. Game-specific rules and state are implemented separately from their interfaces. The README documents capabilities such as multiplayer spectating, AI opponents, and Quoridor’s learning mode; several game internals were not sampled, so those subsystem details and links are represented only where evidence supports them.

Main entry points: [`quoridor/server/main.py`](https://github.com/kminh-wow/game_hub/blob/main/quoridor/server/main.py) (Quoridor Server), [`common/multiplayer/server.py`](https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/server.py) (Lobby Server), [`common/multiplayer/room.py`](https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/room.py) (Room Lifecycle), [`hub/main.py`](https://github.com/kminh-wow/game_hub/blob/main/hub/main.py) (Game Hub)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hub["Hub"]
  node_hub_site["Game Hub<br/>[main.py]"]
  node_lobby_ui["Lobby Interface<br/>[lobby.js]"]
end

subgraph group_shared["Multiplayer Core"]
  node_mp_app["WebSocket App<br/>[app.py]"]
  node_mp_server["Lobby Server<br/>[server.py]"]
  node_mp_room["Room Lifecycle<br/>[room.py]"]
  node_player_model["Player Model<br/>[models.py]"]
  node_game_log["Game Logging<br/>[log.py]"]
end

subgraph group_games["Game Services"]
  node_wordchain["Word Chain<br/>[game.py]"]
  node_word_dict[("Word Dictionary<br/>[dictionary.py]")]
  node_hangman["Hangman<br/>[game.py]"]
  node_hangman_words[("Word List<br/>[words.py]")]
  node_omok["Omok<br/>[game.py]"]
  node_omok_ai["Omok AI<br/>[ai.py]"]
  node_fortress["Fortress<br/>[game.py]"]
  node_shooter["Turn FPS<br/>[game.py]"]
  node_yacht["Yacht Dice<br/>[game.py]"]
  node_quoridor_server["Quoridor Server<br/>[main.py]"]
  node_quoridor_rules["Quoridor Rules<br/>[game.py]"]
  node_quoridor_ai["Quoridor AI<br/>[ai.py]"]
  node_quoridor_analysis["Move Analysis<br/>[analysis.py]"]
end

subgraph group_clients["Browser Clients"]
  node_pacman_ui["Pac-Man Client<br/>[game.js]"]
  node_runner_ui["Runner Client<br/>[game.js]"]
  node_quoridor_ui["Quoridor Board<br/>[board3d.js]"]
  node_wordchain_ui["Word Chain Client<br/>[app.js]"]
  node_hangman_ui["Hangman Client<br/>[app.js]"]
  node_omok_ui["Omok Client<br/>[app.js]"]
  node_fortress_ui["Fortress Client<br/>[app.js]"]
  node_shooter_ui["Turn FPS Client<br/>[app.js]"]
  node_yacht_ui["Yacht Client<br/>[app.js]"]
end

subgraph group_solo["Solo Games"]
  node_pacman["Pac-Man Logic<br/>[logic.js]"]
  node_runner["Runner Logic<br/>[logic.js]"]
end

node_player(("Player"))

node_player -->|"opens"| node_hub_site
node_hub_site -.->|"offers games"| node_lobby_ui
node_player -->|"chooses game"| node_lobby_ui
node_mp_app -->|"handles messages"| node_mp_server
node_mp_server -->|"creates and updates"| node_mp_room
node_mp_server -->|"tracks players"| node_player_model
node_mp_room -->|"broadcasts to"| node_player_model
node_mp_room -->|"records events"| node_game_log
node_wordchain -.->|"validates with"| node_word_dict
node_hangman -->|"uses word list"| node_hangman_words
node_omok -->|"uses opponent"| node_omok_ai
node_quoridor_server -->|"applies moves"| node_quoridor_rules
node_quoridor_server -->|"chooses AI moves"| node_quoridor_ai
node_quoridor_server -->|"analyzes moves"| node_quoridor_analysis
node_quoridor_ai -->|"evaluates state"| node_quoridor_rules
node_pacman_ui -->|"uses logic"| node_pacman
node_runner_ui -->|"uses logic"| node_runner
node_player -.->|"plays"| node_wordchain_ui
node_player -.->|"plays"| node_hangman_ui
node_player -.->|"plays"| node_omok_ui
node_player -.->|"plays"| node_fortress_ui
node_player -.->|"plays"| node_shooter_ui
node_player -.->|"plays"| node_yacht_ui
node_player -.->|"plays"| node_quoridor_ui
node_player -.->|"plays"| node_pacman_ui
node_player -.->|"plays"| node_runner_ui

click node_hub_site "https://github.com/kminh-wow/game_hub/blob/main/hub/main.py"
click node_lobby_ui "https://github.com/kminh-wow/game_hub/blob/main/common/web/lobby.js"
click node_mp_app "https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/app.py"
click node_mp_server "https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/server.py"
click node_mp_room "https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/room.py"
click node_player_model "https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/models.py"
click node_game_log "https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/log.py"
click node_wordchain "https://github.com/kminh-wow/game_hub/blob/main/wordchain/app/game.py"
click node_word_dict "https://github.com/kminh-wow/game_hub/blob/main/wordchain/app/dictionary.py"
click node_hangman "https://github.com/kminh-wow/game_hub/blob/main/hangman/app/game.py"
click node_hangman_words "https://github.com/kminh-wow/game_hub/blob/main/hangman/app/words.py"
click node_omok "https://github.com/kminh-wow/game_hub/blob/main/omok/app/game.py"
click node_omok_ai "https://github.com/kminh-wow/game_hub/blob/main/omok/app/ai.py"
click node_fortress "https://github.com/kminh-wow/game_hub/blob/main/fortress/app/game.py"
click node_shooter "https://github.com/kminh-wow/game_hub/blob/main/shooter/app/game.py"
click node_yacht "https://github.com/kminh-wow/game_hub/blob/main/yacht/app/game.py"
click node_quoridor_server "https://github.com/kminh-wow/game_hub/blob/main/quoridor/server/main.py"
click node_quoridor_rules "https://github.com/kminh-wow/game_hub/blob/main/quoridor/server/game.py"
click node_quoridor_ai "https://github.com/kminh-wow/game_hub/blob/main/quoridor/server/ai.py"
click node_quoridor_analysis "https://github.com/kminh-wow/game_hub/blob/main/quoridor/server/analysis.py"
click node_pacman "https://github.com/kminh-wow/game_hub/blob/main/pacman/web/logic.js"
click node_runner "https://github.com/kminh-wow/game_hub/blob/main/runner/web/logic.js"
click node_pacman_ui "https://github.com/kminh-wow/game_hub/blob/main/pacman/web/game.js"
click node_runner_ui "https://github.com/kminh-wow/game_hub/blob/main/runner/web/game.js"
click node_quoridor_ui "https://github.com/kminh-wow/game_hub/blob/main/quoridor/web/board3d.js"
click node_wordchain_ui "https://github.com/kminh-wow/game_hub/blob/main/wordchain/static/app.js"
click node_hangman_ui "https://github.com/kminh-wow/game_hub/blob/main/hangman/static/app.js"
click node_omok_ui "https://github.com/kminh-wow/game_hub/blob/main/omok/static/app.js"
click node_fortress_ui "https://github.com/kminh-wow/game_hub/blob/main/fortress/static/app.js"
click node_shooter_ui "https://github.com/kminh-wow/game_hub/blob/main/shooter/static/app.js"
click node_yacht_ui "https://github.com/kminh-wow/game_hub/blob/main/yacht/static/app.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_hub_site,node_lobby_ui toneBlue
class node_mp_app,node_mp_server,node_mp_room,node_player_model,node_game_log toneAmber
class node_wordchain,node_word_dict,node_hangman,node_hangman_words,node_omok,node_omok_ai,node_fortress,node_shooter,node_yacht,node_quoridor_server,node_quoridor_rules,node_quoridor_ai,node_quoridor_analysis toneMint
class node_pacman_ui,node_runner_ui,node_quoridor_ui,node_wordchain_ui,node_hangman_ui,node_omok_ui,node_fortress_ui,node_shooter_ui,node_yacht_ui toneRose
class node_pacman,node_runner,node_player toneIndigo
```

## Components

### Hub

- [Game Hub](https://github.com/kminh-wow/game_hub/blob/main/hub/main.py): `hub/main.py`
- [Lobby Interface](https://github.com/kminh-wow/game_hub/blob/main/common/web/lobby.js): `common/web/lobby.js`

### Multiplayer Core

- [WebSocket App](https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/app.py): `common/multiplayer/app.py`
- [Lobby Server](https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/server.py): `common/multiplayer/server.py`
- [Room Lifecycle](https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/room.py): `common/multiplayer/room.py`
- [Player Model](https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/models.py): `common/multiplayer/models.py`
- [Game Logging](https://github.com/kminh-wow/game_hub/blob/main/common/multiplayer/log.py): `common/multiplayer/log.py`

### Game Services

- [Word Chain](https://github.com/kminh-wow/game_hub/blob/main/wordchain/app/game.py): `wordchain/app/game.py`
- [Word Dictionary](https://github.com/kminh-wow/game_hub/blob/main/wordchain/app/dictionary.py): `wordchain/app/dictionary.py`
- [Hangman](https://github.com/kminh-wow/game_hub/blob/main/hangman/app/game.py): `hangman/app/game.py`
- [Word List](https://github.com/kminh-wow/game_hub/blob/main/hangman/app/words.py): `hangman/app/words.py`
- [Omok](https://github.com/kminh-wow/game_hub/blob/main/omok/app/game.py): `omok/app/game.py`
- [Omok AI](https://github.com/kminh-wow/game_hub/blob/main/omok/app/ai.py): `omok/app/ai.py`
- [Fortress](https://github.com/kminh-wow/game_hub/blob/main/fortress/app/game.py): `fortress/app/game.py`
- [Turn FPS](https://github.com/kminh-wow/game_hub/blob/main/shooter/app/game.py): `shooter/app/game.py`
- [Yacht Dice](https://github.com/kminh-wow/game_hub/blob/main/yacht/app/game.py): `yacht/app/game.py`
- [Quoridor Server](https://github.com/kminh-wow/game_hub/blob/main/quoridor/server/main.py): `quoridor/server/main.py`
- [Quoridor Rules](https://github.com/kminh-wow/game_hub/blob/main/quoridor/server/game.py): `quoridor/server/game.py`
- [Quoridor AI](https://github.com/kminh-wow/game_hub/blob/main/quoridor/server/ai.py): `quoridor/server/ai.py`
- [Move Analysis](https://github.com/kminh-wow/game_hub/blob/main/quoridor/server/analysis.py): `quoridor/server/analysis.py`

### Browser Clients

- [Pac-Man Client](https://github.com/kminh-wow/game_hub/blob/main/pacman/web/game.js): `pacman/web/game.js`
- [Runner Client](https://github.com/kminh-wow/game_hub/blob/main/runner/web/game.js): `runner/web/game.js`
- [Quoridor Board](https://github.com/kminh-wow/game_hub/blob/main/quoridor/web/board3d.js): `quoridor/web/board3d.js`
- [Word Chain Client](https://github.com/kminh-wow/game_hub/blob/main/wordchain/static/app.js): `wordchain/static/app.js`
- [Hangman Client](https://github.com/kminh-wow/game_hub/blob/main/hangman/static/app.js): `hangman/static/app.js`
- [Omok Client](https://github.com/kminh-wow/game_hub/blob/main/omok/static/app.js): `omok/static/app.js`
- [Fortress Client](https://github.com/kminh-wow/game_hub/blob/main/fortress/static/app.js): `fortress/static/app.js`
- [Turn FPS Client](https://github.com/kminh-wow/game_hub/blob/main/shooter/static/app.js): `shooter/static/app.js`
- [Yacht Client](https://github.com/kminh-wow/game_hub/blob/main/yacht/static/app.js): `yacht/static/app.js`

### Solo Games

- [Pac-Man Logic](https://github.com/kminh-wow/game_hub/blob/main/pacman/web/logic.js): `pacman/web/logic.js`
- [Runner Logic](https://github.com/kminh-wow/game_hub/blob/main/runner/web/logic.js): `runner/web/logic.js`

### Other components

- **Player**

## Connections

- Player → Game Hub: opens
- Game Hub → Lobby Interface: offers games
- Player → Lobby Interface: chooses game
- WebSocket App → Lobby Server: handles messages (evidence: `common/multiplayer/app.py`)
- Lobby Server → Room Lifecycle: creates and updates (evidence: `common/multiplayer/server.py`)
- Lobby Server → Player Model: tracks players (evidence: `common/multiplayer/server.py`)
- Room Lifecycle → Player Model: broadcasts to (evidence: `common/multiplayer/room.py`)
- Room Lifecycle → Game Logging: records events (evidence: `common/multiplayer/room.py`)
- Word Chain → Word Dictionary: validates with
- Hangman → Word List: uses word list (evidence: `hangman/app/room.py`)
- Omok → Omok AI: uses opponent (evidence: `omok/app/room.py`)
- Quoridor Server → Quoridor Rules: applies moves (evidence: `quoridor/server/main.py`)
- Quoridor Server → Quoridor AI: chooses AI moves (evidence: `quoridor/server/main.py`)
- Quoridor Server → Move Analysis: analyzes moves (evidence: `quoridor/server/main.py`)
- Quoridor AI → Quoridor Rules: evaluates state (evidence: `quoridor/server/ai.py`)
- Pac-Man Client → Pac-Man Logic: uses logic (evidence: `pacman/web/game.js`)
- Runner Client → Runner Logic: uses logic (evidence: `runner/web/game.js`)
- Player → Word Chain Client: plays
- Player → Hangman Client: plays
- Player → Omok Client: plays
- Player → Fortress Client: plays
- Player → Turn FPS Client: plays
- Player → Yacht Client: plays
- Player → Quoridor Board: plays
- Player → Pac-Man Client: plays
- Player → Runner Client: plays
