# baronefernando/logic-public-repo architecture

> Architecture diagram of the GitHub repository baronefernando/logic-public-repo, 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/baronefernando/logic-public-repo
- Repository: https://github.com/baronefernando/logic-public-repo

## Overview

Logic 0101 is a Unity logic-game with multiplayer room and player services exposed through a PHP/MySQL API. The likely player journey spans menu, room selection, gameplay, and results; the repository tree names these Unity scenes and scripts, but their source was not excerpted, so Unity runtime links are not asserted. The PHP excerpts show endpoint-to-validation and endpoint-to-database relationships. Localization assets and client-side game capabilities are visible in the tree, while their wiring is not.

Main entry points: [`PHP API/connect.php`](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/connect.php) (DB connection), [`Game/Assets/Scenes/Game.unity`](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scenes/Game.unity) (Gameplay), [`PHP API/validations.php`](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/validations.php) (Validation rules), [`PHP API/add_room.php`](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/add_room.php) (Create room)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_unity["Unity game"]
  node_menu["Main menu<br/>[MainMenu.unity]"]
  node_roomflow["Room scenes"]
  node_gameplay["Gameplay<br/>[Game.unity]"]
  node_results["Game results<br/>[GameOver.unity]"]
  node_game_manager["Game manager<br/>[Game_Manager.cs]"]
  node_logic_game["Logic game<br/>[Logic_Game.cs]"]
  node_gate_controls["Gate controls<br/>[Gate_Drag.cs]"]
  node_gate_slots["Gate slots<br/>[Gate_Slot.cs]"]
  node_toolbox["Gate toolbox<br/>[Toolbox_Slot.cs]"]
  node_score["Score tracking<br/>[Score_Manager.cs]"]
  node_scene_manager["Scene navigation<br/>[Scene_Manager.cs]"]
  node_localisation["Localization<br/>[Localiser.cs]"]
  node_locales["Locale assets"]
end

subgraph group_rooms["Room services"]
  node_room_create["Create room<br/>[add_room.php]"]
  node_room_update["Room settings"]
  node_room_get["Room settings query"]
  node_lobby_get["Lobby members<br/>[get_lobby.php]"]
end

subgraph group_players["Player services"]
  node_user_create["Create player<br/>[add_user.php]"]
  node_user_update["Player updates"]
  node_username_get["Username lookup"]
end

subgraph group_backend["API infrastructure"]
  node_validation["Validation rules<br/>[validations.php]"]
  node_connection["DB connection<br/>[connect.php]"]
  node_database[("MySQL database")]
end

node_player(("Player"))
node_client(("Game client"))

node_player -.->|"starts at"| node_menu
node_menu -.->|"chooses room"| node_roomflow
node_roomflow -.->|"starts game"| node_gameplay
node_gameplay -.->|"finishes at"| node_results
node_gameplay -.->|"uses"| node_logic_game
node_gameplay -.->|"uses"| node_game_manager
node_gameplay -.->|"uses"| node_gate_controls
node_gate_controls -.->|"uses"| node_gate_slots
node_gameplay -.->|"uses"| node_toolbox
node_game_manager -.->|"updates"| node_score
node_scene_manager -.->|"navigates"| node_menu
node_localisation -.->|"loads"| node_locales
node_client -.->|"requests"| node_room_create
node_client -.->|"requests"| node_room_update
node_client -.->|"requests"| node_room_get
node_client -.->|"requests"| node_lobby_get
node_client -.->|"requests"| node_user_create
node_client -.->|"requests"| node_user_update
node_client -.->|"requests"| node_username_get
node_room_create -->|"opens connection"| node_connection
node_room_create -->|"checks rooms"| node_validation
node_room_update -->|"opens connection"| node_connection
node_room_update -->|"checks room and user"| node_validation
node_room_get -->|"opens connection"| node_connection
node_room_get -->|"checks room"| node_validation
node_lobby_get -->|"opens connection"| node_connection
node_lobby_get -->|"checks room"| node_validation
node_user_create -->|"opens connection"| node_connection
node_user_create -->|"checks player"| node_validation
node_user_update -->|"opens connection"| node_connection
node_user_update -->|"checks player and room"| node_validation
node_username_get -->|"opens connection"| node_connection
node_username_get -->|"checks player"| node_validation
node_connection -->|"connects"| node_database
node_room_create -->|"writes room"| node_database
node_room_update -->|"updates room"| node_database
node_room_get -->|"reads room"| node_database
node_lobby_get -->|"reads members"| node_database
node_user_create -->|"writes player"| node_database
node_user_update -->|"updates player"| node_database
node_username_get -->|"reads username"| node_database

click node_menu "https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scenes/MainMenu.unity"
click node_roomflow "https://github.com/baronefernando/logic-public-repo/tree/main/Game/Assets/Scenes"
click node_gameplay "https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scenes/Game.unity"
click node_results "https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scenes/GameOver.unity"
click node_game_manager "https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Game_Manager.cs"
click node_logic_game "https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Logic_Game.cs"
click node_gate_controls "https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Gate_Drag.cs"
click node_gate_slots "https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Gate_Slot.cs"
click node_toolbox "https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Toolbox_Slot.cs"
click node_score "https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Score_Manager.cs"
click node_scene_manager "https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Scene_Manager.cs"
click node_localisation "https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Localiser.cs"
click node_locales "https://github.com/baronefernando/logic-public-repo/tree/main/Game/Assets/Localisation"
click node_room_create "https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/add_room.php"
click node_room_update "https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/update_room_settings.php"
click node_room_get "https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/get_room_settings.php"
click node_lobby_get "https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/get_lobby.php"
click node_user_create "https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/add_user.php"
click node_user_update "https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/update_user_details.php"
click node_username_get "https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/get_user_username_by_id.php"
click node_validation "https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/validations.php"
click node_connection "https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/connect.php"

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_menu,node_roomflow,node_gameplay,node_results,node_game_manager,node_logic_game,node_gate_controls,node_gate_slots,node_toolbox,node_score,node_scene_manager,node_localisation,node_locales,node_client toneBlue
class node_room_create,node_room_update,node_room_get,node_lobby_get toneAmber
class node_user_create,node_user_update,node_username_get toneMint
class node_validation,node_connection,node_database toneRose
class node_player toneIndigo
```

## Components

### Unity game

- [Main menu](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scenes/MainMenu.unity): `Game/Assets/Scenes/MainMenu.unity`
- [Room scenes](https://github.com/baronefernando/logic-public-repo/tree/main/Game/Assets/Scenes): `Game/Assets/Scenes`
- [Gameplay](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scenes/Game.unity): `Game/Assets/Scenes/Game.unity`
- [Game results](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scenes/GameOver.unity): `Game/Assets/Scenes/GameOver.unity`
- [Game manager](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Game_Manager.cs): `Game/Assets/Scripts/Game_Manager.cs`
- [Logic game](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Logic_Game.cs): `Game/Assets/Scripts/Logic_Game.cs`
- [Gate controls](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Gate_Drag.cs): `Game/Assets/Scripts/Gate_Drag.cs`
- [Gate slots](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Gate_Slot.cs): `Game/Assets/Scripts/Gate_Slot.cs`
- [Gate toolbox](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Toolbox_Slot.cs): `Game/Assets/Scripts/Toolbox_Slot.cs`
- [Score tracking](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Score_Manager.cs): `Game/Assets/Scripts/Score_Manager.cs`
- [Scene navigation](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Scene_Manager.cs): `Game/Assets/Scripts/Scene_Manager.cs`
- [Localization](https://github.com/baronefernando/logic-public-repo/blob/main/Game/Assets/Scripts/Localiser.cs): `Game/Assets/Scripts/Localiser.cs`
- [Locale assets](https://github.com/baronefernando/logic-public-repo/tree/main/Game/Assets/Localisation): `Game/Assets/Localisation`

### Room services

- [Create room](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/add_room.php): `PHP API/add_room.php`
- [Room settings](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/update_room_settings.php): `PHP API/update_room_settings.php`
- [Room settings query](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/get_room_settings.php): `PHP API/get_room_settings.php`
- [Lobby members](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/get_lobby.php): `PHP API/get_lobby.php`

### Player services

- [Create player](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/add_user.php): `PHP API/add_user.php`
- [Player updates](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/update_user_details.php): `PHP API/update_user_details.php`
- [Username lookup](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/get_user_username_by_id.php): `PHP API/get_user_username_by_id.php`

### API infrastructure

- [Validation rules](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/validations.php): `PHP API/validations.php`
- [DB connection](https://github.com/baronefernando/logic-public-repo/blob/main/PHP%20API/connect.php): `PHP API/connect.php`
- **MySQL database**

### Other components

- **Player**
- **Game client**

## Connections

- Player → Main menu: starts at
- Main menu → Room scenes: chooses room
- Room scenes → Gameplay: starts game
- Gameplay → Game results: finishes at
- Gameplay → Logic game: uses
- Gameplay → Game manager: uses
- Gameplay → Gate controls: uses
- Gate controls → Gate slots: uses
- Gameplay → Gate toolbox: uses
- Game manager → Score tracking: updates
- Scene navigation → Main menu: navigates
- Localization → Locale assets: loads
- Game client → Create room: requests
- Game client → Room settings: requests
- Game client → Room settings query: requests
- Game client → Lobby members: requests
- Game client → Create player: requests
- Game client → Player updates: requests
- Game client → Username lookup: requests
- Create room → DB connection: opens connection (evidence: `PHP API/add_room.php`)
- Create room → Validation rules: checks rooms (evidence: `PHP API/add_room.php`)
- Room settings → DB connection: opens connection (evidence: `PHP API/update_room_settings.php`)
- Room settings → Validation rules: checks room and user (evidence: `PHP API/update_room_settings.php`)
- Room settings query → DB connection: opens connection (evidence: `PHP API/get_room_settings.php`)
- Room settings query → Validation rules: checks room (evidence: `PHP API/get_room_settings.php`)
- Lobby members → DB connection: opens connection (evidence: `PHP API/get_lobby.php`)
- Lobby members → Validation rules: checks room (evidence: `PHP API/get_lobby.php`)
- Create player → DB connection: opens connection (evidence: `PHP API/add_user.php`)
- Create player → Validation rules: checks player (evidence: `PHP API/add_user.php`)
- Player updates → DB connection: opens connection (evidence: `PHP API/update_user_details.php`)
- Player updates → Validation rules: checks player and room (evidence: `PHP API/update_user_details.php`)
- Username lookup → DB connection: opens connection (evidence: `PHP API/get_user_username_by_id.php`)
- Username lookup → Validation rules: checks player (evidence: `PHP API/get_user_username_by_id.php`)
- DB connection → MySQL database: connects (evidence: `PHP API/connect.php`)
- Create room → MySQL database: writes room (evidence: `PHP API/add_room.php`)
- Room settings → MySQL database: updates room (evidence: `PHP API/update_room_settings.php`)
- Room settings query → MySQL database: reads room (evidence: `PHP API/get_room_settings.php`)
- Lobby members → MySQL database: reads members (evidence: `PHP API/get_lobby.php`)
- Create player → MySQL database: writes player (evidence: `PHP API/add_user.php`)
- Player updates → MySQL database: updates player (evidence: `PHP API/update_user_details.php`)
- Username lookup → MySQL database: reads username (evidence: `PHP API/get_user_username_by_id.php`)
