# iantolentino/wts architecture

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

- Interactive diagram: https://gitdiagram.com/iantolentino/wts
- Repository: https://github.com/iantolentino/wts

## Overview

Whittles is a PHP/MySQL application for ticketing and staff history. Users sign in, then work with tickets or staff records; the product also provides ticket attachments, department views, reports/exports, account approval, and external ticket feeds. The sampled ticket-list page loads local tickets and combines them with external tickets before filtering and display. The graph includes documented capabilities whose page implementations were not sampled; those connections are marked dashed where their runtime wiring is unverified.

Main entry points: [`backend/app/bootstrap.php`](https://github.com/iantolentino/wts/blob/main/backend/app/bootstrap.php) (Request bootstrap), [`backend/app/database.php`](https://github.com/iantolentino/wts/blob/main/backend/app/database.php) (Database connection), [`frontend/index.php`](https://github.com/iantolentino/wts/blob/main/frontend/index.php) (Ticket list), [`frontend/staff.php`](https://github.com/iantolentino/wts/blob/main/frontend/staff.php) (Staff directory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_login["Sign-in and registration<br/>[login.php]"]
  node_ticket_list["Ticket list<br/>[index.php]"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_staff_directory["Staff directory<br/>[staff.php]"]
end

subgraph group_access["Access and core"]
  node_bootstrap["Request bootstrap<br/>[bootstrap.php]"]
  node_auth["Authentication and permissions<br/>[auth.php]"]
  node_security["Request security<br/>[security.php]"]
  node_database["Database connection<br/>[database.php]"]
  node_layout["Shared page layout<br/>[layout.php]"]
  node_accounts["Account management<br/>[users.php]"]
  node_schema[("Relational schema<br/>[schema.sql]")]
end

subgraph group_tickets["Ticket operations"]
  node_ticket_rules["Ticket rules<br/>[tickets.php]"]
  node_attachments["Ticket attachments<br/>[attachments.php]"]
  node_mixed_tickets["Mixed ticket loading<br/>[mixed-tickets.php]"]
end

subgraph group_staff["Staff and reporting"]
  node_staff_history["Staff history<br/>[history.php]"]
  node_departments["Departments and teams<br/>[departments.php]"]
  node_reports["Reports and exports<br/>[reports.php]"]
end

subgraph group_integrations["External sources"]
  node_feed["External ticket feed<br/>[feed.php]"]
  node_external_source{{"External ticket service"}}
end

node_user(("User"))

node_user -.->|"signs in"| node_login
node_user -.->|"views tickets"| node_ticket_list
node_user -.->|"manages staff"| node_staff_directory
node_ticket_list -->|"loads request setup"| node_bootstrap
node_ticket_list -->|"loads ticket rows"| node_mixed_tickets
node_bootstrap -->|"loads"| node_database
node_bootstrap -->|"loads"| node_security
node_bootstrap -->|"loads"| node_auth
node_bootstrap -->|"loads"| node_ticket_rules
node_bootstrap -->|"loads"| node_attachments
node_bootstrap -->|"loads"| node_layout
node_mixed_tickets -->|"fetches external tickets"| node_feed
node_mixed_tickets -->|"filters local tickets"| node_ticket_rules
node_feed -->|"requests ticket data"| node_external_source
node_dashboard -.->|"uses shared ticket totals"| node_mixed_tickets
node_ticket_list -.->|"supports downloads"| node_attachments
node_staff_directory -.->|"views history"| node_staff_history
node_staff_directory -.->|"browses departments"| node_departments
node_reports -.->|"exports history"| node_staff_history
node_accounts -.->|"approves accounts"| node_user
node_auth -.->|"checks account access"| node_database
node_ticket_rules -.->|"reads and writes"| node_database
node_attachments -.->|"stores file bytes"| node_database
node_staff_directory -.->|"stores staff records"| node_database
node_reports -.->|"queries report data"| node_database

click node_login "https://github.com/iantolentino/wts/blob/main/frontend/login.php"
click node_ticket_list "https://github.com/iantolentino/wts/blob/main/frontend/index.php"
click node_dashboard "https://github.com/iantolentino/wts/blob/main/frontend/dashboard.php"
click node_staff_directory "https://github.com/iantolentino/wts/blob/main/frontend/staff.php"
click node_bootstrap "https://github.com/iantolentino/wts/blob/main/backend/app/bootstrap.php"
click node_auth "https://github.com/iantolentino/wts/blob/main/backend/app/auth.php"
click node_security "https://github.com/iantolentino/wts/blob/main/backend/app/security.php"
click node_database "https://github.com/iantolentino/wts/blob/main/backend/app/database.php"
click node_layout "https://github.com/iantolentino/wts/blob/main/backend/app/layout.php"
click node_ticket_rules "https://github.com/iantolentino/wts/blob/main/backend/app/tickets.php"
click node_attachments "https://github.com/iantolentino/wts/blob/main/backend/app/attachments.php"
click node_mixed_tickets "https://github.com/iantolentino/wts/blob/main/backend/app/mixed-tickets.php"
click node_feed "https://github.com/iantolentino/wts/blob/main/backend/app/feed.php"
click node_staff_history "https://github.com/iantolentino/wts/blob/main/frontend/history.php"
click node_departments "https://github.com/iantolentino/wts/blob/main/frontend/departments.php"
click node_reports "https://github.com/iantolentino/wts/blob/main/frontend/reports.php"
click node_accounts "https://github.com/iantolentino/wts/blob/main/frontend/users.php"
click node_schema "https://github.com/iantolentino/wts/blob/main/database/schema.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,node_ticket_list,node_dashboard,node_staff_directory,node_user toneBlue
class node_bootstrap,node_auth,node_security,node_database,node_layout,node_accounts,node_schema toneAmber
class node_ticket_rules,node_attachments,node_mixed_tickets toneMint
class node_staff_history,node_departments,node_reports toneRose
class node_feed,node_external_source toneIndigo
```

## Components

### Web entry

- [Sign-in and registration](https://github.com/iantolentino/wts/blob/main/frontend/login.php): `frontend/login.php`
- [Ticket list](https://github.com/iantolentino/wts/blob/main/frontend/index.php): `frontend/index.php`
- [Dashboard](https://github.com/iantolentino/wts/blob/main/frontend/dashboard.php): `frontend/dashboard.php`
- [Staff directory](https://github.com/iantolentino/wts/blob/main/frontend/staff.php): `frontend/staff.php`

### Access and core

- [Request bootstrap](https://github.com/iantolentino/wts/blob/main/backend/app/bootstrap.php): `backend/app/bootstrap.php`
- [Authentication and permissions](https://github.com/iantolentino/wts/blob/main/backend/app/auth.php): `backend/app/auth.php`
- [Request security](https://github.com/iantolentino/wts/blob/main/backend/app/security.php): `backend/app/security.php`
- [Database connection](https://github.com/iantolentino/wts/blob/main/backend/app/database.php): `backend/app/database.php`
- [Shared page layout](https://github.com/iantolentino/wts/blob/main/backend/app/layout.php): `backend/app/layout.php`
- [Account management](https://github.com/iantolentino/wts/blob/main/frontend/users.php): `frontend/users.php`
- [Relational schema](https://github.com/iantolentino/wts/blob/main/database/schema.sql): `database/schema.sql`

### Ticket operations

- [Ticket rules](https://github.com/iantolentino/wts/blob/main/backend/app/tickets.php): `backend/app/tickets.php`
- [Ticket attachments](https://github.com/iantolentino/wts/blob/main/backend/app/attachments.php): `backend/app/attachments.php`
- [Mixed ticket loading](https://github.com/iantolentino/wts/blob/main/backend/app/mixed-tickets.php): `backend/app/mixed-tickets.php`

### Staff and reporting

- [Staff history](https://github.com/iantolentino/wts/blob/main/frontend/history.php): `frontend/history.php`
- [Departments and teams](https://github.com/iantolentino/wts/blob/main/frontend/departments.php): `frontend/departments.php`
- [Reports and exports](https://github.com/iantolentino/wts/blob/main/frontend/reports.php): `frontend/reports.php`

### External sources

- [External ticket feed](https://github.com/iantolentino/wts/blob/main/backend/app/feed.php): `backend/app/feed.php`
- **External ticket service**

### Other components

- **User**

## Connections

- User → Sign-in and registration: signs in (evidence: `README.md`)
- User → Ticket list: views tickets (evidence: `README.md`)
- User → Staff directory: manages staff (evidence: `README.md`)
- Ticket list → Request bootstrap: loads request setup (evidence: `frontend/index.php`)
- Ticket list → Mixed ticket loading: loads ticket rows (evidence: `frontend/index.php`)
- Request bootstrap → Database connection: loads (evidence: `backend/app/bootstrap.php`)
- Request bootstrap → Request security: loads (evidence: `backend/app/bootstrap.php`)
- Request bootstrap → Authentication and permissions: loads (evidence: `backend/app/bootstrap.php`)
- Request bootstrap → Ticket rules: loads (evidence: `backend/app/bootstrap.php`)
- Request bootstrap → Ticket attachments: loads (evidence: `backend/app/bootstrap.php`)
- Request bootstrap → Shared page layout: loads (evidence: `backend/app/bootstrap.php`)
- Mixed ticket loading → External ticket feed: fetches external tickets (evidence: `backend/app/mixed-tickets.php`)
- Mixed ticket loading → Ticket rules: filters local tickets (evidence: `backend/app/mixed-tickets.php`)
- External ticket feed → External ticket service: requests ticket data (evidence: `backend/app/feed.php`)
- Dashboard → Mixed ticket loading: uses shared ticket totals (evidence: `README.md`)
- Ticket list → Ticket attachments: supports downloads (evidence: `README.md`)
- Staff directory → Staff history: views history (evidence: `README.md`)
- Staff directory → Departments and teams: browses departments (evidence: `README.md`)
- Reports and exports → Staff history: exports history (evidence: `README.md`)
- Account management → User: approves accounts (evidence: `README.md`)
- Authentication and permissions → Database connection: checks account access (evidence: `README.md`)
- Ticket rules → Database connection: reads and writes (evidence: `README.md`)
- Ticket attachments → Database connection: stores file bytes (evidence: `README.md`)
- Staff directory → Database connection: stores staff records (evidence: `README.md`)
- Reports and exports → Database connection: queries report data (evidence: `README.md`)
