# shaun520/school-vista-3d architecture

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

- Interactive diagram: https://gitdiagram.com/shaun520/school-vista-3d
- Repository: https://github.com/shaun520/school-vista-3d

## Overview

School Vista 3D is a browser-based smart-campus digital twin. A user explores the campus through the HUD, selects a POI or building, and can enter a classroom for interior views, device controls, class information, and simulated monitoring. The campus scene composes exterior geometry, models, POIs, and camera behavior; a shared Zustand store coordinates modes and selections. Resolution-aware rendering and chart infrastructure support the large-screen HUD. The README documents several panel capabilities whose internal implementations are not fully sampled, so their wiring is shown only where supported.

Main entry points: [`src/scene/CampusScene.tsx`](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/CampusScene.tsx) (Scene composer), [`src/App.tsx`](https://github.com/shaun520/school-vista-3d/blob/main/src/App.tsx) (Application shell), [`src/ui/RightPanelHost.tsx`](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/RightPanelHost.tsx) (Panel host), [`src/store/useCampusStore.ts`](https://github.com/shaun520/school-vista-3d/blob/main/src/store/useCampusStore.ts) (Campus state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Campus experience"]
  node_app["Application shell<br/>[App.tsx]"]
  node_campus_hud["Campus navigation HUD<br/>[LeftDock.tsx]"]
  node_float_cards["Campus controls<br/>[FloatCards.tsx]"]
  node_poi_card["POI detail card<br/>[PoiCard.tsx]"]
end

subgraph group_scene["3D scene"]
  node_scene_composer["Scene composer<br/>[CampusScene.tsx]"]
  node_camera["Camera rig<br/>[CameraRig.tsx]"]
  node_model_loader["Campus model loader<br/>[ModelLayer.tsx]"]
  node_campus_ground["Ground and greenery<br/>[GroundLayer.tsx]"]
  node_greenery["Greenery geometry<br/>[GreeneryLayer.tsx]"]
  node_playground["Playground geometry"]
  node_placeholders["Placeholder buildings"]
  node_water["Water features<br/>[WaterLayer.tsx]"]
  node_poi_scene["POI markers<br/>[PoiLayer.tsx]"]
end

subgraph group_classroom["Classroom mode"]
  node_classroom_scene["Classroom interior<br/>[ClassroomLayer.tsx]"]
  node_classroom_data["Classroom demo data<br/>[classroom.ts]"]
  node_classroom_hud["Classroom HUD<br/>[ClassroomHud.tsx]"]
  node_classroom_console["Classroom console"]
  node_classroom_info["Class overview"]
  node_classroom_monitor["Simulated monitors"]
  node_lighting["Classroom lighting"]
end

subgraph group_panels["HUD and analytics"]
  node_panel_host["Panel host<br/>[RightPanelHost.tsx]"]
  node_security_panel["Security analytics<br/>[SecurityPanel.tsx]"]
  node_student_panel["Student panel<br/>[StudentPanel.tsx]"]
  node_source_panel["Enrollment panel<br/>[SourcePanel.tsx]"]
  node_video_panel["Video panel<br/>[VideoPanel.tsx]"]
  node_ai_panel["AI assistant panel<br/>[AiPanel.tsx]"]
  node_chart["ECharts integration<br/>[useEChart.ts]"]
end

subgraph group_platform["Shared runtime"]
  node_campus_state["Campus state<br/>[useCampusStore.ts]"]
  node_layout_data["Campus layout data<br/>[layout.ts]"]
  node_resolution["Resolution profiles<br/>[resolution.ts]"]
  node_viewport["Viewport service<br/>[viewport.ts]"]
end

node_user(("Campus operator"))

node_user -->|"uses"| node_app
node_app -->|"mounts"| node_scene_composer
node_app -->|"reads mode"| node_campus_state
node_app -->|"renders"| node_campus_hud
node_app -->|"renders"| node_float_cards
node_app -->|"renders"| node_poi_card
node_app -->|"renders"| node_panel_host
node_app -->|"renders"| node_classroom_hud
node_scene_composer -->|"reads layout"| node_layout_data
node_scene_composer -->|"configures render"| node_resolution
node_scene_composer -->|"reads state"| node_campus_state
node_scene_composer -->|"renders"| node_camera
node_scene_composer -->|"renders"| node_model_loader
node_scene_composer -->|"renders"| node_campus_ground
node_scene_composer -->|"renders"| node_greenery
node_scene_composer -->|"renders"| node_playground
node_scene_composer -->|"renders"| node_placeholders
node_scene_composer -->|"renders"| node_water
node_scene_composer -->|"renders"| node_poi_scene
node_scene_composer -->|"renders"| node_classroom_scene
node_campus_hud -->|"updates"| node_campus_state
node_float_cards -->|"updates"| node_campus_state
node_float_cards -->|"reads places"| node_layout_data
node_poi_card -->|"updates"| node_campus_state
node_poi_card -->|"reads POIs"| node_layout_data
node_panel_host -->|"reads selection"| node_campus_state
node_panel_host -->|"selects panel"| node_security_panel
node_panel_host -->|"selects panel"| node_student_panel
node_panel_host -->|"selects panel"| node_source_panel
node_panel_host -->|"selects panel"| node_video_panel
node_panel_host -->|"selects panel"| node_ai_panel
node_security_panel -->|"renders charts"| node_chart
node_classroom_hud -->|"reads details"| node_classroom_data
node_classroom_hud -->|"renders"| node_classroom_console
node_classroom_hud -->|"renders"| node_classroom_info
node_classroom_console -->|"reads controls"| node_classroom_data
node_classroom_console -->|"renders feeds"| node_classroom_monitor
node_classroom_console -->|"updates"| node_campus_state
node_classroom_console -->|"uses lighting"| node_lighting
node_classroom_monitor -->|"reads feeds"| node_classroom_data
node_classroom_monitor -->|"reads time"| node_campus_state
node_classroom_monitor -->|"reads light state"| node_lighting
node_viewport -->|"uses profiles"| node_resolution
node_chart -->|"subscribes"| node_viewport

click node_app "https://github.com/shaun520/school-vista-3d/blob/main/src/App.tsx"
click node_campus_state "https://github.com/shaun520/school-vista-3d/blob/main/src/store/useCampusStore.ts"
click node_scene_composer "https://github.com/shaun520/school-vista-3d/blob/main/src/scene/CampusScene.tsx"
click node_layout_data "https://github.com/shaun520/school-vista-3d/blob/main/src/data/layout.ts"
click node_resolution "https://github.com/shaun520/school-vista-3d/blob/main/src/config/resolution.ts"
click node_viewport "https://github.com/shaun520/school-vista-3d/blob/main/src/utils/viewport.ts"
click node_camera "https://github.com/shaun520/school-vista-3d/blob/main/src/scene/CameraRig.tsx"
click node_model_loader "https://github.com/shaun520/school-vista-3d/blob/main/src/scene/ModelLayer.tsx"
click node_campus_ground "https://github.com/shaun520/school-vista-3d/blob/main/src/scene/GroundLayer.tsx"
click node_greenery "https://github.com/shaun520/school-vista-3d/blob/main/src/scene/GreeneryLayer.tsx"
click node_playground "https://github.com/shaun520/school-vista-3d/blob/main/src/scene/PlaygroundLayer.tsx"
click node_placeholders "https://github.com/shaun520/school-vista-3d/blob/main/src/scene/PlaceholderLayer.tsx"
click node_water "https://github.com/shaun520/school-vista-3d/blob/main/src/scene/WaterLayer.tsx"
click node_poi_scene "https://github.com/shaun520/school-vista-3d/blob/main/src/scene/PoiLayer.tsx"
click node_classroom_scene "https://github.com/shaun520/school-vista-3d/blob/main/src/scene/ClassroomLayer.tsx"
click node_classroom_data "https://github.com/shaun520/school-vista-3d/blob/main/src/data/classroom.ts"
click node_classroom_hud "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/ClassroomHud.tsx"
click node_classroom_console "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/ClassroomConsole.tsx"
click node_classroom_info "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/ClassroomInfoPanel.tsx"
click node_classroom_monitor "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/ClassroomMonitor.tsx"
click node_lighting "https://github.com/shaun520/school-vista-3d/blob/main/src/scene/classroomLighting.ts"
click node_campus_hud "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/LeftDock.tsx"
click node_float_cards "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/FloatCards.tsx"
click node_poi_card "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/PoiCard.tsx"
click node_panel_host "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/RightPanelHost.tsx"
click node_security_panel "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/panels/SecurityPanel.tsx"
click node_student_panel "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/panels/StudentPanel.tsx"
click node_source_panel "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/panels/SourcePanel.tsx"
click node_video_panel "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/panels/VideoPanel.tsx"
click node_ai_panel "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/panels/AiPanel.tsx"
click node_chart "https://github.com/shaun520/school-vista-3d/blob/main/src/ui/charts/useEChart.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_campus_hud,node_float_cards,node_poi_card toneBlue
class node_scene_composer,node_camera,node_model_loader,node_campus_ground,node_greenery,node_playground,node_placeholders,node_water,node_poi_scene toneAmber
class node_classroom_scene,node_classroom_data,node_classroom_hud,node_classroom_console,node_classroom_info,node_classroom_monitor,node_lighting toneMint
class node_panel_host,node_security_panel,node_student_panel,node_source_panel,node_video_panel,node_ai_panel,node_chart toneRose
class node_campus_state,node_layout_data,node_resolution,node_viewport,node_user toneIndigo
```

## Components

### Campus experience

- [Application shell](https://github.com/shaun520/school-vista-3d/blob/main/src/App.tsx): `src/App.tsx`
- [Campus navigation HUD](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/LeftDock.tsx): `src/ui/LeftDock.tsx`
- [Campus controls](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/FloatCards.tsx): `src/ui/FloatCards.tsx`
- [POI detail card](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/PoiCard.tsx): `src/ui/PoiCard.tsx`

### 3D scene

- [Scene composer](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/CampusScene.tsx): `src/scene/CampusScene.tsx`
- [Camera rig](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/CameraRig.tsx): `src/scene/CameraRig.tsx`
- [Campus model loader](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/ModelLayer.tsx): `src/scene/ModelLayer.tsx`
- [Ground and greenery](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/GroundLayer.tsx): `src/scene/GroundLayer.tsx`
- [Greenery geometry](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/GreeneryLayer.tsx): `src/scene/GreeneryLayer.tsx`
- [Playground geometry](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/PlaygroundLayer.tsx): `src/scene/PlaygroundLayer.tsx`
- [Placeholder buildings](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/PlaceholderLayer.tsx): `src/scene/PlaceholderLayer.tsx`
- [Water features](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/WaterLayer.tsx): `src/scene/WaterLayer.tsx`
- [POI markers](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/PoiLayer.tsx): `src/scene/PoiLayer.tsx`

### Classroom mode

- [Classroom interior](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/ClassroomLayer.tsx): `src/scene/ClassroomLayer.tsx`
- [Classroom demo data](https://github.com/shaun520/school-vista-3d/blob/main/src/data/classroom.ts): `src/data/classroom.ts`
- [Classroom HUD](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/ClassroomHud.tsx): `src/ui/ClassroomHud.tsx`
- [Classroom console](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/ClassroomConsole.tsx): `src/ui/ClassroomConsole.tsx`
- [Class overview](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/ClassroomInfoPanel.tsx): `src/ui/ClassroomInfoPanel.tsx`
- [Simulated monitors](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/ClassroomMonitor.tsx): `src/ui/ClassroomMonitor.tsx`
- [Classroom lighting](https://github.com/shaun520/school-vista-3d/blob/main/src/scene/classroomLighting.ts): `src/scene/classroomLighting.ts`

### HUD and analytics

- [Panel host](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/RightPanelHost.tsx): `src/ui/RightPanelHost.tsx`
- [Security analytics](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/panels/SecurityPanel.tsx): `src/ui/panels/SecurityPanel.tsx`
- [Student panel](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/panels/StudentPanel.tsx): `src/ui/panels/StudentPanel.tsx`
- [Enrollment panel](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/panels/SourcePanel.tsx): `src/ui/panels/SourcePanel.tsx`
- [Video panel](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/panels/VideoPanel.tsx): `src/ui/panels/VideoPanel.tsx`
- [AI assistant panel](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/panels/AiPanel.tsx): `src/ui/panels/AiPanel.tsx`
- [ECharts integration](https://github.com/shaun520/school-vista-3d/blob/main/src/ui/charts/useEChart.ts): `src/ui/charts/useEChart.ts`

### Shared runtime

- [Campus state](https://github.com/shaun520/school-vista-3d/blob/main/src/store/useCampusStore.ts): `src/store/useCampusStore.ts`
- [Campus layout data](https://github.com/shaun520/school-vista-3d/blob/main/src/data/layout.ts): `src/data/layout.ts`
- [Resolution profiles](https://github.com/shaun520/school-vista-3d/blob/main/src/config/resolution.ts): `src/config/resolution.ts`
- [Viewport service](https://github.com/shaun520/school-vista-3d/blob/main/src/utils/viewport.ts): `src/utils/viewport.ts`

### Other components

- **Campus operator**

## Connections

- Campus operator → Application shell: uses (evidence: `README.md`)
- Application shell → Scene composer: mounts (evidence: `src/App.tsx`)
- Application shell → Campus state: reads mode (evidence: `src/App.tsx`)
- Application shell → Campus navigation HUD: renders (evidence: `src/App.tsx`)
- Application shell → Campus controls: renders (evidence: `src/App.tsx`)
- Application shell → POI detail card: renders (evidence: `src/App.tsx`)
- Application shell → Panel host: renders (evidence: `src/App.tsx`)
- Application shell → Classroom HUD: renders (evidence: `src/App.tsx`)
- Scene composer → Campus layout data: reads layout (evidence: `src/scene/CampusScene.tsx`)
- Scene composer → Resolution profiles: configures render (evidence: `src/scene/CampusScene.tsx`)
- Scene composer → Campus state: reads state (evidence: `src/scene/CampusScene.tsx`)
- Scene composer → Camera rig: renders (evidence: `src/scene/CampusScene.tsx`)
- Scene composer → Campus model loader: renders (evidence: `src/scene/CampusScene.tsx`)
- Scene composer → Ground and greenery: renders (evidence: `src/scene/CampusScene.tsx`)
- Scene composer → Greenery geometry: renders (evidence: `src/scene/CampusScene.tsx`)
- Scene composer → Playground geometry: renders (evidence: `src/scene/CampusScene.tsx`)
- Scene composer → Placeholder buildings: renders (evidence: `src/scene/CampusScene.tsx`)
- Scene composer → Water features: renders (evidence: `src/scene/CampusScene.tsx`)
- Scene composer → POI markers: renders (evidence: `src/scene/CampusScene.tsx`)
- Scene composer → Classroom interior: renders (evidence: `src/scene/CampusScene.tsx`)
- Campus navigation HUD → Campus state: updates (evidence: `src/ui/LeftDock.tsx`)
- Campus controls → Campus state: updates (evidence: `src/ui/FloatCards.tsx`)
- Campus controls → Campus layout data: reads places (evidence: `src/ui/FloatCards.tsx`)
- POI detail card → Campus state: updates (evidence: `src/ui/PoiCard.tsx`)
- POI detail card → Campus layout data: reads POIs (evidence: `src/ui/PoiCard.tsx`)
- Panel host → Campus state: reads selection (evidence: `src/ui/RightPanelHost.tsx`)
- Panel host → Security analytics: selects panel (evidence: `src/ui/RightPanelHost.tsx`)
- Panel host → Student panel: selects panel (evidence: `src/ui/RightPanelHost.tsx`)
- Panel host → Enrollment panel: selects panel (evidence: `src/ui/RightPanelHost.tsx`)
- Panel host → Video panel: selects panel (evidence: `src/ui/RightPanelHost.tsx`)
- Panel host → AI assistant panel: selects panel (evidence: `src/ui/RightPanelHost.tsx`)
- Security analytics → ECharts integration: renders charts (evidence: `src/ui/panels/SecurityPanel.tsx`)
- Classroom HUD → Classroom demo data: reads details (evidence: `src/ui/ClassroomHud.tsx`)
- Classroom HUD → Classroom console: renders (evidence: `src/ui/ClassroomHud.tsx`)
- Classroom HUD → Class overview: renders (evidence: `src/ui/ClassroomHud.tsx`)
- Classroom console → Classroom demo data: reads controls (evidence: `src/ui/ClassroomConsole.tsx`)
- Classroom console → Simulated monitors: renders feeds (evidence: `src/ui/ClassroomConsole.tsx`)
- Classroom console → Campus state: updates (evidence: `src/ui/ClassroomConsole.tsx`)
- Classroom console → Classroom lighting: uses lighting (evidence: `src/ui/ClassroomConsole.tsx`)
- Simulated monitors → Classroom demo data: reads feeds (evidence: `src/ui/ClassroomMonitor.tsx`)
- Simulated monitors → Campus state: reads time (evidence: `src/ui/ClassroomMonitor.tsx`)
- Simulated monitors → Classroom lighting: reads light state (evidence: `src/ui/ClassroomMonitor.tsx`)
- Viewport service → Resolution profiles: uses profiles (evidence: `src/utils/viewport.ts`)
- ECharts integration → Viewport service: subscribes (evidence: `src/ui/charts/useEChart.ts`)
