# daxjparmar/depthwizard_sih-26175 architecture

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

- Interactive diagram: https://gitdiagram.com/daxjparmar/depthwizard_sih-26175
- Repository: https://github.com/daxjparmar/depthwizard_sih-26175

## Overview

DepthWizard turns remote-sensing imagery into terrain and object geometry, exports a GLB, and supports browser-based inspection. The graph follows the documented upload/job workflow and the sampled pipeline orchestration; subsystem paths for some documented capabilities are supported by the tree and README, but their internal wiring was not sampled.

Main entry points: [`backend/processing/stages.py`](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/stages.py) (Stage adapters), [`backend/storage/job_storage.py`](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/storage/job_storage.py) (Job artifacts), [`backend/api/v1/jobs.py`](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/api/v1/jobs.py) (Job endpoints), [`frontend/src/hooks/useDtmLab.js`](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/hooks/useDtmLab.js) (DTM lab workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Browser experience"]
  node_landing["Landing and dashboard<br/>[LandingPageV2.jsx]"]
  node_scene_context["Active scene state"]
  node_dtm_lab["DTM analysis lab<br/>[DtmLab.jsx]"]
  node_dtm_hook["DTM lab workflow<br/>[useDtmLab.js]"]
  node_viewer["3D viewer<br/>[Viewer.jsx]"]
  node_viewer_hook["Viewer runtime<br/>[useThreeViewer.js]"]
  node_viewer_lib["Viewer controls and loader<br/>[controls.js]"]
  node_sample["Sample scene assets<br/>[useDtmLab.js]"]
  node_direct_glb["Direct GLB input<br/>[modelLoader.js]"]
end

subgraph group_jobs["Job API"]
  node_api["FastAPI application<br/>[main.py]"]
  node_routes["Job endpoints<br/>[jobs.py]"]
  node_job_service["Job lifecycle<br/>[job_service.py]"]
end

subgraph group_pipeline["Reconstruction pipeline"]
  node_pipeline["Pipeline orchestrator<br/>[pipeline.py]"]
  node_stages["Stage adapters<br/>[stages.py]"]
  node_dtm["Bare-earth DTM<br/>[reconstruction.py]"]
  node_dsm["Top-surface DSM<br/>[reconstruction.py]"]
  node_buildings["Building meshes<br/>[scene.py]"]
  node_trees["Tree meshes<br/>[scene.py]"]
end

subgraph group_models["Model adapters"]
  node_height["Height and classes<br/>[height_model.py]"]
  node_classes["Semantic classes<br/>[classes_model.py]"]
  node_glb["GLB export<br/>[glb_generator.py]"]
end

subgraph group_artifacts["Job state and artifacts"]
  node_storage[("Job artifacts<br/>[job_storage.py]")]
  node_registry[("In-memory job registry<br/>[job_service.py]")]
end

node_user(("User"))

node_user -->|"select workflow"| node_landing
node_landing -->|"set scene"| node_scene_context
node_user -->|"upload image"| node_dtm_hook
node_dtm_hook -->|"submit and poll"| node_routes
node_routes -->|"create and update"| node_job_service
node_routes -->|"store upload"| node_storage
node_routes -->|"dispatch job"| node_pipeline
node_pipeline -->|"update progress"| node_job_service
node_pipeline -->|"run stages"| node_stages
node_stages -->|"infer height"| node_height
node_stages -->|"infer classes"| node_classes
node_stages -->|"reconstruct terrain"| node_dtm
node_stages -->|"reconstruct surface"| node_dsm
node_stages -->|"reconstruct buildings"| node_buildings
node_stages -->|"reconstruct trees"| node_trees
node_stages -->|"generate model"| node_glb
node_height -->|"write outputs"| node_storage
node_classes -->|"write outputs"| node_storage
node_dtm -->|"write terrain and diagnostics"| node_storage
node_dsm -->|"write surface"| node_storage
node_buildings -->|"write meshes"| node_storage
node_trees -->|"write meshes"| node_storage
node_glb -->|"write GLB"| node_storage
node_dtm_hook -->|"set active scene"| node_scene_context
node_routes -->|"return status and artifacts"| node_dtm_hook
node_scene_context -->|"share scene"| node_viewer
node_viewer -->|"initialize viewer"| node_viewer_hook
node_viewer_hook -->|"load and control"| node_viewer_lib
node_viewer_hook -->|"fetch job GLB"| node_routes
node_user -.->|"choose preset"| node_sample
node_sample -.->|"set sample scene"| node_scene_context
node_user -.->|"open GLB"| node_direct_glb
node_direct_glb -.->|"set model scene"| node_scene_context
node_user -->|"inspect diagnostics"| node_dtm_lab
node_dtm_lab -->|"drive analysis"| node_dtm_hook

click node_landing "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/pages/LandingPageV2.jsx"
click node_scene_context "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/context/ActiveSceneContext.jsx"
click node_dtm_lab "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/pages/DtmLab.jsx"
click node_dtm_hook "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/hooks/useDtmLab.js"
click node_viewer "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/pages/Viewer.jsx"
click node_viewer_hook "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/hooks/useThreeViewer.js"
click node_viewer_lib "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/lib/viewer/controls.js"
click node_api "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/main.py"
click node_routes "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/api/v1/jobs.py"
click node_job_service "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/services/job_service.py"
click node_pipeline "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/pipeline.py"
click node_stages "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/stages.py"
click node_height "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/integrations/height_model.py"
click node_classes "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/integrations/classes_model.py"
click node_dtm "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/dtm/reconstruction.py"
click node_dsm "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/dsm/reconstruction.py"
click node_buildings "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/buildings/scene.py"
click node_trees "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/trees/scene.py"
click node_glb "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/integrations/glb_generator.py"
click node_storage "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/storage/job_storage.py"
click node_registry "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/services/job_service.py"
click node_sample "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/hooks/useDtmLab.js"
click node_direct_glb "https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/lib/viewer/modelLoader.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_landing,node_scene_context,node_dtm_lab,node_dtm_hook,node_viewer,node_viewer_hook,node_viewer_lib,node_sample,node_direct_glb,node_user toneBlue
class node_api,node_routes,node_job_service toneAmber
class node_pipeline,node_stages,node_dtm,node_dsm,node_buildings,node_trees toneMint
class node_height,node_classes,node_glb toneRose
class node_storage,node_registry toneIndigo
```

## Components

### Browser experience

- [Landing and dashboard](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/pages/LandingPageV2.jsx): `frontend/src/pages/LandingPageV2.jsx`
- [Active scene state](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/context/ActiveSceneContext.jsx): `frontend/src/context/ActiveSceneContext.jsx`
- [DTM analysis lab](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/pages/DtmLab.jsx): `frontend/src/pages/DtmLab.jsx`
- [DTM lab workflow](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/hooks/useDtmLab.js): `frontend/src/hooks/useDtmLab.js`
- [3D viewer](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/pages/Viewer.jsx): `frontend/src/pages/Viewer.jsx`
- [Viewer runtime](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/hooks/useThreeViewer.js): `frontend/src/hooks/useThreeViewer.js`
- [Viewer controls and loader](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/lib/viewer/controls.js): `frontend/src/lib/viewer/controls.js`
- [Sample scene assets](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/hooks/useDtmLab.js): `frontend/src/hooks/useDtmLab.js`
- [Direct GLB input](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/frontend/src/lib/viewer/modelLoader.js): `frontend/src/lib/viewer/modelLoader.js`

### Job API

- [FastAPI application](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/main.py): `backend/main.py`
- [Job endpoints](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/api/v1/jobs.py): `backend/api/v1/jobs.py`
- [Job lifecycle](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/services/job_service.py): `backend/services/job_service.py`

### Reconstruction pipeline

- [Pipeline orchestrator](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/pipeline.py): `backend/processing/pipeline.py`
- [Stage adapters](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/stages.py): `backend/processing/stages.py`
- [Bare-earth DTM](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/dtm/reconstruction.py): `backend/processing/dtm/reconstruction.py`
- [Top-surface DSM](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/dsm/reconstruction.py): `backend/processing/dsm/reconstruction.py`
- [Building meshes](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/buildings/scene.py): `backend/processing/buildings/scene.py`
- [Tree meshes](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/processing/trees/scene.py): `backend/processing/trees/scene.py`

### Model adapters

- [Height and classes](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/integrations/height_model.py): `backend/integrations/height_model.py`
- [Semantic classes](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/integrations/classes_model.py): `backend/integrations/classes_model.py`
- [GLB export](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/integrations/glb_generator.py): `backend/integrations/glb_generator.py`

### Job state and artifacts

- [Job artifacts](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/storage/job_storage.py): `backend/storage/job_storage.py`
- [In-memory job registry](https://github.com/daxjparmar/depthwizard_sih-26175/blob/main/backend/services/job_service.py): `backend/services/job_service.py`

### Other components

- **User**

## Connections

- User → Landing and dashboard: select workflow
- Landing and dashboard → Active scene state: set scene
- User → DTM lab workflow: upload image
- DTM lab workflow → Job endpoints: submit and poll
- Job endpoints → Job lifecycle: create and update
- Job endpoints → Job artifacts: store upload
- Job endpoints → Pipeline orchestrator: dispatch job
- Pipeline orchestrator → Job lifecycle: update progress
- Pipeline orchestrator → Stage adapters: run stages
- Stage adapters → Height and classes: infer height
- Stage adapters → Semantic classes: infer classes
- Stage adapters → Bare-earth DTM: reconstruct terrain
- Stage adapters → Top-surface DSM: reconstruct surface
- Stage adapters → Building meshes: reconstruct buildings
- Stage adapters → Tree meshes: reconstruct trees
- Stage adapters → GLB export: generate model
- Height and classes → Job artifacts: write outputs
- Semantic classes → Job artifacts: write outputs
- Bare-earth DTM → Job artifacts: write terrain and diagnostics
- Top-surface DSM → Job artifacts: write surface
- Building meshes → Job artifacts: write meshes
- Tree meshes → Job artifacts: write meshes
- GLB export → Job artifacts: write GLB
- DTM lab workflow → Active scene state: set active scene
- Job endpoints → DTM lab workflow: return status and artifacts
- Active scene state → 3D viewer: share scene
- 3D viewer → Viewer runtime: initialize viewer
- Viewer runtime → Viewer controls and loader: load and control
- Viewer runtime → Job endpoints: fetch job GLB
- User → Sample scene assets: choose preset
- Sample scene assets → Active scene state: set sample scene
- User → Direct GLB input: open GLB
- Direct GLB input → Active scene state: set model scene
- User → DTM analysis lab: inspect diagnostics
- DTM analysis lab → DTM lab workflow: drive analysis
