# lilmeanieee/loading architecture

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

- Interactive diagram: https://gitdiagram.com/lilmeanieee/loading
- Repository: https://github.com/lilmeanieee/loading

## Overview

This is a PA FUEL 118 operations web application, migrated from standalone PHP pages into Laravel routes and controllers while retaining legacy business logic. Users authenticate, then work with loading tickets, authority-to-withdraw requests, tank planning, operational history, messages, live status, and administration. The route map and sampled controller/library excerpts establish the main dispatch and some domain calls; unsampled modules are represented by their exact paths, without assuming their internal relationships.

Main entry points: [`routes/web.php`](https://github.com/lilmeanieee/loading/blob/main/routes/web.php) (Web routes), [`app/Http/Controllers/LegacyController.php`](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/LegacyController.php) (Legacy adapter), [`app/Support/Legacy/loading_ticket_lib.php`](https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/loading_ticket_lib.php) (Ticket rules), [`app/Support/Legacy/common_lib.php`](https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/common_lib.php) (Shared legacy logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_routes["Web routes<br/>[web.php]"]
  node_legacy["Legacy adapter"]
  node_bridge["Request bridge<br/>[bridge.php]"]
end

subgraph group_identity["Identity and access"]
  node_login["Login"]
  node_otp["OTP verification"]
  node_users["User administration"]
  node_user["User model<br/>[User.php]"]
  node_security["Security helpers<br/>[security.php]"]
end

subgraph group_operations["Fuel operations"]
  node_ticket["Loading tickets"]
  node_ticketlib["Ticket rules"]
  node_tankstore[("Tank inventory<br/>[tank_store.php]")]
  node_recentstore[("Recent loads")]
  node_planner["Tank planner"]
end

subgraph group_authority["Authority workflow"]
  node_authorityrequest["Authority requests"]
  node_authoritywithdraw["Withdraw requests"]
  node_authoritylib["Authority rules<br/>[authority_lib.php]"]
end

subgraph group_oversight["Operations oversight"]
  node_history["Loading history"]
  node_dashboard["Dashboard"]
  node_messages["Messaging"]
  node_audit["Audit log"]
  node_live["Live status"]
  node_common["Shared legacy logic<br/>[common_lib.php]"]
  node_database[("PDO database access<br/>[database.php]")]
end

node_operator(("Staff user"))

node_operator -->|"sends requests"| node_routes
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_otp
node_routes -->|"routes to"| node_users
node_routes -->|"routes to"| node_ticket
node_routes -->|"routes to"| node_planner
node_routes -->|"routes to"| node_authorityrequest
node_routes -->|"routes to"| node_authoritywithdraw
node_routes -->|"routes to"| node_history
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_messages
node_routes -->|"routes to"| node_audit
node_routes -->|"routes to"| node_live
node_login -->|"extends"| node_legacy
node_ticket -->|"extends"| node_legacy
node_ticket -->|"builds tickets"| node_ticketlib
node_ticketlib -->|"uses helpers"| node_common
node_ticketlib -->|"uses inventory"| node_tankstore
node_ticketlib -->|"uses load history"| node_recentstore
node_authorityrequest -->|"reviews requests"| node_authoritylib
node_authoritylib -->|"uses helpers"| node_common
node_users -->|"uses model"| node_user
node_common -->|"uses PDO access"| node_database
node_common -->|"uses security"| node_security
node_legacy -->|"begins and finishes"| node_bridge
node_authoritywithdraw -->|"extends"| node_legacy
node_history -->|"extends"| node_legacy
node_dashboard -->|"extends"| node_legacy
node_messages -->|"extends"| node_legacy
node_audit -->|"extends"| node_legacy
node_live -->|"extends"| node_legacy

click node_routes "https://github.com/lilmeanieee/loading/blob/main/routes/web.php"
click node_legacy "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/LegacyController.php"
click node_bridge "https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/bridge.php"
click node_login "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/LoginController.php"
click node_otp "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/OtpVerifyController.php"
click node_users "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/UsersController.php"
click node_user "https://github.com/lilmeanieee/loading/blob/main/app/Models/User.php"
click node_ticket "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/LoadingTicketController.php"
click node_ticketlib "https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/loading_ticket_lib.php"
click node_tankstore "https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/tank_store.php"
click node_recentstore "https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/recent_load_store.php"
click node_planner "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/FuelTankLoadingPlannerController.php"
click node_authorityrequest "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/AuthorityRequestsController.php"
click node_authoritywithdraw "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/AuthorityWithdrawController.php"
click node_authoritylib "https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/authority_lib.php"
click node_history "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/HistoryController.php"
click node_dashboard "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/DashboardController.php"
click node_messages "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/MessagesController.php"
click node_audit "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/AuditLogController.php"
click node_live "https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/LiveStatusController.php"
click node_common "https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/common_lib.php"
click node_database "https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/database.php"
click node_security "https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/security.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_routes,node_legacy,node_bridge,node_operator toneBlue
class node_login,node_otp,node_users,node_user,node_security toneAmber
class node_ticket,node_ticketlib,node_tankstore,node_recentstore,node_planner toneMint
class node_authorityrequest,node_authoritywithdraw,node_authoritylib toneRose
class node_history,node_dashboard,node_messages,node_audit,node_live,node_common,node_database toneIndigo
```

## Components

### Web entry

- [Web routes](https://github.com/lilmeanieee/loading/blob/main/routes/web.php): `routes/web.php`
- [Legacy adapter](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/LegacyController.php): `app/Http/Controllers/LegacyController.php`
- [Request bridge](https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/bridge.php): `app/Support/Legacy/bridge.php`

### Identity and access

- [Login](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/LoginController.php): `app/Http/Controllers/LoginController.php`
- [OTP verification](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/OtpVerifyController.php): `app/Http/Controllers/OtpVerifyController.php`
- [User administration](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/UsersController.php): `app/Http/Controllers/UsersController.php`
- [User model](https://github.com/lilmeanieee/loading/blob/main/app/Models/User.php): `app/Models/User.php`
- [Security helpers](https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/security.php): `app/Support/Legacy/security.php`

### Fuel operations

- [Loading tickets](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/LoadingTicketController.php): `app/Http/Controllers/LoadingTicketController.php`
- [Ticket rules](https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/loading_ticket_lib.php): `app/Support/Legacy/loading_ticket_lib.php`
- [Tank inventory](https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/tank_store.php): `app/Support/Legacy/tank_store.php`
- [Recent loads](https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/recent_load_store.php): `app/Support/Legacy/recent_load_store.php`
- [Tank planner](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/FuelTankLoadingPlannerController.php): `app/Http/Controllers/FuelTankLoadingPlannerController.php`

### Authority workflow

- [Authority requests](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/AuthorityRequestsController.php): `app/Http/Controllers/AuthorityRequestsController.php`
- [Withdraw requests](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/AuthorityWithdrawController.php): `app/Http/Controllers/AuthorityWithdrawController.php`
- [Authority rules](https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/authority_lib.php): `app/Support/Legacy/authority_lib.php`

### Operations oversight

- [Loading history](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/HistoryController.php): `app/Http/Controllers/HistoryController.php`
- [Dashboard](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Messaging](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/MessagesController.php): `app/Http/Controllers/MessagesController.php`
- [Audit log](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/AuditLogController.php): `app/Http/Controllers/AuditLogController.php`
- [Live status](https://github.com/lilmeanieee/loading/blob/main/app/Http/Controllers/LiveStatusController.php): `app/Http/Controllers/LiveStatusController.php`
- [Shared legacy logic](https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/common_lib.php): `app/Support/Legacy/common_lib.php`
- [PDO database access](https://github.com/lilmeanieee/loading/blob/main/app/Support/Legacy/database.php): `app/Support/Legacy/database.php`

### Other components

- **Staff user**

## Connections

- Staff user → Web routes: sends requests (evidence: `routes/web.php`)
- Web routes → Login: routes to (evidence: `routes/web.php`)
- Web routes → OTP verification: routes to (evidence: `routes/web.php`)
- Web routes → User administration: routes to (evidence: `routes/web.php`)
- Web routes → Loading tickets: routes to (evidence: `routes/web.php`)
- Web routes → Tank planner: routes to (evidence: `routes/web.php`)
- Web routes → Authority requests: routes to (evidence: `routes/web.php`)
- Web routes → Withdraw requests: routes to (evidence: `routes/web.php`)
- Web routes → Loading history: routes to (evidence: `routes/web.php`)
- Web routes → Dashboard: routes to (evidence: `routes/web.php`)
- Web routes → Messaging: routes to (evidence: `routes/web.php`)
- Web routes → Audit log: routes to (evidence: `routes/web.php`)
- Web routes → Live status: routes to (evidence: `routes/web.php`)
- Login → Legacy adapter: extends (evidence: `app/Http/Controllers/LegacyController.php`)
- Loading tickets → Legacy adapter: extends (evidence: `app/Http/Controllers/LegacyController.php`)
- Loading tickets → Ticket rules: builds tickets (evidence: `app/Http/Controllers/LoadingTicketController.php`)
- Ticket rules → Shared legacy logic: uses helpers (evidence: `app/Support/Legacy/loading_ticket_lib.php`)
- Ticket rules → Tank inventory: uses inventory (evidence: `app/Support/Legacy/loading_ticket_lib.php`)
- Ticket rules → Recent loads: uses load history (evidence: `app/Support/Legacy/loading_ticket_lib.php`)
- Authority requests → Authority rules: reviews requests (evidence: `app/Http/Controllers/AuthorityRequestsController.php`)
- Authority rules → Shared legacy logic: uses helpers (evidence: `app/Support/Legacy/authority_lib.php`)
- User administration → User model: uses model (evidence: `app/Http/Controllers/UsersController.php`)
- Shared legacy logic → PDO database access: uses PDO access (evidence: `app/Support/Legacy/common_lib.php`)
- Shared legacy logic → Security helpers: uses security (evidence: `app/Support/Legacy/common_lib.php`)
- Legacy adapter → Request bridge: begins and finishes (evidence: `app/Http/Controllers/LegacyController.php`)
- Withdraw requests → Legacy adapter: extends (evidence: `app/Http/Controllers/LegacyController.php`)
- Loading history → Legacy adapter: extends (evidence: `app/Http/Controllers/LegacyController.php`)
- Dashboard → Legacy adapter: extends (evidence: `app/Http/Controllers/LegacyController.php`)
- Messaging → Legacy adapter: extends (evidence: `app/Http/Controllers/LegacyController.php`)
- Audit log → Legacy adapter: extends (evidence: `app/Http/Controllers/LegacyController.php`)
- Live status → Legacy adapter: extends (evidence: `app/Http/Controllers/LegacyController.php`)
