# johnnyyy27/tarumt-asset-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/johnnyyy27/tarumt-asset-management-system
- Repository: https://github.com/johnnyyy27/tarumt-asset-management-system

## Overview

TARUMT Asset Management is a campus web application for asset lookup and administration, guest fault reporting, maintenance prioritization, and financial oversight. The main public workflow is scanning or entering an asset tag, viewing its information, and submitting a fault report; staff then manage inventory and maintenance, while financial tools summarize repair costs and projections. Firebase provides application data and authentication, with image storage and AI classification represented as separate capabilities. Some workflow links are documented in the README rather than visible in sampled implementation, so those edges cite the README.

Main entry points: [`app/header.php`](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/header.php) (Navigation layout), [`app/inventory.php`](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/inventory.php) (Inventory control), [`app/index.php`](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/index.php) (Dashboard), [`app/report.php`](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/report.php) (Fault reporting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Overview"]
  node_dashboard["Dashboard<br/>[index.php]"]
  node_auth["Authentication and roles<br/>[auth.js]"]
  node_permissions["Page permissions<br/>[permissions.js]"]
  node_layout["Navigation layout<br/>[header.php]"]
end

subgraph group_assets["Asset Directory"]
  node_lookup_modal["QR lookup modal"]
  node_scan_lookup["Public tag lookup<br/>[scanLookup.js]"]
  node_tag_ids["Tag ID normalization<br/>[tagId.js]"]
  node_asset_info["Asset information<br/>[info.php]"]
  node_inventory["Inventory control<br/>[inventory.php]"]
end

subgraph group_service["Maintenance Workflow"]
  node_reporting["Fault reporting<br/>[report.php]"]
  node_maintenance["Maintenance tickets<br/>[maintenance.php]"]
  node_ticket_detail["Ticket details<br/>[report_detail.php]"]
  node_priority_classifier["Fault classification<br/>[classify.php]"]
  node_ai_classifier["AI classification logic<br/>[classifier.js]"]
  node_image_upload["Image upload endpoint<br/>[upload_image.php]"]
end

subgraph group_admin["Campus Administration"]
  node_people["User administration<br/>[people.php]"]
  node_facilities["Facilities directory<br/>[utility.php]"]
end

subgraph group_insights["Financial Insights"]
  node_financial["Financial analytics<br/>[financial.php]"]
end

subgraph group_platform["Data and Integrations"]
  node_firestore[("Firebase Firestore")]
  node_firebase_auth["Firebase Authentication"]
  node_firebase_storage[("Firebase Storage")]
  node_gemini["Gemini AI"]
end

node_user(("Campus users"))

node_user -->|"opens"| node_dashboard
node_dashboard -->|"opens"| node_lookup_modal
node_dashboard -->|"reads dashboard data"| node_firestore
node_lookup_modal -->|"starts lookup"| node_scan_lookup
node_scan_lookup -->|"normalizes tag"| node_tag_ids
node_scan_lookup -->|"opens asset details"| node_asset_info
node_user -->|"scans asset tag"| node_asset_info
node_asset_info -.->|"reads asset"| node_firestore
node_user -->|"files fault"| node_reporting
node_reporting -.->|"creates ticket"| node_firestore
node_reporting -.->|"assigns priority"| node_priority_classifier
node_priority_classifier -.->|"uses classifier"| node_ai_classifier
node_ai_classifier -->|"classifies fault"| node_gemini
node_reporting -.->|"uploads evidence"| node_image_upload
node_image_upload -.->|"stores image"| node_firebase_storage
node_maintenance -.->|"manages tickets"| node_firestore
node_ticket_detail -.->|"reads ticket"| node_firestore
node_inventory -->|"normalizes tag"| node_tag_ids
node_inventory -->|"manages assets"| node_firestore
node_inventory -->|"reads facilities and tickets"| node_firestore
node_inventory -->|"uploads asset photo"| node_firebase_storage
node_people -->|"manages users"| node_firestore
node_people -->|"creates accounts"| node_firebase_auth
node_facilities -->|"manages locations"| node_firestore
node_financial -.->|"aggregates repair costs"| node_firestore
node_auth -->|"checks session"| node_firebase_auth
node_auth -->|"resolves user role"| node_firestore
node_auth -->|"applies access rules"| node_permissions
node_layout -->|"loads authentication"| node_auth
node_dashboard -->|"includes layout"| node_layout
node_inventory -->|"includes layout"| node_layout
node_maintenance -->|"includes layout"| node_layout
node_financial -->|"includes layout"| node_layout
node_people -->|"includes layout"| node_layout
node_ticket_detail -->|"includes layout"| node_layout
node_facilities -->|"includes layout"| node_layout

click node_dashboard "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/index.php"
click node_auth "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/js/auth.js"
click node_permissions "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/js/permissions.js"
click node_layout "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/header.php"
click node_lookup_modal "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/partials/scan_lookup_modal.php"
click node_scan_lookup "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/js/scanLookup.js"
click node_tag_ids "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/js/tagId.js"
click node_asset_info "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/info.php"
click node_inventory "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/inventory.php"
click node_reporting "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/report.php"
click node_maintenance "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/maintenance.php"
click node_ticket_detail "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/report_detail.php"
click node_priority_classifier "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/api/classify.php"
click node_ai_classifier "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/js/classifier.js"
click node_image_upload "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/api/upload_image.php"
click node_people "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/people.php"
click node_facilities "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/utility.php"
click node_financial "https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/financial.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_auth,node_permissions,node_layout,node_user toneBlue
class node_lookup_modal,node_scan_lookup,node_tag_ids,node_asset_info,node_inventory toneAmber
class node_reporting,node_maintenance,node_ticket_detail,node_priority_classifier,node_ai_classifier,node_image_upload toneMint
class node_people,node_facilities toneRose
class node_financial toneIndigo
class node_firestore,node_firebase_auth,node_firebase_storage,node_gemini toneTeal
```

## Components

### Access and Overview

- [Dashboard](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/index.php): `app/index.php`
- [Authentication and roles](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/js/auth.js): `app/js/auth.js`
- [Page permissions](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/js/permissions.js): `app/js/permissions.js`
- [Navigation layout](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/header.php): `app/header.php`

### Asset Directory

- [QR lookup modal](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/partials/scan_lookup_modal.php): `app/partials/scan_lookup_modal.php`
- [Public tag lookup](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/js/scanLookup.js): `app/js/scanLookup.js`
- [Tag ID normalization](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/js/tagId.js): `app/js/tagId.js`
- [Asset information](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/info.php): `app/info.php`
- [Inventory control](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/inventory.php): `app/inventory.php`

### Maintenance Workflow

- [Fault reporting](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/report.php): `app/report.php`
- [Maintenance tickets](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/maintenance.php): `app/maintenance.php`
- [Ticket details](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/report_detail.php): `app/report_detail.php`
- [Fault classification](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/api/classify.php): `app/api/classify.php`
- [AI classification logic](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/js/classifier.js): `app/js/classifier.js`
- [Image upload endpoint](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/api/upload_image.php): `app/api/upload_image.php`

### Campus Administration

- [User administration](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/people.php): `app/people.php`
- [Facilities directory](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/utility.php): `app/utility.php`

### Financial Insights

- [Financial analytics](https://github.com/johnnyyy27/tarumt-asset-management-system/blob/main/app/financial.php): `app/financial.php`

### Data and Integrations

- **Firebase Firestore**
- **Firebase Authentication**
- **Firebase Storage**
- **Gemini AI**

### Other components

- **Campus users**

## Connections

- Campus users → Dashboard: opens (evidence: `README.md`)
- Dashboard → QR lookup modal: opens (evidence: `app/index.php`)
- Dashboard → Firebase Firestore: reads dashboard data (evidence: `app/index.php`)
- QR lookup modal → Public tag lookup: starts lookup
- Public tag lookup → Tag ID normalization: normalizes tag (evidence: `app/js/scanLookup.js`)
- Public tag lookup → Asset information: opens asset details (evidence: `app/js/scanLookup.js`)
- Campus users → Asset information: scans asset tag (evidence: `README.md`)
- Asset information → Firebase Firestore: reads asset
- Campus users → Fault reporting: files fault (evidence: `README.md`)
- Fault reporting → Firebase Firestore: creates ticket
- Fault reporting → Fault classification: assigns priority
- Fault classification → AI classification logic: uses classifier
- AI classification logic → Gemini AI: classifies fault (evidence: `app/js/classifier.js`)
- Fault reporting → Image upload endpoint: uploads evidence
- Image upload endpoint → Firebase Storage: stores image
- Maintenance tickets → Firebase Firestore: manages tickets
- Ticket details → Firebase Firestore: reads ticket
- Inventory control → Tag ID normalization: normalizes tag (evidence: `app/inventory.php`)
- Inventory control → Firebase Firestore: manages assets (evidence: `app/inventory.php`)
- Inventory control → Firebase Firestore: reads facilities and tickets (evidence: `app/inventory.php`)
- Inventory control → Firebase Storage: uploads asset photo (evidence: `app/inventory.php`)
- User administration → Firebase Firestore: manages users (evidence: `app/people.php`)
- User administration → Firebase Authentication: creates accounts (evidence: `app/people.php`)
- Facilities directory → Firebase Firestore: manages locations (evidence: `app/utility.php`)
- Financial analytics → Firebase Firestore: aggregates repair costs
- Authentication and roles → Firebase Authentication: checks session (evidence: `app/js/auth.js`)
- Authentication and roles → Firebase Firestore: resolves user role (evidence: `app/js/auth.js`)
- Authentication and roles → Page permissions: applies access rules (evidence: `app/js/auth.js`)
- Navigation layout → Authentication and roles: loads authentication
- Dashboard → Navigation layout: includes layout (evidence: `app/index.php`)
- Inventory control → Navigation layout: includes layout (evidence: `app/inventory.php`)
- Maintenance tickets → Navigation layout: includes layout (evidence: `app/maintenance.php`)
- Financial analytics → Navigation layout: includes layout (evidence: `app/financial.php`)
- User administration → Navigation layout: includes layout (evidence: `app/people.php`)
- Ticket details → Navigation layout: includes layout (evidence: `app/report_detail.php`)
- Facilities directory → Navigation layout: includes layout (evidence: `app/utility.php`)
