# iee-ihu-gr-course1941/adise26_atkon architecture

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

- Interactive diagram: https://gitdiagram.com/iee-ihu-gr-course1941/adise26_atkon
- Repository: https://github.com/iee-ihu-gr-course1941/adise26_atkon

## Overview

This repository appears to implement a browser-based Quoridor game with account, lobby, gameplay, and user-profile features. The visible login/register flow submits credentials to PHP endpoints and redirects successful users to the lobby; authenticated pages check the current session. The README is a placeholder, and several game, lobby, and business files are empty or only listed in the index, so their internal interactions are not established here. Dashed, uncited edges mark likely UI-to-endpoint interactions, not inspected call paths.

Main entry points: [`js/lobbies.js`](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/lobbies.js) (Lobby client), [`api/db.php`](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/db.php) (Database connection), [`js/board.js`](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/board.js) (Board client), [`js/index.js`](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/index.js) (Login and register UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser application"]
  node_login_ui["Login and register UI<br/>[index.js]"]
  node_lobby_page["Lobby page<br/>[lobbies.html]"]
  node_lobby_ui["Lobby client<br/>[lobbies.js]"]
  node_board_page["Game board page<br/>[board.html]"]
  node_board_ui["Board client<br/>[board.js]"]
  node_profile_page["User page<br/>[user.html]"]
  node_profile_ui["User client<br/>[user.js]"]
  node_auth_guard["Session guard<br/>[authGuard.js]"]
end

subgraph group_accounts["Accounts and profiles"]
  node_login["Login endpoint<br/>[login.php]"]
  node_register["Registration endpoint<br/>[register.php]"]
  node_session_user["Current-user endpoint<br/>[me.php]"]
  node_logout["Logout endpoint<br/>[logout.php]"]
  node_settings["Settings endpoint<br/>[saveSettings.php]"]
  node_user_list["User listing<br/>[users.php]"]
end

subgraph group_lobby["Lobby management"]
  node_create_lobby["Create game<br/>[createGame.php]"]
  node_delete_lobby["Delete game<br/>[deleteGame.php]"]
  node_start_game["Start game<br/>[startGame.php]"]
end

subgraph group_gameplay["Quoridor gameplay"]
  node_move["Move endpoint<br/>[move.php]"]
  node_place_wall["Place wall endpoint<br/>[placeWall.php]"]
  node_kick["Kick initiation<br/>[initiateKick.php]"]
  node_vote_kick["Kick voting<br/>[voteKick.php]"]
  node_legal_walls["Legal wall rules"]
  node_pathfinding["Pathfinding<br/>[BFS.php]"]
  node_colour["Player colours<br/>[assignColour.php]"]
end

subgraph group_backend["Backend infrastructure"]
  node_database_api["Database connection<br/>[db.php]"]
  node_environment["Environment loader<br/>[loadEnv.php]"]
  node_session_auth["Session authorization<br/>[auth.php]"]
  node_database[("Application database<br/>[quoridor.sql]")]
end

node_visitor(("Player"))

node_visitor -->|"uses"| node_login_ui
node_login_ui -->|"checks session"| node_session_user
node_login_ui -->|"submits login"| node_login
node_login_ui -->|"submits registration"| node_register
node_auth_guard -->|"checks session"| node_session_user
node_lobby_ui -->|"calls"| node_auth_guard
node_lobby_ui -->|"requests logout"| node_logout
node_login -->|"queries users"| node_database_api
node_register -->|"creates user"| node_database_api
node_session_user -->|"requires session"| node_session_auth
node_session_user -->|"queries user"| node_database_api
node_user_list -->|"queries users"| node_database_api
node_database_api -->|"loads configuration"| node_environment
node_visitor -.->|"enters lobby"| node_lobby_page
node_lobby_page -.->|"runs client"| node_lobby_ui
node_lobby_ui -.->|"creates game"| node_create_lobby
node_lobby_ui -.->|"deletes game"| node_delete_lobby
node_lobby_ui -.->|"starts game"| node_start_game
node_visitor -.->|"plays game"| node_board_page
node_board_page -.->|"runs client"| node_board_ui
node_board_ui -.->|"submits move"| node_move
node_board_ui -.->|"places wall"| node_place_wall
node_board_ui -.->|"initiates kick"| node_kick
node_board_ui -.->|"votes kick"| node_vote_kick
node_visitor -.->|"views profile"| node_profile_page
node_profile_page -.->|"runs client"| node_profile_ui
node_profile_ui -.->|"saves settings"| node_settings
node_profile_ui -.->|"loads users"| node_user_list
node_database_api -.->|"connects"| node_database
node_move -.->|"checks legality"| node_legal_walls
node_move -.->|"checks paths"| node_pathfinding
node_start_game -.->|"assigns colours"| node_colour

click node_login_ui "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/index.js"
click node_lobby_page "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/html/lobbies.html"
click node_lobby_ui "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/lobbies.js"
click node_board_page "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/html/board.html"
click node_board_ui "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/board.js"
click node_profile_page "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/html/user.html"
click node_profile_ui "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/user.js"
click node_auth_guard "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/authGuard.js"
click node_login "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/user/login.php"
click node_register "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/user/register.php"
click node_session_user "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/user/me.php"
click node_logout "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/user/logout.php"
click node_settings "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/user/saveSettings.php"
click node_user_list "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/users.php"
click node_create_lobby "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/lobby/createGame.php"
click node_delete_lobby "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/lobby/deleteGame.php"
click node_start_game "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/lobby/startGame.php"
click node_move "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/game/move.php"
click node_place_wall "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/game/placeWall.php"
click node_kick "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/game/initiateKick.php"
click node_vote_kick "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/game/voteKick.php"
click node_legal_walls "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/business/updateLegalWalls.php"
click node_pathfinding "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/business/BFS.php"
click node_colour "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/business/assignColour.php"
click node_database_api "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/db.php"
click node_environment "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/loadEnv.php"
click node_session_auth "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/auth.php"
click node_database "https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/quoridor.sql"

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_login_ui,node_lobby_page,node_lobby_ui,node_board_page,node_board_ui,node_profile_page,node_profile_ui,node_auth_guard toneBlue
class node_login,node_register,node_session_user,node_logout,node_settings,node_user_list toneAmber
class node_create_lobby,node_delete_lobby,node_start_game toneMint
class node_move,node_place_wall,node_kick,node_vote_kick,node_legal_walls,node_pathfinding,node_colour toneRose
class node_database_api,node_environment,node_session_auth,node_database,node_visitor toneIndigo
```

## Components

### Browser application

- [Login and register UI](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/index.js): `js/index.js`
- [Lobby page](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/html/lobbies.html): `html/lobbies.html`
- [Lobby client](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/lobbies.js): `js/lobbies.js`
- [Game board page](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/html/board.html): `html/board.html`
- [Board client](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/board.js): `js/board.js`
- [User page](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/html/user.html): `html/user.html`
- [User client](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/user.js): `js/user.js`
- [Session guard](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/js/authGuard.js): `js/authGuard.js`

### Accounts and profiles

- [Login endpoint](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/user/login.php): `api/user/login.php`
- [Registration endpoint](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/user/register.php): `api/user/register.php`
- [Current-user endpoint](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/user/me.php): `api/user/me.php`
- [Logout endpoint](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/user/logout.php): `api/user/logout.php`
- [Settings endpoint](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/user/saveSettings.php): `api/user/saveSettings.php`
- [User listing](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/users.php): `api/users.php`

### Lobby management

- [Create game](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/lobby/createGame.php): `api/lobby/createGame.php`
- [Delete game](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/lobby/deleteGame.php): `api/lobby/deleteGame.php`
- [Start game](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/lobby/startGame.php): `api/lobby/startGame.php`

### Quoridor gameplay

- [Move endpoint](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/game/move.php): `api/game/move.php`
- [Place wall endpoint](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/game/placeWall.php): `api/game/placeWall.php`
- [Kick initiation](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/game/initiateKick.php): `api/game/initiateKick.php`
- [Kick voting](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/game/voteKick.php): `api/game/voteKick.php`
- [Legal wall rules](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/business/updateLegalWalls.php): `business/updateLegalWalls.php`
- [Pathfinding](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/business/BFS.php): `business/BFS.php`
- [Player colours](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/business/assignColour.php): `business/assignColour.php`

### Backend infrastructure

- [Database connection](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/db.php): `api/db.php`
- [Environment loader](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/loadEnv.php): `api/loadEnv.php`
- [Session authorization](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/api/auth.php): `api/auth.php`
- [Application database](https://github.com/iee-ihu-gr-course1941/adise26_atkon/blob/main/quoridor.sql): `quoridor.sql`

### Other components

- **Player**

## Connections

- Player → Login and register UI: uses
- Login and register UI → Current-user endpoint: checks session (evidence: `js/index.js`)
- Login and register UI → Login endpoint: submits login (evidence: `js/index.js`)
- Login and register UI → Registration endpoint: submits registration (evidence: `js/index.js`)
- Session guard → Current-user endpoint: checks session (evidence: `js/authGuard.js`)
- Lobby client → Session guard: calls (evidence: `js/lobbies.js`)
- Lobby client → Logout endpoint: requests logout (evidence: `js/lobbies.js`)
- Login endpoint → Database connection: queries users (evidence: `api/user/login.php`)
- Registration endpoint → Database connection: creates user (evidence: `api/user/register.php`)
- Current-user endpoint → Session authorization: requires session (evidence: `api/user/me.php`)
- Current-user endpoint → Database connection: queries user (evidence: `api/user/me.php`)
- User listing → Database connection: queries users (evidence: `api/users.php`)
- Database connection → Environment loader: loads configuration (evidence: `api/db.php`)
- Player → Lobby page: enters lobby
- Lobby page → Lobby client: runs client
- Lobby client → Create game: creates game
- Lobby client → Delete game: deletes game
- Lobby client → Start game: starts game
- Player → Game board page: plays game
- Game board page → Board client: runs client
- Board client → Move endpoint: submits move
- Board client → Place wall endpoint: places wall
- Board client → Kick initiation: initiates kick
- Board client → Kick voting: votes kick
- Player → User page: views profile
- User page → User client: runs client
- User client → Settings endpoint: saves settings
- User client → User listing: loads users
- Database connection → Application database: connects
- Move endpoint → Legal wall rules: checks legality
- Move endpoint → Pathfinding: checks paths
- Start game → Player colours: assigns colours
