# nithish-alt/superman architecture

> Architecture diagram of the GitHub repository nithish-alt/superman, 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/nithish-alt/superman
- Repository: https://github.com/nithish-alt/superman

## Overview

This is a React-based school emergency-preparedness and response dashboard. Users navigate role-aware views to monitor disasters, manage campus evacuation plans, track students and staff, issue SOS requests and alerts, and coordinate through messaging. The app routes these views through shared in-memory context state populated with demo data; map configuration supports campus exits, assembly points, and unsafe zones. The sampled code confirms app routing and map/context behavior, but most page implementations and external-service integrations were not inspected, so their internal connections are omitted.

Main entry points: [`src/App.tsx`](https://github.com/nithish-alt/superman/blob/main/src/App.tsx) (App router), [`src/context/AppContext.tsx`](https://github.com/nithish-alt/superman/blob/main/src/context/AppContext.tsx) (Shared emergency state), [`src/pages/SchoolMapPage.tsx`](https://github.com/nithish-alt/superman/blob/main/src/pages/SchoolMapPage.tsx) (Campus map management), [`src/components/map/InteractiveCampusMap.tsx`](https://github.com/nithish-alt/superman/blob/main/src/components/map/InteractiveCampusMap.tsx) (Interactive campus map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_app["App router<br/>[App.tsx]"]
  node_topnav["Top navigation<br/>[TopNavigation.tsx]"]
  node_sidebar["Sidebar navigation<br/>[Sidebar.tsx]"]
end

subgraph group_response["Campus response"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_schoolmap["Campus map management<br/>[SchoolMapPage.tsx]"]
  node_interactive_map["Interactive campus map"]
  node_evacuation["Evacuation planning<br/>[EvacuationPage.tsx]"]
  node_evac_report["Evacuation reporting"]
  node_sos["SOS requests<br/>[SosPage.tsx]"]
  node_student_tracking["Student tracking"]
  node_teacher_tracking["Teacher tracking"]
  node_alerts["Alert management"]
end

subgraph group_monitoring["Disaster monitoring"]
  node_disaster_monitoring["Disaster monitoring"]
  node_india_info["India disaster information"]
  node_disaster_news["Disaster news"]
  node_safety_guides["Safety guides"]
end

subgraph group_coordination["Communications and settings"]
  node_messaging["Emergency messaging<br/>[MessagingPage.tsx]"]
  node_settings["Settings<br/>[SettingsPage.tsx]"]
  node_profile["User profile<br/>[ProfilePage.tsx]"]
  node_role_switcher["Role switcher"]
end

subgraph group_state["Shared state and data"]
  node_app_context["Shared emergency state<br/>[AppContext.tsx]"]
  node_mock_data["Demo records<br/>[mockData.ts]"]
  node_domain_types["Domain types<br/>[index.ts]"]
end

node_app -->|"provides state"| node_app_context
node_app -->|"renders"| node_topnav
node_app -->|"renders"| node_sidebar
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_schoolmap
node_app -->|"routes to"| node_evacuation
node_app -->|"routes to"| node_sos
node_app -->|"routes to"| node_alerts
node_app -->|"routes to"| node_student_tracking
node_app -->|"routes to"| node_teacher_tracking
node_app -->|"routes to"| node_disaster_monitoring
node_app -->|"routes to"| node_india_info
node_app -->|"routes to"| node_disaster_news
node_app -->|"routes to"| node_messaging
node_app -->|"routes to"| node_safety_guides
node_app -->|"routes to"| node_settings
node_app -->|"routes to"| node_profile
node_schoolmap -->|"renders"| node_interactive_map
node_schoolmap -->|"updates map state"| node_app_context
node_schoolmap -->|"reads default image"| node_mock_data
node_interactive_map -->|"uses shared actions"| node_app_context
node_app_context -->|"loads initial records"| node_mock_data
node_app_context -->|"uses types"| node_domain_types
node_interactive_map -->|"uses types"| node_domain_types

click node_app "https://github.com/nithish-alt/superman/blob/main/src/App.tsx"
click node_topnav "https://github.com/nithish-alt/superman/blob/main/src/components/layout/TopNavigation.tsx"
click node_sidebar "https://github.com/nithish-alt/superman/blob/main/src/components/layout/Sidebar.tsx"
click node_dashboard "https://github.com/nithish-alt/superman/blob/main/src/pages/DashboardPage.tsx"
click node_schoolmap "https://github.com/nithish-alt/superman/blob/main/src/pages/SchoolMapPage.tsx"
click node_interactive_map "https://github.com/nithish-alt/superman/blob/main/src/components/map/InteractiveCampusMap.tsx"
click node_evacuation "https://github.com/nithish-alt/superman/blob/main/src/pages/EvacuationPage.tsx"
click node_evac_report "https://github.com/nithish-alt/superman/blob/main/src/components/evacuation/EvacuationReportModal.tsx"
click node_sos "https://github.com/nithish-alt/superman/blob/main/src/pages/SosPage.tsx"
click node_student_tracking "https://github.com/nithish-alt/superman/blob/main/src/pages/StudentTrackingPage.tsx"
click node_teacher_tracking "https://github.com/nithish-alt/superman/blob/main/src/pages/TeacherTrackingPage.tsx"
click node_alerts "https://github.com/nithish-alt/superman/blob/main/src/pages/AlertManagementPage.tsx"
click node_disaster_monitoring "https://github.com/nithish-alt/superman/blob/main/src/pages/DisasterMonitoringPage.tsx"
click node_india_info "https://github.com/nithish-alt/superman/blob/main/src/pages/IndiaDisasterInfoPage.tsx"
click node_disaster_news "https://github.com/nithish-alt/superman/blob/main/src/pages/DisasterNewsPage.tsx"
click node_safety_guides "https://github.com/nithish-alt/superman/blob/main/src/pages/DisasterSafetyGuidesPage.tsx"
click node_messaging "https://github.com/nithish-alt/superman/blob/main/src/pages/MessagingPage.tsx"
click node_settings "https://github.com/nithish-alt/superman/blob/main/src/pages/SettingsPage.tsx"
click node_profile "https://github.com/nithish-alt/superman/blob/main/src/pages/ProfilePage.tsx"
click node_role_switcher "https://github.com/nithish-alt/superman/blob/main/src/components/common/RoleSwitcherModal.tsx"
click node_app_context "https://github.com/nithish-alt/superman/blob/main/src/context/AppContext.tsx"
click node_mock_data "https://github.com/nithish-alt/superman/blob/main/src/data/mockData.ts"
click node_domain_types "https://github.com/nithish-alt/superman/blob/main/src/types/index.ts"

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_app,node_topnav,node_sidebar toneBlue
class node_dashboard,node_schoolmap,node_interactive_map,node_evacuation,node_evac_report,node_sos,node_student_tracking,node_teacher_tracking,node_alerts toneAmber
class node_disaster_monitoring,node_india_info,node_disaster_news,node_safety_guides toneMint
class node_messaging,node_settings,node_profile,node_role_switcher toneRose
class node_app_context,node_mock_data,node_domain_types toneIndigo
```

## Components

### Application shell

- [App router](https://github.com/nithish-alt/superman/blob/main/src/App.tsx): `src/App.tsx`
- [Top navigation](https://github.com/nithish-alt/superman/blob/main/src/components/layout/TopNavigation.tsx): `src/components/layout/TopNavigation.tsx`
- [Sidebar navigation](https://github.com/nithish-alt/superman/blob/main/src/components/layout/Sidebar.tsx): `src/components/layout/Sidebar.tsx`

### Campus response

- [Dashboard](https://github.com/nithish-alt/superman/blob/main/src/pages/DashboardPage.tsx): `src/pages/DashboardPage.tsx`
- [Campus map management](https://github.com/nithish-alt/superman/blob/main/src/pages/SchoolMapPage.tsx): `src/pages/SchoolMapPage.tsx`
- [Interactive campus map](https://github.com/nithish-alt/superman/blob/main/src/components/map/InteractiveCampusMap.tsx): `src/components/map/InteractiveCampusMap.tsx`
- [Evacuation planning](https://github.com/nithish-alt/superman/blob/main/src/pages/EvacuationPage.tsx): `src/pages/EvacuationPage.tsx`
- [Evacuation reporting](https://github.com/nithish-alt/superman/blob/main/src/components/evacuation/EvacuationReportModal.tsx): `src/components/evacuation/EvacuationReportModal.tsx`
- [SOS requests](https://github.com/nithish-alt/superman/blob/main/src/pages/SosPage.tsx): `src/pages/SosPage.tsx`
- [Student tracking](https://github.com/nithish-alt/superman/blob/main/src/pages/StudentTrackingPage.tsx): `src/pages/StudentTrackingPage.tsx`
- [Teacher tracking](https://github.com/nithish-alt/superman/blob/main/src/pages/TeacherTrackingPage.tsx): `src/pages/TeacherTrackingPage.tsx`
- [Alert management](https://github.com/nithish-alt/superman/blob/main/src/pages/AlertManagementPage.tsx): `src/pages/AlertManagementPage.tsx`

### Disaster monitoring

- [Disaster monitoring](https://github.com/nithish-alt/superman/blob/main/src/pages/DisasterMonitoringPage.tsx): `src/pages/DisasterMonitoringPage.tsx`
- [India disaster information](https://github.com/nithish-alt/superman/blob/main/src/pages/IndiaDisasterInfoPage.tsx): `src/pages/IndiaDisasterInfoPage.tsx`
- [Disaster news](https://github.com/nithish-alt/superman/blob/main/src/pages/DisasterNewsPage.tsx): `src/pages/DisasterNewsPage.tsx`
- [Safety guides](https://github.com/nithish-alt/superman/blob/main/src/pages/DisasterSafetyGuidesPage.tsx): `src/pages/DisasterSafetyGuidesPage.tsx`

### Communications and settings

- [Emergency messaging](https://github.com/nithish-alt/superman/blob/main/src/pages/MessagingPage.tsx): `src/pages/MessagingPage.tsx`
- [Settings](https://github.com/nithish-alt/superman/blob/main/src/pages/SettingsPage.tsx): `src/pages/SettingsPage.tsx`
- [User profile](https://github.com/nithish-alt/superman/blob/main/src/pages/ProfilePage.tsx): `src/pages/ProfilePage.tsx`
- [Role switcher](https://github.com/nithish-alt/superman/blob/main/src/components/common/RoleSwitcherModal.tsx): `src/components/common/RoleSwitcherModal.tsx`

### Shared state and data

- [Shared emergency state](https://github.com/nithish-alt/superman/blob/main/src/context/AppContext.tsx): `src/context/AppContext.tsx`
- [Demo records](https://github.com/nithish-alt/superman/blob/main/src/data/mockData.ts): `src/data/mockData.ts`
- [Domain types](https://github.com/nithish-alt/superman/blob/main/src/types/index.ts): `src/types/index.ts`

## Connections

- App router → Shared emergency state: provides state (evidence: `src/App.tsx`)
- App router → Top navigation: renders (evidence: `src/App.tsx`)
- App router → Sidebar navigation: renders (evidence: `src/App.tsx`)
- App router → Dashboard: routes to (evidence: `src/App.tsx`)
- App router → Campus map management: routes to (evidence: `src/App.tsx`)
- App router → Evacuation planning: routes to (evidence: `src/App.tsx`)
- App router → SOS requests: routes to (evidence: `src/App.tsx`)
- App router → Alert management: routes to (evidence: `src/App.tsx`)
- App router → Student tracking: routes to (evidence: `src/App.tsx`)
- App router → Teacher tracking: routes to (evidence: `src/App.tsx`)
- App router → Disaster monitoring: routes to (evidence: `src/App.tsx`)
- App router → India disaster information: routes to (evidence: `src/App.tsx`)
- App router → Disaster news: routes to (evidence: `src/App.tsx`)
- App router → Emergency messaging: routes to (evidence: `src/App.tsx`)
- App router → Safety guides: routes to (evidence: `src/App.tsx`)
- App router → Settings: routes to (evidence: `src/App.tsx`)
- App router → User profile: routes to (evidence: `src/App.tsx`)
- Campus map management → Interactive campus map: renders (evidence: `src/pages/SchoolMapPage.tsx`)
- Campus map management → Shared emergency state: updates map state (evidence: `src/pages/SchoolMapPage.tsx`)
- Campus map management → Demo records: reads default image (evidence: `src/pages/SchoolMapPage.tsx`)
- Interactive campus map → Shared emergency state: uses shared actions (evidence: `src/components/map/InteractiveCampusMap.tsx`)
- Shared emergency state → Demo records: loads initial records (evidence: `src/context/AppContext.tsx`)
- Shared emergency state → Domain types: uses types (evidence: `src/context/AppContext.tsx`)
- Interactive campus map → Domain types: uses types (evidence: `src/components/map/InteractiveCampusMap.tsx`)
