# tucoerthal/xadrezes2_frontend architecture

> Architecture diagram of the GitHub repository tucoerthal/xadrezes2_frontend, 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/tucoerthal/xadrezes2_frontend
- Repository: https://github.com/tucoerthal/xadrezes2_frontend

## Overview

XadrezES2 Frontend is a Godot chess-game client. The documented user journey spans authentication, lobby and room entry, then live-game viewing and local board interaction. Its main runtime areas are screen routing, HTTP/WebSocket integration, and 3D game presentation. The README documents these capabilities and broad relationships, but no source excerpts were provided; edges therefore reflect only those documented relationships, not unverified calls between particular screens and clients.

Main entry points: [`Core/Router.gd`](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Core/Router.gd) (Screen router), [`Levels/Board.gd`](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Levels/Board.gd) (3D board), [`UI/Screens/GameUI.gd`](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/GameUI.gd) (Game screen), [`UI/Screens/HomeScreen.gd`](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/HomeScreen.gd) (Home screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Screens and navigation"]
  node_main["Application startup<br/>[Main.gd]"]
  node_router["Screen router<br/>[Router.gd]"]
  node_home["Home screen<br/>[HomeScreen.gd]"]
  node_login["Login screen<br/>[LoginScreen.gd]"]
  node_lobby["Lobby screen<br/>[LobbyScreen.gd]"]
  node_create["Create room"]
  node_waiting["Waiting room"]
  node_gameui["Game screen<br/>[GameUI.gd]"]
end

subgraph group_network["Backend integration"]
  node_rest["REST client<br/>[RestClient.gd]"]
  node_websocket["WebSocket client<br/>[WsClient.gd]"]
  node_api["Backend HTTP API"]
  node_wsserver["Backend WebSocket"]
end

subgraph group_game["Game presentation"]
  node_manager["Game manager<br/>[GameManager.gd]"]
  node_board["3D board<br/>[Board.gd]"]
  node_checkerboard["Board surface"]
  node_piece["Chess pieces<br/>[Piece.gd]"]
  node_camera["Camera controls<br/>[CameraControls.gd]"]
  node_notation["Chess notation<br/>[ChessNotation.gd]"]
end

subgraph group_config["Runtime configuration"]
  node_environment["Environment settings<br/>[Env.gd]"]
end

node_player(("Player"))

node_player -->|"starts journey"| node_home
node_router -->|"routes screens"| node_home
node_router -->|"routes screens"| node_login
node_router -->|"routes screens"| node_lobby
node_router -->|"routes screens"| node_create
node_router -->|"routes screens"| node_waiting
node_router -->|"routes screens"| node_gameui
node_rest -->|"sends HTTP requests"| node_api
node_websocket -->|"receives game updates"| node_wsserver
node_api -->|"provides FEN positions"| node_board
node_gameui -->|"presents gameplay"| node_board
node_camera -->|"controls viewpoint"| node_board
node_board -->|"represents pieces"| node_piece

click node_main "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Core/Main.gd"
click node_router "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Core/Router.gd"
click node_home "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/HomeScreen.gd"
click node_login "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/LoginScreen.gd"
click node_lobby "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/LobbyScreen.gd"
click node_create "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/CreateRoomScreen.gd"
click node_waiting "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/WaitingRoomScreen.gd"
click node_gameui "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/GameUI.gd"
click node_rest "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Network/RestClient.gd"
click node_websocket "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Network/WsClient.gd"
click node_manager "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Levels/GameManager.gd"
click node_board "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Levels/Board.gd"
click node_checkerboard "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Levels/Checkerboard.gdshader"
click node_piece "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Entities/Pieces/Piece.gd"
click node_camera "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Entities/Camera/CameraControls.gd"
click node_notation "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Utils/ChessNotation.gd"
click node_environment "https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Env.gd"

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_main,node_router,node_home,node_login,node_lobby,node_create,node_waiting,node_gameui toneBlue
class node_rest,node_websocket,node_api,node_wsserver toneAmber
class node_manager,node_board,node_checkerboard,node_piece,node_camera,node_notation toneMint
class node_environment toneRose
class node_player toneIndigo
```

## Components

### Screens and navigation

- [Application startup](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Core/Main.gd): `Core/Main.gd`
- [Screen router](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Core/Router.gd): `Core/Router.gd`
- [Home screen](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/HomeScreen.gd): `UI/Screens/HomeScreen.gd`
- [Login screen](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/LoginScreen.gd): `UI/Screens/LoginScreen.gd`
- [Lobby screen](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/LobbyScreen.gd): `UI/Screens/LobbyScreen.gd`
- [Create room](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/CreateRoomScreen.gd): `UI/Screens/CreateRoomScreen.gd`
- [Waiting room](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/WaitingRoomScreen.gd): `UI/Screens/WaitingRoomScreen.gd`
- [Game screen](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/UI/Screens/GameUI.gd): `UI/Screens/GameUI.gd`

### Backend integration

- [REST client](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Network/RestClient.gd): `Network/RestClient.gd`
- [WebSocket client](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Network/WsClient.gd): `Network/WsClient.gd`
- **Backend HTTP API**
- **Backend WebSocket**

### Game presentation

- [Game manager](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Levels/GameManager.gd): `Levels/GameManager.gd`
- [3D board](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Levels/Board.gd): `Levels/Board.gd`
- [Board surface](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Levels/Checkerboard.gdshader): `Levels/Checkerboard.gdshader`
- [Chess pieces](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Entities/Pieces/Piece.gd): `Entities/Pieces/Piece.gd`
- [Camera controls](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Entities/Camera/CameraControls.gd): `Entities/Camera/CameraControls.gd`
- [Chess notation](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Utils/ChessNotation.gd): `Utils/ChessNotation.gd`

### Runtime configuration

- [Environment settings](https://github.com/tucoerthal/xadrezes2_frontend/blob/main/Env.gd): `Env.gd`

### Other components

- **Player**

## Connections

- Player → Home screen: starts journey (evidence: `README.md`)
- Screen router → Home screen: routes screens (evidence: `README.md`)
- Screen router → Login screen: routes screens (evidence: `README.md`)
- Screen router → Lobby screen: routes screens (evidence: `README.md`)
- Screen router → Create room: routes screens (evidence: `README.md`)
- Screen router → Waiting room: routes screens (evidence: `README.md`)
- Screen router → Game screen: routes screens (evidence: `README.md`)
- REST client → Backend HTTP API: sends HTTP requests (evidence: `README.md`)
- WebSocket client → Backend WebSocket: receives game updates (evidence: `README.md`)
- Backend HTTP API → 3D board: provides FEN positions (evidence: `README.md`)
- Game screen → 3D board: presents gameplay (evidence: `README.md`)
- Camera controls → 3D board: controls viewpoint (evidence: `README.md`)
- 3D board → Chess pieces: represents pieces (evidence: `README.md`)
