# teafany/knight-hacks-ix architecture

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

- Interactive diagram: https://gitdiagram.com/teafany/knight-hacks-ix
- Repository: https://github.com/teafany/knight-hacks-ix

## Overview

Spotlight turns facility-inspection data into operator-facing summaries, mission comparisons, dataset exploration, 3D spatial evidence, and replay. The main workflow is an operator entering the React workspace, choosing a view and demo or Django-backed data, then inspecting findings or spatial context; saved model outputs and optional inference APIs extend that workflow. Django exposes records, analytics, and inference over PostgreSQL, while a separate LiDAR pipeline prepares spatial changes. The graph follows documented capabilities and indexed references; some runtime wiring is unsampled.

Main entry points: [`frontend/src/App.tsx`](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/App.tsx) (Workspace routing), [`server/api`](https://github.com/teafany/knight-hacks-ix/tree/main/server/api) (Inspection API), [`server/api/models.py`](https://github.com/teafany/knight-hacks-ix/blob/main/server/api/models.py) (Inspection records), [`frontend/src/SummaryPage.tsx`](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/SummaryPage.tsx) (Inspection summary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Operator workspace"]
  node_app["Workspace routing<br/>[App.tsx]"]
  node_sidebar["Workspace navigation"]
  node_summary["Inspection summary<br/>[SummaryPage.tsx]"]
  node_overview["Summary overview"]
  node_summaryviews["Summary selection<br/>[summaryViews.ts]"]
  node_dashboard["Mission dashboard<br/>[Dashboard.tsx]"]
  node_dataset["Dataset explorer"]
  node_replay["Mission replay<br/>[RelayPage.tsx]"]
  node_api_client["Dashboard API client<br/>[api.ts]"]
  node_api_config["API configuration<br/>[apiConfig.ts]"]
end

subgraph group_spatial["Spatial inspection"]
  node_facility["3D facility viewer<br/>[FacilityViewer.tsx]"]
  node_lidar_pipeline["LiDAR change pipeline"]
end

subgraph group_backend["Inspection services"]
  node_django["Inspection API"]
  node_inference_views["Inference endpoints<br/>[inference_views.py]"]
  node_inference_validation["Inference validation"]
  node_inference_engine["Model inference<br/>[inference.py]"]
  node_analytics["Inspection analytics<br/>[analytics.py]"]
  node_records_service["Record validation<br/>[records.py]"]
end

subgraph group_storage["Records and models"]
  node_models[("Inspection records<br/>[models.py]")]
  node_database_config["Database connection<br/>[database.py]"]
  node_importer["Challenge data import"]
  node_simulated_results["Simulated inference seed"]
end

node_operator(("Operator"))

node_operator -->|"opens workspace"| node_app
node_app -->|"routes to"| node_summary
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_dataset
node_app -->|"routes to"| node_replay
node_app -->|"renders"| node_sidebar
node_summary -->|"renders"| node_overview
node_summary -->|"reads selection"| node_summaryviews
node_dashboard -->|"requests data"| node_api_client
node_dashboard -->|"renders"| node_facility
node_dataset -->|"configures source"| node_api_config
node_summary -->|"loads summary data"| node_api_client
node_api_client -.->|"requests records"| node_django
node_api_config -.->|"selects API mode"| node_django
node_django -.->|"serves analytics"| node_analytics
node_django -.->|"validates records"| node_records_service
node_inference_views -->|"validates uploads"| node_inference_validation
node_inference_views -->|"runs inference"| node_inference_engine
node_inference_engine -.->|"saves results"| node_models
node_records_service -->|"checks relationships"| node_models
node_importer -.->|"validates imports"| node_records_service
node_importer -->|"loads records"| node_models
node_simulated_results -->|"creates examples"| node_models
node_database_config -.->|"configures store"| node_models
node_lidar_pipeline -.->|"provides spatial changes"| node_facility
node_replay -.->|"loads mission events"| node_django

click node_app "https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/App.tsx"
click node_sidebar "https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/WorkspaceSidebar.tsx"
click node_summary "https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/SummaryPage.tsx"
click node_overview "https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/SummaryOverview.tsx"
click node_summaryviews "https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/summaryViews.ts"
click node_dashboard "https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/Dashboard.tsx"
click node_dataset "https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/DatasetDashboard.tsx"
click node_replay "https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/RelayPage.tsx"
click node_api_client "https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/api.ts"
click node_api_config "https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/apiConfig.ts"
click node_facility "https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/components/FacilityViewer.tsx"
click node_lidar_pipeline "https://github.com/teafany/knight-hacks-ix/tree/main/spot-lidar"
click node_django "https://github.com/teafany/knight-hacks-ix/tree/main/server/api"
click node_inference_views "https://github.com/teafany/knight-hacks-ix/blob/main/server/api/inference_views.py"
click node_inference_validation "https://github.com/teafany/knight-hacks-ix/blob/main/server/api/inference_serializers.py"
click node_inference_engine "https://github.com/teafany/knight-hacks-ix/blob/main/server/api/services/inference.py"
click node_analytics "https://github.com/teafany/knight-hacks-ix/blob/main/server/api/services/analytics.py"
click node_records_service "https://github.com/teafany/knight-hacks-ix/blob/main/server/api/services/records.py"
click node_models "https://github.com/teafany/knight-hacks-ix/blob/main/server/api/models.py"
click node_database_config "https://github.com/teafany/knight-hacks-ix/blob/main/server/config/database.py"
click node_importer "https://github.com/teafany/knight-hacks-ix/blob/main/server/api/management/commands/import_challenge_data.py"
click node_simulated_results "https://github.com/teafany/knight-hacks-ix/blob/main/server/api/management/commands/seed_simulated_inference.py"

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_sidebar,node_summary,node_overview,node_summaryviews,node_dashboard,node_dataset,node_replay,node_api_client,node_api_config toneBlue
class node_facility,node_lidar_pipeline toneAmber
class node_django,node_inference_views,node_inference_validation,node_inference_engine,node_analytics,node_records_service toneMint
class node_models,node_database_config,node_importer,node_simulated_results toneRose
class node_operator toneIndigo
```

## Components

### Operator workspace

- [Workspace routing](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Workspace navigation](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/WorkspaceSidebar.tsx): `frontend/src/WorkspaceSidebar.tsx`
- [Inspection summary](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/SummaryPage.tsx): `frontend/src/SummaryPage.tsx`
- [Summary overview](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/SummaryOverview.tsx): `frontend/src/SummaryOverview.tsx`
- [Summary selection](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/summaryViews.ts): `frontend/src/summaryViews.ts`
- [Mission dashboard](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/Dashboard.tsx): `frontend/src/Dashboard.tsx`
- [Dataset explorer](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/DatasetDashboard.tsx): `frontend/src/DatasetDashboard.tsx`
- [Mission replay](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/RelayPage.tsx): `frontend/src/RelayPage.tsx`
- [Dashboard API client](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/api.ts): `frontend/src/api.ts`
- [API configuration](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/apiConfig.ts): `frontend/src/apiConfig.ts`

### Spatial inspection

- [3D facility viewer](https://github.com/teafany/knight-hacks-ix/blob/main/frontend/src/components/FacilityViewer.tsx): `frontend/src/components/FacilityViewer.tsx`
- [LiDAR change pipeline](https://github.com/teafany/knight-hacks-ix/tree/main/spot-lidar): `spot-lidar`

### Inspection services

- [Inspection API](https://github.com/teafany/knight-hacks-ix/tree/main/server/api): `server/api`
- [Inference endpoints](https://github.com/teafany/knight-hacks-ix/blob/main/server/api/inference_views.py): `server/api/inference_views.py`
- [Inference validation](https://github.com/teafany/knight-hacks-ix/blob/main/server/api/inference_serializers.py): `server/api/inference_serializers.py`
- [Model inference](https://github.com/teafany/knight-hacks-ix/blob/main/server/api/services/inference.py): `server/api/services/inference.py`
- [Inspection analytics](https://github.com/teafany/knight-hacks-ix/blob/main/server/api/services/analytics.py): `server/api/services/analytics.py`
- [Record validation](https://github.com/teafany/knight-hacks-ix/blob/main/server/api/services/records.py): `server/api/services/records.py`

### Records and models

- [Inspection records](https://github.com/teafany/knight-hacks-ix/blob/main/server/api/models.py): `server/api/models.py`
- [Database connection](https://github.com/teafany/knight-hacks-ix/blob/main/server/config/database.py): `server/config/database.py`
- [Challenge data import](https://github.com/teafany/knight-hacks-ix/blob/main/server/api/management/commands/import_challenge_data.py): `server/api/management/commands/import_challenge_data.py`
- [Simulated inference seed](https://github.com/teafany/knight-hacks-ix/blob/main/server/api/management/commands/seed_simulated_inference.py): `server/api/management/commands/seed_simulated_inference.py`

### Other components

- **Operator**

## Connections

- Operator → Workspace routing: opens workspace
- Workspace routing → Inspection summary: routes to (evidence: `frontend/src/App.tsx`)
- Workspace routing → Mission dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Workspace routing → Dataset explorer: routes to (evidence: `frontend/src/App.tsx`)
- Workspace routing → Mission replay: routes to (evidence: `frontend/src/App.tsx`)
- Workspace routing → Workspace navigation: renders (evidence: `frontend/src/App.tsx`)
- Inspection summary → Summary overview: renders (evidence: `frontend/src/SummaryPage.tsx`)
- Inspection summary → Summary selection: reads selection (evidence: `frontend/src/SummaryPage.tsx`)
- Mission dashboard → Dashboard API client: requests data (evidence: `frontend/src/Dashboard.tsx`)
- Mission dashboard → 3D facility viewer: renders (evidence: `frontend/src/Dashboard.tsx`)
- Dataset explorer → API configuration: configures source (evidence: `frontend/src/DatasetDashboard.tsx`)
- Inspection summary → Dashboard API client: loads summary data (evidence: `frontend/src/SummaryPage.tsx`)
- Dashboard API client → Inspection API: requests records
- API configuration → Inspection API: selects API mode
- Inspection API → Inspection analytics: serves analytics
- Inspection API → Record validation: validates records (evidence: `server/api/management/commands/seed_simulated_inference.py`)
- Inference endpoints → Inference validation: validates uploads (evidence: `server/api/inference_views.py`)
- Inference endpoints → Model inference: runs inference (evidence: `server/api/inference_views.py`)
- Model inference → Inspection records: saves results
- Record validation → Inspection records: checks relationships (evidence: `server/api/services/records.py`)
- Challenge data import → Record validation: validates imports (evidence: `server/api/management/commands/import_challenge_data.py`)
- Challenge data import → Inspection records: loads records (evidence: `server/api/management/commands/import_challenge_data.py`)
- Simulated inference seed → Inspection records: creates examples (evidence: `server/api/management/commands/seed_simulated_inference.py`)
- Database connection → Inspection records: configures store
- LiDAR change pipeline → 3D facility viewer: provides spatial changes
- Mission replay → Inspection API: loads mission events
