# farman-usta/campus-app architecture

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

- Interactive diagram: https://gitdiagram.com/farman-usta/campus-app
- Repository: https://github.com/farman-usta/campus-app

## Overview

School Gateway is a browser-based school workflow for visitor passes, appointments and student leave, with role-specific security, administration and headquarters screens; Capacitor packages it for Android. Users submit requests, staff act on them, and headquarters reviews monthly records and summaries. The implementation is largely concentrated in src/app.js, with sample records in src/data.js. The excerpts show the app’s entry imports, role gate and security actions; other feature boundaries are described by the README, so their internal call relationships are not expanded here.

Main entry points: [`src/main.js`](https://github.com/farman-usta/campus-app/blob/main/src/main.js) (App entry point), [`src/app.js`](https://github.com/farman-usta/campus-app/blob/main/src/app.js) (Request intake), [`index.html`](https://github.com/farman-usta/campus-app/blob/main/index.html) (HTML app shell), [`src/styles.css`](https://github.com/farman-usta/campus-app/blob/main/src/styles.css) (Themes and layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Web app runtime"]
  node_shell["HTML app shell<br/>[index.html]"]
  node_entry["App entry point<br/>[main.js]"]
  node_styles["Themes and layout<br/>[styles.css]"]
end

subgraph group_workflows["School workflows"]
  node_request["Request intake<br/>[app.js]"]
  node_seed[("Sample records<br/>[data.js]")]
  node_role_gate["Role password gate<br/>[app.js]"]
  node_security["Gate decisions<br/>[app.js]"]
  node_pass_directions["Pass and directions<br/>[app.js]"]
end

subgraph group_oversight["Administration and reporting"]
  node_admin["Administration screens<br/>[app.js]"]
  node_hq["HQ monthly register<br/>[app.js]"]
  node_analytics["Request summaries<br/>[app.js]"]
end

node_browser(("Parents and visitors"))
node_security_actor(("Security staff"))
node_admin_actor(("Administrators"))
node_hq_actor(("Headquarters staff"))

node_shell -->|"loads"| node_entry
node_entry -->|"imports"| node_styles
node_entry -->|"imports"| node_request
node_request -->|"imports records"| node_seed
node_browser -->|"submits requests"| node_request
node_security_actor -->|"unlocks role"| node_role_gate
node_admin_actor -->|"unlocks role"| node_role_gate
node_hq_actor -->|"unlocks role"| node_role_gate
node_security_actor -->|"reviews requests"| node_security
node_security -->|"shows pass"| node_pass_directions
node_admin_actor -->|"uses screens"| node_admin
node_hq_actor -->|"reviews register"| node_hq
node_hq -->|"views summaries"| node_analytics

click node_shell "https://github.com/farman-usta/campus-app/blob/main/index.html"
click node_entry "https://github.com/farman-usta/campus-app/blob/main/src/main.js"
click node_styles "https://github.com/farman-usta/campus-app/blob/main/src/styles.css"
click node_request "https://github.com/farman-usta/campus-app/blob/main/src/app.js"
click node_seed "https://github.com/farman-usta/campus-app/blob/main/src/data.js"
click node_role_gate "https://github.com/farman-usta/campus-app/blob/main/src/app.js"
click node_security "https://github.com/farman-usta/campus-app/blob/main/src/app.js"
click node_pass_directions "https://github.com/farman-usta/campus-app/blob/main/src/app.js"
click node_admin "https://github.com/farman-usta/campus-app/blob/main/src/app.js"
click node_hq "https://github.com/farman-usta/campus-app/blob/main/src/app.js"
click node_analytics "https://github.com/farman-usta/campus-app/blob/main/src/app.js"

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_shell,node_entry,node_styles toneBlue
class node_request,node_seed,node_role_gate,node_security,node_pass_directions toneAmber
class node_admin,node_hq,node_analytics toneMint
class node_browser,node_security_actor,node_admin_actor,node_hq_actor toneIndigo
```

## Components

### Web app runtime

- [HTML app shell](https://github.com/farman-usta/campus-app/blob/main/index.html): `index.html`
- [App entry point](https://github.com/farman-usta/campus-app/blob/main/src/main.js): `src/main.js`
- [Themes and layout](https://github.com/farman-usta/campus-app/blob/main/src/styles.css): `src/styles.css`

### School workflows

- [Request intake](https://github.com/farman-usta/campus-app/blob/main/src/app.js): `src/app.js`
- [Sample records](https://github.com/farman-usta/campus-app/blob/main/src/data.js): `src/data.js`
- [Role password gate](https://github.com/farman-usta/campus-app/blob/main/src/app.js): `src/app.js`
- [Gate decisions](https://github.com/farman-usta/campus-app/blob/main/src/app.js): `src/app.js`
- [Pass and directions](https://github.com/farman-usta/campus-app/blob/main/src/app.js): `src/app.js`

### Administration and reporting

- [Administration screens](https://github.com/farman-usta/campus-app/blob/main/src/app.js): `src/app.js`
- [HQ monthly register](https://github.com/farman-usta/campus-app/blob/main/src/app.js): `src/app.js`
- [Request summaries](https://github.com/farman-usta/campus-app/blob/main/src/app.js): `src/app.js`

### Other components

- **Parents and visitors**
- **Security staff**
- **Administrators**
- **Headquarters staff**

## Connections

- HTML app shell → App entry point: loads (evidence: `README.md`)
- App entry point → Themes and layout: imports (evidence: `src/main.js`)
- App entry point → Request intake: imports (evidence: `src/main.js`)
- Request intake → Sample records: imports records (evidence: `src/app.js`)
- Parents and visitors → Request intake: submits requests (evidence: `README.md`)
- Security staff → Role password gate: unlocks role (evidence: `README.md`)
- Administrators → Role password gate: unlocks role (evidence: `README.md`)
- Headquarters staff → Role password gate: unlocks role (evidence: `README.md`)
- Security staff → Gate decisions: reviews requests (evidence: `src/app.js`)
- Gate decisions → Pass and directions: shows pass (evidence: `src/app.js`)
- Administrators → Administration screens: uses screens (evidence: `README.md`)
- Headquarters staff → HQ monthly register: reviews register (evidence: `README.md`)
- HQ monthly register → Request summaries: views summaries (evidence: `README.md`)
