# advaitharivoli/dps-safety-hub architecture

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

- Interactive diagram: https://gitdiagram.com/advaitharivoli/dps-safety-hub
- Repository: https://github.com/advaitharivoli/dps-safety-hub

## Overview

School Safety Hub is a browser-based bullying report and case registry. Students look up their admission record and submit an incident; school staff review it through role-specific dashboards, escalate it across authority levels, and record a final resolution. Principal-level statistics and simulated CCTV evidence are additional capabilities. The runtime is concentrated in app.js, with shared role views in index.html and presentation in style.css. Several feature links are documented in the README; unsampled implementation details are not inferred.

Main entry points: [`app.js`](https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js) (Incident registry), [`index.html`](https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html) (Incident reporting), [`style.css`](https://github.com/advaitharivoli/dps-safety-hub/blob/main/style.css) (Responsive styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Student intake"]
  node_report_form["Incident reporting<br/>[index.html]"]
  node_student_lookup["Admission lookup<br/>[app.js]"]
  node_incident_capture["Incident capture<br/>[app.js]"]
end

subgraph group_casework["Case management"]
  node_case_state[("Incident registry<br/>[app.js]")]
  node_teacher_review["Teacher triage<br/>[index.html]"]
  node_escalation["Case escalation<br/>[app.js]"]
  node_resolution["Case resolution<br/>[app.js]"]
  node_cctv["Mock CCTV evidence<br/>[app.js]"]
end

subgraph group_oversight["Authority oversight"]
  node_senior_review["Senior Mistress<br/>[index.html]"]
  node_head_review["Head Mistress<br/>[index.html]"]
  node_vp_review["Vice Principal<br/>[index.html]"]
  node_principal_review["Principal decisions<br/>[index.html]"]
  node_principal_stats["School-wide statistics<br/>[app.js]"]
end

subgraph group_presentation["Browser interface"]
  node_role_auth["Role sign-in<br/>[app.js]"]
  node_role_views["Role dashboards<br/>[index.html]"]
  node_visual_design["Responsive styling<br/>[style.css]"]
end

node_student(("Student reporter"))
node_role_staff(("School staff"))

node_student -->|"submits report"| node_report_form
node_report_form -->|"looks up student"| node_student_lookup
node_report_form -->|"documents incident"| node_incident_capture
node_incident_capture -->|"creates case"| node_case_state
node_role_staff -->|"signs in"| node_role_auth
node_role_auth -->|"switches role view"| node_role_views
node_case_state -->|"feeds review"| node_teacher_review
node_teacher_review -->|"escalates cases"| node_senior_review
node_senior_review -->|"escalates cases"| node_head_review
node_head_review -->|"escalates cases"| node_vp_review
node_vp_review -->|"escalates cases"| node_principal_review
node_role_staff -->|"escalates case"| node_escalation
node_escalation -->|"updates case"| node_case_state
node_role_staff -->|"records outcome"| node_resolution
node_resolution -->|"updates status"| node_case_state
node_case_state -->|"supplies case data"| node_principal_stats
node_incident_capture -.->|"links by location"| node_cctv
node_role_views -->|"styled by"| node_visual_design

click node_report_form "https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html"
click node_student_lookup "https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js"
click node_incident_capture "https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js"
click node_case_state "https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js"
click node_teacher_review "https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html"
click node_senior_review "https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html"
click node_head_review "https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html"
click node_vp_review "https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html"
click node_principal_review "https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html"
click node_escalation "https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js"
click node_resolution "https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js"
click node_cctv "https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js"
click node_principal_stats "https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js"
click node_role_auth "https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js"
click node_role_views "https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html"
click node_visual_design "https://github.com/advaitharivoli/dps-safety-hub/blob/main/style.css"

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_report_form,node_student_lookup,node_incident_capture toneBlue
class node_case_state,node_teacher_review,node_escalation,node_resolution,node_cctv toneAmber
class node_senior_review,node_head_review,node_vp_review,node_principal_review,node_principal_stats toneMint
class node_role_auth,node_role_views,node_visual_design toneRose
class node_student,node_role_staff toneIndigo
```

## Components

### Student intake

- [Incident reporting](https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html): `index.html`
- [Admission lookup](https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js): `app.js`
- [Incident capture](https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js): `app.js`

### Case management

- [Incident registry](https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js): `app.js`
- [Teacher triage](https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html): `index.html`
- [Case escalation](https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js): `app.js`
- [Case resolution](https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js): `app.js`
- [Mock CCTV evidence](https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js): `app.js`

### Authority oversight

- [Senior Mistress](https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html): `index.html`
- [Head Mistress](https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html): `index.html`
- [Vice Principal](https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html): `index.html`
- [Principal decisions](https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html): `index.html`
- [School-wide statistics](https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js): `app.js`

### Browser interface

- [Role sign-in](https://github.com/advaitharivoli/dps-safety-hub/blob/main/app.js): `app.js`
- [Role dashboards](https://github.com/advaitharivoli/dps-safety-hub/blob/main/index.html): `index.html`
- [Responsive styling](https://github.com/advaitharivoli/dps-safety-hub/blob/main/style.css): `style.css`

### Other components

- **Student reporter**
- **School staff**

## Connections

- Student reporter → Incident reporting: submits report (evidence: `README.md`)
- Incident reporting → Admission lookup: looks up student (evidence: `README.md`)
- Incident reporting → Incident capture: documents incident (evidence: `README.md`)
- Incident capture → Incident registry: creates case (evidence: `app.js`)
- School staff → Role sign-in: signs in (evidence: `app.js`)
- Role sign-in → Role dashboards: switches role view (evidence: `app.js`)
- Incident registry → Teacher triage: feeds review (evidence: `README.md`)
- Teacher triage → Senior Mistress: escalates cases (evidence: `README.md`)
- Senior Mistress → Head Mistress: escalates cases (evidence: `README.md`)
- Head Mistress → Vice Principal: escalates cases (evidence: `README.md`)
- Vice Principal → Principal decisions: escalates cases (evidence: `README.md`)
- School staff → Case escalation: escalates case (evidence: `README.md`)
- Case escalation → Incident registry: updates case (evidence: `README.md`)
- School staff → Case resolution: records outcome (evidence: `README.md`)
- Case resolution → Incident registry: updates status (evidence: `app.js`)
- Incident registry → School-wide statistics: supplies case data (evidence: `README.md`)
- Incident capture → Mock CCTV evidence: links by location (evidence: `README.md`)
- Role dashboards → Responsive styling: styled by (evidence: `README.md`)
