# lightman74/t2aw architecture

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

- Interactive diagram: https://gitdiagram.com/lightman74/t2aw
- Repository: https://github.com/lightman74/t2aw

## Overview

This is a PHP tournament-management application: organizers configure tournaments and teams, generate pool matches, record scores, consult standings, and manage a knockout phase; display and export features support event operation. The graph follows capabilities evident from the tree and sampled code (notably the tournament-list fetch and database-backed match details). Many endpoints and page scripts were not sampled, so uncertain calls between those components are omitted.

Main entry points: [`api/db.php`](https://github.com/lightman74/t2aw/blob/main/api/db.php) (Database access), [`edit_tournoi.php`](https://github.com/lightman74/t2aw/blob/main/edit_tournoi.php) (Tournament editor), [`js/main.js`](https://github.com/lightman74/t2aw/blob/main/js/main.js) (List interface), [`api/view_phase_finale.php`](https://github.com/lightman74/t2aw/blob/main/api/view_phase_finale.php) (Final phase)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tournament["Tournament setup"]
  node_dashboard["Tournament list<br/>[dashboard.php]"]
  node_listui["List interface<br/>[main.js]"]
  node_tournamentapi["Tournament APIs<br/>[get_tournois.php]"]
  node_editor["Tournament editor<br/>[edit_tournoi.php]"]
  node_teamdraw["Teams and draw<br/>[tirage.js]"]
end

subgraph group_competition["Competition operations"]
  node_generation["Pool generation<br/>[generer_matchs.php]"]
  node_salade["Salade generation"]
  node_schedule["Match order<br/>[ordre_matchs.php]"]
  node_matchactions["Match operations<br/>[matchs_actions.php]"]
  node_scoringui["Live scoring<br/>[scoring.php]"]
  node_scoringapi["Score endpoints<br/>[update_score.php]"]
  node_finalui["Final phase"]
  node_finalcreate["Bracket creation<br/>[creer.php]"]
  node_finalmatches["Final match APIs<br/>[saisir_score.php]"]
end

subgraph group_results["Results and display"]
  node_standings["Standings<br/>[classement.php]"]
  node_finalstandings["Final standings"]
  node_display["Event display<br/>[afficheur.php]"]
  node_timer["Match timer<br/>[timer.php]"]
  node_export["Tournament export"]
  node_import["Tournament import"]
end

subgraph group_platform["Shared services"]
  node_auth["Session and login<br/>[login.php]"]
  node_dbapi["Database access<br/>[db.php]"]
  node_store[("Tournament database")]
  node_pdf["PDF generator<br/>[fpdf.php]"]
  node_qr["QR generator<br/>[qrcode.php]"]
end

node_organizer(("Organizer"))

node_organizer -->|"opens"| node_dashboard
node_dashboard -->|"loads"| node_listui
node_listui -->|"fetches list"| node_tournamentapi
node_organizer -->|"edits tournament"| node_editor
node_editor -->|"sets up teams"| node_teamdraw
node_editor -->|"generates matches"| node_generation
node_editor -.->|"generates format"| node_salade
node_organizer -->|"orders matches"| node_schedule
node_organizer -->|"records scores"| node_scoringui
node_scoringui -->|"updates score"| node_scoringapi
node_organizer -->|"manages finals"| node_finalui
node_finalui -->|"creates bracket"| node_finalcreate
node_finalui -->|"updates finals"| node_finalmatches
node_organizer -->|"views results"| node_standings
node_organizer -->|"views finals"| node_finalstandings
node_organizer -->|"opens display"| node_display
node_organizer -->|"runs timer"| node_timer
node_organizer -->|"exports tournament"| node_export
node_organizer -->|"imports tournament"| node_import
node_organizer -->|"authenticates"| node_auth
node_listui -->|"uploads file"| node_import
node_tournamentapi -->|"queries"| node_dbapi
node_generation -->|"persists matches"| node_dbapi
node_scoringapi -->|"persists scores"| node_dbapi
node_finalcreate -->|"reads and writes"| node_dbapi
node_finalmatches -->|"reads and writes"| node_dbapi
node_dbapi -->|"accesses"| node_store
node_export -->|"reads tournament"| node_dbapi
node_import -->|"writes tournament"| node_dbapi
node_export -.->|"generates PDF"| node_pdf
node_organizer -.->|"generates QR"| node_qr

click node_dashboard "https://github.com/lightman74/t2aw/blob/main/dashboard.php"
click node_listui "https://github.com/lightman74/t2aw/blob/main/js/main.js"
click node_tournamentapi "https://github.com/lightman74/t2aw/blob/main/api/get_tournois.php"
click node_editor "https://github.com/lightman74/t2aw/blob/main/edit_tournoi.php"
click node_teamdraw "https://github.com/lightman74/t2aw/blob/main/js/tirage.js"
click node_generation "https://github.com/lightman74/t2aw/blob/main/api/generer_matchs.php"
click node_salade "https://github.com/lightman74/t2aw/blob/main/api/generer_matchs_salade.php"
click node_schedule "https://github.com/lightman74/t2aw/blob/main/ordre_matchs.php"
click node_matchactions "https://github.com/lightman74/t2aw/blob/main/api/matchs_actions.php"
click node_scoringui "https://github.com/lightman74/t2aw/blob/main/scoring.php"
click node_scoringapi "https://github.com/lightman74/t2aw/blob/main/api/scoring/update_score.php"
click node_finalui "https://github.com/lightman74/t2aw/blob/main/api/view_phase_finale.php"
click node_finalcreate "https://github.com/lightman74/t2aw/blob/main/api/phase_finale/creer.php"
click node_finalmatches "https://github.com/lightman74/t2aw/blob/main/api/phase_finale/saisir_score.php"
click node_standings "https://github.com/lightman74/t2aw/blob/main/classement.php"
click node_finalstandings "https://github.com/lightman74/t2aw/blob/main/classement_final.php"
click node_display "https://github.com/lightman74/t2aw/blob/main/afficheur.php"
click node_timer "https://github.com/lightman74/t2aw/blob/main/timer.php"
click node_export "https://github.com/lightman74/t2aw/blob/main/api/export_tournoi_json.php"
click node_import "https://github.com/lightman74/t2aw/blob/main/api/importer_tournoi.php"
click node_auth "https://github.com/lightman74/t2aw/blob/main/api/login.php"
click node_dbapi "https://github.com/lightman74/t2aw/blob/main/api/db.php"
click node_pdf "https://github.com/lightman74/t2aw/blob/main/api/fpdf/fpdf.php"
click node_qr "https://github.com/lightman74/t2aw/blob/main/api/qrcode.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_dashboard,node_listui,node_tournamentapi,node_editor,node_teamdraw toneBlue
class node_generation,node_salade,node_schedule,node_matchactions,node_scoringui,node_scoringapi,node_finalui,node_finalcreate,node_finalmatches toneAmber
class node_standings,node_finalstandings,node_display,node_timer,node_export,node_import toneMint
class node_auth,node_dbapi,node_store,node_pdf,node_qr toneRose
class node_organizer toneIndigo
```

## Components

### Tournament setup

- [Tournament list](https://github.com/lightman74/t2aw/blob/main/dashboard.php): `dashboard.php`
- [List interface](https://github.com/lightman74/t2aw/blob/main/js/main.js): `js/main.js`
- [Tournament APIs](https://github.com/lightman74/t2aw/blob/main/api/get_tournois.php): `api/get_tournois.php`
- [Tournament editor](https://github.com/lightman74/t2aw/blob/main/edit_tournoi.php): `edit_tournoi.php`
- [Teams and draw](https://github.com/lightman74/t2aw/blob/main/js/tirage.js): `js/tirage.js`

### Competition operations

- [Pool generation](https://github.com/lightman74/t2aw/blob/main/api/generer_matchs.php): `api/generer_matchs.php`
- [Salade generation](https://github.com/lightman74/t2aw/blob/main/api/generer_matchs_salade.php): `api/generer_matchs_salade.php`
- [Match order](https://github.com/lightman74/t2aw/blob/main/ordre_matchs.php): `ordre_matchs.php`
- [Match operations](https://github.com/lightman74/t2aw/blob/main/api/matchs_actions.php): `api/matchs_actions.php`
- [Live scoring](https://github.com/lightman74/t2aw/blob/main/scoring.php): `scoring.php`
- [Score endpoints](https://github.com/lightman74/t2aw/blob/main/api/scoring/update_score.php): `api/scoring/update_score.php`
- [Final phase](https://github.com/lightman74/t2aw/blob/main/api/view_phase_finale.php): `api/view_phase_finale.php`
- [Bracket creation](https://github.com/lightman74/t2aw/blob/main/api/phase_finale/creer.php): `api/phase_finale/creer.php`
- [Final match APIs](https://github.com/lightman74/t2aw/blob/main/api/phase_finale/saisir_score.php): `api/phase_finale/saisir_score.php`

### Results and display

- [Standings](https://github.com/lightman74/t2aw/blob/main/classement.php): `classement.php`
- [Final standings](https://github.com/lightman74/t2aw/blob/main/classement_final.php): `classement_final.php`
- [Event display](https://github.com/lightman74/t2aw/blob/main/afficheur.php): `afficheur.php`
- [Match timer](https://github.com/lightman74/t2aw/blob/main/timer.php): `timer.php`
- [Tournament export](https://github.com/lightman74/t2aw/blob/main/api/export_tournoi_json.php): `api/export_tournoi_json.php`
- [Tournament import](https://github.com/lightman74/t2aw/blob/main/api/importer_tournoi.php): `api/importer_tournoi.php`

### Shared services

- [Session and login](https://github.com/lightman74/t2aw/blob/main/api/login.php): `api/login.php`
- [Database access](https://github.com/lightman74/t2aw/blob/main/api/db.php): `api/db.php`
- **Tournament database**
- [PDF generator](https://github.com/lightman74/t2aw/blob/main/api/fpdf/fpdf.php): `api/fpdf/fpdf.php`
- [QR generator](https://github.com/lightman74/t2aw/blob/main/api/qrcode.php): `api/qrcode.php`

### Other components

- **Organizer**

## Connections

- Organizer → Tournament list: opens
- Tournament list → List interface: loads
- List interface → Tournament APIs: fetches list
- Organizer → Tournament editor: edits tournament
- Tournament editor → Teams and draw: sets up teams
- Tournament editor → Pool generation: generates matches
- Tournament editor → Salade generation: generates format
- Organizer → Match order: orders matches
- Organizer → Live scoring: records scores
- Live scoring → Score endpoints: updates score
- Organizer → Final phase: manages finals
- Final phase → Bracket creation: creates bracket
- Final phase → Final match APIs: updates finals
- Organizer → Standings: views results
- Organizer → Final standings: views finals
- Organizer → Event display: opens display
- Organizer → Match timer: runs timer
- Organizer → Tournament export: exports tournament
- Organizer → Tournament import: imports tournament
- Organizer → Session and login: authenticates
- List interface → Tournament import: uploads file
- Tournament APIs → Database access: queries
- Pool generation → Database access: persists matches
- Score endpoints → Database access: persists scores
- Bracket creation → Database access: reads and writes
- Final match APIs → Database access: reads and writes
- Database access → Tournament database: accesses
- Tournament export → Database access: reads tournament
- Tournament import → Database access: writes tournament
- Tournament export → PDF generator: generates PDF
- Organizer → QR generator: generates QR
