# vrares25/thegame architecture

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

- Interactive diagram: https://gitdiagram.com/vrares25/thegame
- Repository: https://github.com/vrares25/thegame

## Overview

The product is a cooperative online card game: players authenticate, enter the client’s menu and game-selection/lobby flow, then play by moving cards while the server manages sessions and game state. The SFML client also provides tutorials, settings, and voice-chat support. The README documents shared rule validation and server persistence; source excerpts confirm client routing, authentication requests, and hand-card rendering. Several gameplay, lobby, server, and optional voice-chat interactions are not visible in excerpts, so those links are shown as unverified where useful.

Main entry points: [`GameClient/GameClient.cpp`](https://github.com/vrares25/thegame/blob/main/GameClient/GameClient.cpp) (Client app), [`GameServer/GameServer.cpp`](https://github.com/vrares25/thegame/blob/main/GameServer/GameServer.cpp) (Game server), [`GameClient/GameTable.cpp`](https://github.com/vrares25/thegame/blob/main/GameClient/GameTable.cpp) (Game table), [`src/Game.cpp`](https://github.com/vrares25/thegame/blob/main/src/Game.cpp) (Game model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Game client"]
  node_client_app["Client app<br/>[GameClient.cpp]"]
  node_auth["Authentication<br/>[Auth.cpp]"]
  node_main_menu["Main menu<br/>[MainMenu.cpp]"]
  node_game_select["Game selection<br/>[GameSelect.cpp]"]
  node_lobby["Game lobby<br/>[GameLobby.cpp]"]
  node_settings["Settings screen<br/>[SettingsScreen.cpp]"]
  node_tutorial["Tutorial screen<br/>[TutorialScreen.cpp]"]
end

subgraph group_gameplay["Gameplay and rules"]
  node_game_table["Game table<br/>[GameTable.cpp]"]
  node_hand_manager["Hand manager<br/>[HandManager.cpp]"]
  node_card_drawing["Card drawing"]
  node_voice_chat["Voice chat<br/>[VoiceChat.hpp]"]
  node_game_rules["Rule validation"]
  node_game_model["Game model<br/>[Game.cpp]"]
  node_deck["Deck and cards<br/>[Deck.cpp]"]
  node_piles["Piles and table<br/>[Pile.cpp]"]
  node_players["Player state<br/>[Player.cpp]"]
end

subgraph group_server["Server services"]
  node_game_server["Game server<br/>[GameServer.cpp]"]
  node_persistence[("Persistent data")]
  node_auth_service["Authentication service"]
end

subgraph group_shared["Shared utilities"]
  node_network_utils["Network utilities<br/>[NetworkUtils.cpp]"]
end

node_player(("Player"))

node_player -->|"uses"| node_client_app
node_client_app -->|"routes input"| node_auth
node_client_app -->|"routes input"| node_main_menu
node_client_app -->|"routes input"| node_game_select
node_client_app -->|"routes state"| node_lobby
node_client_app -->|"routes input"| node_settings
node_client_app -->|"routes input"| node_tutorial
node_client_app -->|"routes input"| node_game_table
node_auth -->|"posts credentials"| node_auth_service
node_game_select -.->|"requests game access"| node_game_server
node_lobby -.->|"exchanges session data"| node_game_server
node_game_table -.->|"requests moves and state"| node_game_server
node_game_table -->|"manages hand"| node_hand_manager
node_hand_manager -->|"draws cards"| node_card_drawing
node_game_table -.->|"uses voice chat"| node_voice_chat
node_game_server -.->|"validates moves"| node_game_rules
node_game_server -.->|"persists data"| node_persistence
node_game_model -.->|"uses deck"| node_deck
node_game_model -.->|"uses piles"| node_piles
node_game_model -.->|"tracks players"| node_players
node_client_app -->|"reads status"| node_network_utils
node_game_server -.->|"serves authentication"| node_auth_service

click node_client_app "https://github.com/vrares25/thegame/blob/main/GameClient/GameClient.cpp"
click node_auth "https://github.com/vrares25/thegame/blob/main/GameClient/Auth.cpp"
click node_main_menu "https://github.com/vrares25/thegame/blob/main/GameClient/MainMenu.cpp"
click node_game_select "https://github.com/vrares25/thegame/blob/main/GameClient/GameSelect.cpp"
click node_lobby "https://github.com/vrares25/thegame/blob/main/GameClient/GameLobby.cpp"
click node_settings "https://github.com/vrares25/thegame/blob/main/GameClient/SettingsScreen.cpp"
click node_tutorial "https://github.com/vrares25/thegame/blob/main/GameClient/TutorialScreen.cpp"
click node_game_table "https://github.com/vrares25/thegame/blob/main/GameClient/GameTable.cpp"
click node_hand_manager "https://github.com/vrares25/thegame/blob/main/GameClient/HandManager.cpp"
click node_card_drawing "https://github.com/vrares25/thegame/blob/main/GameClient/CardNumberDrawing.cpp"
click node_voice_chat "https://github.com/vrares25/thegame/blob/main/GameClient/VoiceChat.hpp"
click node_game_rules "https://github.com/vrares25/thegame/tree/main/GameCore"
click node_game_model "https://github.com/vrares25/thegame/blob/main/src/Game.cpp"
click node_deck "https://github.com/vrares25/thegame/blob/main/src/Deck.cpp"
click node_piles "https://github.com/vrares25/thegame/blob/main/src/Pile.cpp"
click node_players "https://github.com/vrares25/thegame/blob/main/src/Player.cpp"
click node_game_server "https://github.com/vrares25/thegame/blob/main/GameServer/GameServer.cpp"
click node_network_utils "https://github.com/vrares25/thegame/blob/main/GameCore/NetworkUtils.cpp"

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_client_app,node_auth,node_main_menu,node_game_select,node_lobby,node_settings,node_tutorial toneBlue
class node_game_table,node_hand_manager,node_card_drawing,node_voice_chat,node_game_rules,node_game_model,node_deck,node_piles,node_players toneAmber
class node_game_server,node_persistence,node_auth_service toneMint
class node_network_utils toneRose
class node_player toneIndigo
```

## Components

### Game client

- [Client app](https://github.com/vrares25/thegame/blob/main/GameClient/GameClient.cpp): `GameClient/GameClient.cpp`
- [Authentication](https://github.com/vrares25/thegame/blob/main/GameClient/Auth.cpp): `GameClient/Auth.cpp`
- [Main menu](https://github.com/vrares25/thegame/blob/main/GameClient/MainMenu.cpp): `GameClient/MainMenu.cpp`
- [Game selection](https://github.com/vrares25/thegame/blob/main/GameClient/GameSelect.cpp): `GameClient/GameSelect.cpp`
- [Game lobby](https://github.com/vrares25/thegame/blob/main/GameClient/GameLobby.cpp): `GameClient/GameLobby.cpp`
- [Settings screen](https://github.com/vrares25/thegame/blob/main/GameClient/SettingsScreen.cpp): `GameClient/SettingsScreen.cpp`
- [Tutorial screen](https://github.com/vrares25/thegame/blob/main/GameClient/TutorialScreen.cpp): `GameClient/TutorialScreen.cpp`

### Gameplay and rules

- [Game table](https://github.com/vrares25/thegame/blob/main/GameClient/GameTable.cpp): `GameClient/GameTable.cpp`
- [Hand manager](https://github.com/vrares25/thegame/blob/main/GameClient/HandManager.cpp): `GameClient/HandManager.cpp`
- [Card drawing](https://github.com/vrares25/thegame/blob/main/GameClient/CardNumberDrawing.cpp): `GameClient/CardNumberDrawing.cpp`
- [Voice chat](https://github.com/vrares25/thegame/blob/main/GameClient/VoiceChat.hpp): `GameClient/VoiceChat.hpp`
- [Rule validation](https://github.com/vrares25/thegame/tree/main/GameCore): `GameCore`
- [Game model](https://github.com/vrares25/thegame/blob/main/src/Game.cpp): `src/Game.cpp`
- [Deck and cards](https://github.com/vrares25/thegame/blob/main/src/Deck.cpp): `src/Deck.cpp`
- [Piles and table](https://github.com/vrares25/thegame/blob/main/src/Pile.cpp): `src/Pile.cpp`
- [Player state](https://github.com/vrares25/thegame/blob/main/src/Player.cpp): `src/Player.cpp`

### Server services

- [Game server](https://github.com/vrares25/thegame/blob/main/GameServer/GameServer.cpp): `GameServer/GameServer.cpp`
- **Persistent data**
- **Authentication service**

### Shared utilities

- [Network utilities](https://github.com/vrares25/thegame/blob/main/GameCore/NetworkUtils.cpp): `GameCore/NetworkUtils.cpp`

### Other components

- **Player**

## Connections

- Player → Client app: uses (evidence: `GameClient/GameClient.cpp`)
- Client app → Authentication: routes input (evidence: `GameClient/GameClient.cpp`)
- Client app → Main menu: routes input (evidence: `GameClient/GameClient.cpp`)
- Client app → Game selection: routes input (evidence: `GameClient/GameClient.cpp`)
- Client app → Game lobby: routes state (evidence: `GameClient/GameClient.cpp`)
- Client app → Settings screen: routes input (evidence: `GameClient/GameClient.cpp`)
- Client app → Tutorial screen: routes input (evidence: `GameClient/GameClient.cpp`)
- Client app → Game table: routes input (evidence: `GameClient/GameClient.cpp`)
- Authentication → Authentication service: posts credentials (evidence: `GameClient/Auth.cpp`)
- Game selection → Game server: requests game access
- Game lobby → Game server: exchanges session data
- Game table → Game server: requests moves and state
- Game table → Hand manager: manages hand
- Hand manager → Card drawing: draws cards
- Game table → Voice chat: uses voice chat
- Game server → Rule validation: validates moves (evidence: `README.md`)
- Game server → Persistent data: persists data (evidence: `README.md`)
- Game model → Deck and cards: uses deck
- Game model → Piles and table: uses piles
- Game model → Player state: tracks players
- Client app → Network utilities: reads status (evidence: `GameClient/GameClient.cpp`)
- Game server → Authentication service: serves authentication (evidence: `README.md`)
