# az-404/stadiumpass architecture

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

- Interactive diagram: https://gitdiagram.com/az-404/stadiumpass
- Repository: https://github.com/az-404/stadiumpass

## Overview

Stadium Pass is a PHP web application for stadium ticket sales and entry operations. Fans browse upcoming matches, select seats, submit a simulated payment, and manage bookings and tickets; staff verify tickets at the gate and review section entries or complaints. Administrators manage matches, pricing, sections, and reports. The excerpts show several pages querying the shared MySQL connection directly, rather than a separate service layer. The README is empty, so unsampled feature details and relationships are limited to what the source index supports.

Main entry points: [`database.sql`](https://github.com/az-404/stadiumpass/blob/main/database.sql) (Stadium data), [`booking.php`](https://github.com/az-404/stadiumpass/blob/main/booking.php) (Match booking), [`auth_check.php`](https://github.com/az-404/stadiumpass/blob/main/auth_check.php) (Session and roles), [`my_bookings.php`](https://github.com/az-404/stadiumpass/blob/main/my_bookings.php) (Booking management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_fan["Fan bookings"]
  node_matchbrowse["Match booking<br/>[booking.php]"]
  node_bookingrecords["Booking management<br/>[my_bookings.php]"]
  node_ticketview["Ticket viewing<br/>[ticket.php]"]
end

subgraph group_ops["Stadium operations"]
  node_staffverify["Ticket verification<br/>[verify.php]"]
  node_sectionentries["Section entries<br/>[entries.php]"]
  node_complaints["Staff complaints<br/>[complaints.php]"]
end

subgraph group_admin["Administration"]
  node_matchadmin["Match management<br/>[matches.php]"]
  node_sectionadmin["Section management<br/>[sections.php]"]
  node_priceadmin["Price management<br/>[prices.php]"]
  node_reports["Reports<br/>[reports.php]"]
end

subgraph group_shared["Shared services"]
  node_auth["Session and roles<br/>[auth_check.php]"]
  node_accounts["Account access<br/>[login.php]"]
  node_registration["Registration<br/>[register.php]"]
  node_googleauth["Google callback"]
  node_dbconfig["DB configuration<br/>[db.php]"]
  node_connection["PDO connection<br/>[db.php]"]
  node_database[("Stadium data<br/>[database.sql]")]
  node_header["Shared navigation<br/>[header.php]"]
  node_footer["Shared footer<br/>[footer.php]"]
end

node_fan(("Fan"))

node_fan -->|"browses and books"| node_matchbrowse
node_matchbrowse -->|"reads matches, seats, prices"| node_database
node_matchbrowse -->|"writes bookings and tickets"| node_database
node_fan -->|"manages bookings"| node_bookingrecords
node_bookingrecords -->|"reads and cancels bookings"| node_database
node_bookingrecords -->|"opens ticket"| node_ticketview
node_fan -->|"signs in"| node_accounts
node_fan -->|"registers"| node_registration
node_accounts -->|"checks session"| node_auth
node_registration -->|"creates account"| node_database
node_staffverify -->|"checks staff role"| node_auth
node_staffverify -->|"validates ticket and records entry"| node_database
node_sectionentries -->|"counts entries"| node_database
node_complaints -->|"checks staff role"| node_auth
node_complaints -->|"records and lists complaints"| node_database
node_matchadmin -->|"checks admin role"| node_auth
node_matchadmin -->|"manages matches"| node_database
node_sectionadmin -->|"manages sections"| node_database
node_priceadmin -->|"manages match prices"| node_database
node_reports -->|"queries report data"| node_database
node_dbconfig -->|"loads"| node_connection
node_connection -->|"connects to"| node_database
node_googleauth -->|"uses database connection"| node_database
node_matchbrowse -->|"loads session helpers"| node_auth
node_matchbrowse -->|"loads database config"| node_dbconfig
node_matchbrowse -.->|"renders navigation"| node_header
node_bookingrecords -->|"renders navigation"| node_header
node_staffverify -->|"renders navigation"| node_header
node_complaints -->|"renders footer"| node_footer

click node_matchbrowse "https://github.com/az-404/stadiumpass/blob/main/booking.php"
click node_bookingrecords "https://github.com/az-404/stadiumpass/blob/main/my_bookings.php"
click node_ticketview "https://github.com/az-404/stadiumpass/blob/main/ticket.php"
click node_staffverify "https://github.com/az-404/stadiumpass/blob/main/staff/verify.php"
click node_sectionentries "https://github.com/az-404/stadiumpass/blob/main/staff/entries.php"
click node_complaints "https://github.com/az-404/stadiumpass/blob/main/staff/complaints.php"
click node_matchadmin "https://github.com/az-404/stadiumpass/blob/main/matches.php"
click node_sectionadmin "https://github.com/az-404/stadiumpass/blob/main/sections.php"
click node_priceadmin "https://github.com/az-404/stadiumpass/blob/main/prices.php"
click node_reports "https://github.com/az-404/stadiumpass/blob/main/reports.php"
click node_auth "https://github.com/az-404/stadiumpass/blob/main/auth_check.php"
click node_accounts "https://github.com/az-404/stadiumpass/blob/main/login.php"
click node_registration "https://github.com/az-404/stadiumpass/blob/main/register.php"
click node_googleauth "https://github.com/az-404/stadiumpass/blob/main/google-callback.php"
click node_dbconfig "https://github.com/az-404/stadiumpass/blob/main/config/db.php"
click node_connection "https://github.com/az-404/stadiumpass/blob/main/db.php"
click node_database "https://github.com/az-404/stadiumpass/blob/main/database.sql"
click node_header "https://github.com/az-404/stadiumpass/blob/main/includes/header.php"
click node_footer "https://github.com/az-404/stadiumpass/blob/main/includes/footer.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_matchbrowse,node_bookingrecords,node_ticketview toneBlue
class node_staffverify,node_sectionentries,node_complaints toneAmber
class node_matchadmin,node_sectionadmin,node_priceadmin,node_reports toneMint
class node_auth,node_accounts,node_registration,node_googleauth,node_dbconfig,node_connection,node_database,node_header,node_footer toneRose
class node_fan toneIndigo
```

## Components

### Fan bookings

- [Match booking](https://github.com/az-404/stadiumpass/blob/main/booking.php): `booking.php`
- [Booking management](https://github.com/az-404/stadiumpass/blob/main/my_bookings.php): `my_bookings.php`
- [Ticket viewing](https://github.com/az-404/stadiumpass/blob/main/ticket.php): `ticket.php`

### Stadium operations

- [Ticket verification](https://github.com/az-404/stadiumpass/blob/main/staff/verify.php): `staff/verify.php`
- [Section entries](https://github.com/az-404/stadiumpass/blob/main/staff/entries.php): `staff/entries.php`
- [Staff complaints](https://github.com/az-404/stadiumpass/blob/main/staff/complaints.php): `staff/complaints.php`

### Administration

- [Match management](https://github.com/az-404/stadiumpass/blob/main/matches.php): `matches.php`
- [Section management](https://github.com/az-404/stadiumpass/blob/main/sections.php): `sections.php`
- [Price management](https://github.com/az-404/stadiumpass/blob/main/prices.php): `prices.php`
- [Reports](https://github.com/az-404/stadiumpass/blob/main/reports.php): `reports.php`

### Shared services

- [Session and roles](https://github.com/az-404/stadiumpass/blob/main/auth_check.php): `auth_check.php`
- [Account access](https://github.com/az-404/stadiumpass/blob/main/login.php): `login.php`
- [Registration](https://github.com/az-404/stadiumpass/blob/main/register.php): `register.php`
- [Google callback](https://github.com/az-404/stadiumpass/blob/main/google-callback.php): `google-callback.php`
- [DB configuration](https://github.com/az-404/stadiumpass/blob/main/config/db.php): `config/db.php`
- [PDO connection](https://github.com/az-404/stadiumpass/blob/main/db.php): `db.php`
- [Stadium data](https://github.com/az-404/stadiumpass/blob/main/database.sql): `database.sql`
- [Shared navigation](https://github.com/az-404/stadiumpass/blob/main/includes/header.php): `includes/header.php`
- [Shared footer](https://github.com/az-404/stadiumpass/blob/main/includes/footer.php): `includes/footer.php`

### Other components

- **Fan**

## Connections

- Fan → Match booking: browses and books (evidence: `booking.php`)
- Match booking → Stadium data: reads matches, seats, prices (evidence: `booking.php`)
- Match booking → Stadium data: writes bookings and tickets (evidence: `booking.php`)
- Fan → Booking management: manages bookings
- Booking management → Stadium data: reads and cancels bookings (evidence: `my_bookings.php`)
- Booking management → Ticket viewing: opens ticket (evidence: `my_bookings.php`)
- Fan → Account access: signs in
- Fan → Registration: registers
- Account access → Session and roles: checks session (evidence: `login.php`)
- Registration → Stadium data: creates account (evidence: `register.php`)
- Ticket verification → Session and roles: checks staff role (evidence: `staff/verify.php`)
- Ticket verification → Stadium data: validates ticket and records entry (evidence: `staff/verify.php`)
- Section entries → Stadium data: counts entries (evidence: `staff/entries.php`)
- Staff complaints → Session and roles: checks staff role (evidence: `staff/complaints.php`)
- Staff complaints → Stadium data: records and lists complaints (evidence: `staff/complaints.php`)
- Match management → Session and roles: checks admin role (evidence: `matches.php`)
- Match management → Stadium data: manages matches (evidence: `matches.php`)
- Section management → Stadium data: manages sections (evidence: `sections.php`)
- Price management → Stadium data: manages match prices (evidence: `prices.php`)
- Reports → Stadium data: queries report data (evidence: `reports.php`)
- DB configuration → PDO connection: loads (evidence: `config/db.php`)
- PDO connection → Stadium data: connects to (evidence: `db.php`)
- Google callback → Stadium data: uses database connection (evidence: `google-callback.php`)
- Match booking → Session and roles: loads session helpers (evidence: `booking.php`)
- Match booking → DB configuration: loads database config (evidence: `booking.php`)
- Match booking → Shared navigation: renders navigation (evidence: `booking.php`)
- Booking management → Shared navigation: renders navigation (evidence: `my_bookings.php`)
- Ticket verification → Shared navigation: renders navigation (evidence: `staff/verify.php`)
- Staff complaints → Shared footer: renders footer (evidence: `staff/complaints.php`)
