# altvizz-sih26/altvizz architecture

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

- Interactive diagram: https://gitdiagram.com/altvizz-sih26/altvizz
- Repository: https://github.com/altvizz-sih26/altvizz

## Overview

DepthWizard turns a single aerial or satellite image into relative depth, then—when georeferencing or an elevation reference is available—calibrated elevations and a terrain mesh. The main workflow runs from the React upload interface through FastAPI job handling and the depth pipeline; results are then presented or downloaded in the frontend. Documented capabilities also include before/after comparison and an interactive 3D viewer. The sampled excerpts establish core pipeline calls, but not every router-to-service or result-serialization detail, so those links are kept at the documented workflow level.

Main entry points: [`app/services/depth_pipeline.py`](https://github.com/altvizz-sih26/altvizz/blob/main/app/services/depth_pipeline.py) (Depth pipeline), [`src/services/pipelineService.js`](https://github.com/altvizz-sih26/altvizz/blob/main/src/services/pipelineService.js) (Pipeline client), [`app/main.py`](https://github.com/altvizz-sih26/altvizz/blob/main/app/main.py) (FastAPI app), [`app/routers/jobs.py`](https://github.com/altvizz-sih26/altvizz/blob/main/app/routers/jobs.py) (Job routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_webapp["Web app<br/>[App.jsx]"]
  node_client["Pipeline client<br/>[pipelineService.js]"]
  node_viewer["3D viewer<br/>[main.js]"]
end

subgraph group_api["API and jobs"]
  node_apiapp["FastAPI app<br/>[main.py]"]
  node_upload["Upload routes<br/>[upload.py]"]
  node_jobs["Job routes<br/>[jobs.py]"]
  node_database[("Job database<br/>[database.py]")]
end

subgraph group_processing["Elevation processing"]
  node_depthpipe["Depth pipeline<br/>[depth_pipeline.py]"]
  node_depthmodel["Depth Anything<br/>[dpt.py]"]
  node_classifier["Terrain classifier"]
  node_srtm["SRTM alignment"]
  node_calibration["Elevation calibration"]
  node_change["Change analysis"]
  node_mesh["Terrain mesh<br/>[create_terrain.py]"]
end

subgraph group_outputs["Results and viewing"]
  node_results["Generated results<br/>[depth_pipeline.py]"]
  node_static["Result file service<br/>[main.py]"]
end

node_user(("User"))
node_geotiff["GeoTIFF input"]
node_elevation[("SRTM data")]

node_user -->|"uploads image"| node_webapp
node_webapp -->|"starts upload"| node_client
node_client -->|"POST image"| node_upload
node_apiapp -->|"mounts routes"| node_upload
node_apiapp -->|"mounts routes"| node_jobs
node_upload -->|"records job"| node_database
node_jobs -->|"reads job"| node_database
node_jobs -->|"runs job"| node_depthpipe
node_client -->|"polls status"| node_jobs
node_depthpipe -->|"infers depth"| node_depthmodel
node_depthpipe -->|"classifies image"| node_classifier
node_depthpipe -.->|"fetches reference"| node_srtm
node_geotiff -.->|"provides georeferencing"| node_srtm
node_elevation -.->|"provides tiles"| node_srtm
node_depthpipe -->|"calibrates heights"| node_calibration
node_srtm -.->|"supplies aligned data"| node_calibration
node_depthpipe -->|"generates mesh"| node_mesh
node_depthpipe -->|"writes outputs"| node_results
node_apiapp -->|"serves results"| node_static
node_client -->|"fetches results"| node_apiapp
node_webapp -->|"opens viewer"| node_viewer
node_client -->|"provides result links"| node_viewer
node_user -.->|"requests comparison"| node_change
node_change -.->|"produces change grids"| node_results

click node_webapp "https://github.com/altvizz-sih26/altvizz/blob/main/src/App.jsx"
click node_client "https://github.com/altvizz-sih26/altvizz/blob/main/src/services/pipelineService.js"
click node_viewer "https://github.com/altvizz-sih26/altvizz/blob/main/src/main.js"
click node_apiapp "https://github.com/altvizz-sih26/altvizz/blob/main/app/main.py"
click node_upload "https://github.com/altvizz-sih26/altvizz/blob/main/app/routers/upload.py"
click node_jobs "https://github.com/altvizz-sih26/altvizz/blob/main/app/routers/jobs.py"
click node_database "https://github.com/altvizz-sih26/altvizz/blob/main/app/database.py"
click node_depthpipe "https://github.com/altvizz-sih26/altvizz/blob/main/app/services/depth_pipeline.py"
click node_depthmodel "https://github.com/altvizz-sih26/altvizz/blob/main/depth_anything_v2/dpt.py"
click node_classifier "https://github.com/altvizz-sih26/altvizz/blob/main/terrain_classifier/terrain_classifier.py"
click node_srtm "https://github.com/altvizz-sih26/altvizz/blob/main/process_new_image.py"
click node_calibration "https://github.com/altvizz-sih26/altvizz/blob/main/person2_elevation/elevation_pipeline.py"
click node_change "https://github.com/altvizz-sih26/altvizz/blob/main/person2_elevation/run_before_during_pipeline.py"
click node_mesh "https://github.com/altvizz-sih26/altvizz/blob/main/person3_3d_reconstruction/create_terrain.py"
click node_results "https://github.com/altvizz-sih26/altvizz/blob/main/app/services/depth_pipeline.py"
click node_static "https://github.com/altvizz-sih26/altvizz/blob/main/app/main.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_webapp,node_client,node_viewer,node_user toneBlue
class node_apiapp,node_upload,node_jobs,node_database,node_elevation toneAmber
class node_depthpipe,node_depthmodel,node_classifier,node_srtm,node_calibration,node_change,node_mesh toneMint
class node_results,node_static toneRose
class node_geotiff toneIndigo
```

## Components

### User interface

- [Web app](https://github.com/altvizz-sih26/altvizz/blob/main/src/App.jsx): `src/App.jsx`
- [Pipeline client](https://github.com/altvizz-sih26/altvizz/blob/main/src/services/pipelineService.js): `src/services/pipelineService.js`
- [3D viewer](https://github.com/altvizz-sih26/altvizz/blob/main/src/main.js): `src/main.js`

### API and jobs

- [FastAPI app](https://github.com/altvizz-sih26/altvizz/blob/main/app/main.py): `app/main.py`
- [Upload routes](https://github.com/altvizz-sih26/altvizz/blob/main/app/routers/upload.py): `app/routers/upload.py`
- [Job routes](https://github.com/altvizz-sih26/altvizz/blob/main/app/routers/jobs.py): `app/routers/jobs.py`
- [Job database](https://github.com/altvizz-sih26/altvizz/blob/main/app/database.py): `app/database.py`

### Elevation processing

- [Depth pipeline](https://github.com/altvizz-sih26/altvizz/blob/main/app/services/depth_pipeline.py): `app/services/depth_pipeline.py`
- [Depth Anything](https://github.com/altvizz-sih26/altvizz/blob/main/depth_anything_v2/dpt.py): `depth_anything_v2/dpt.py`
- [Terrain classifier](https://github.com/altvizz-sih26/altvizz/blob/main/terrain_classifier/terrain_classifier.py): `terrain_classifier/terrain_classifier.py`
- [SRTM alignment](https://github.com/altvizz-sih26/altvizz/blob/main/process_new_image.py): `process_new_image.py`
- [Elevation calibration](https://github.com/altvizz-sih26/altvizz/blob/main/person2_elevation/elevation_pipeline.py): `person2_elevation/elevation_pipeline.py`
- [Change analysis](https://github.com/altvizz-sih26/altvizz/blob/main/person2_elevation/run_before_during_pipeline.py): `person2_elevation/run_before_during_pipeline.py`
- [Terrain mesh](https://github.com/altvizz-sih26/altvizz/blob/main/person3_3d_reconstruction/create_terrain.py): `person3_3d_reconstruction/create_terrain.py`

### Results and viewing

- [Generated results](https://github.com/altvizz-sih26/altvizz/blob/main/app/services/depth_pipeline.py): `app/services/depth_pipeline.py`
- [Result file service](https://github.com/altvizz-sih26/altvizz/blob/main/app/main.py): `app/main.py`

### Other components

- **User**
- **GeoTIFF input**
- **SRTM data**

## Connections

- User → Web app: uploads image
- Web app → Pipeline client: starts upload
- Pipeline client → Upload routes: POST image
- FastAPI app → Upload routes: mounts routes
- FastAPI app → Job routes: mounts routes
- Upload routes → Job database: records job
- Job routes → Job database: reads job
- Job routes → Depth pipeline: runs job
- Pipeline client → Job routes: polls status
- Depth pipeline → Depth Anything: infers depth
- Depth pipeline → Terrain classifier: classifies image
- Depth pipeline → SRTM alignment: fetches reference
- GeoTIFF input → SRTM alignment: provides georeferencing
- SRTM data → SRTM alignment: provides tiles
- Depth pipeline → Elevation calibration: calibrates heights
- SRTM alignment → Elevation calibration: supplies aligned data
- Depth pipeline → Terrain mesh: generates mesh
- Depth pipeline → Generated results: writes outputs
- FastAPI app → Result file service: serves results
- Pipeline client → FastAPI app: fetches results
- Web app → 3D viewer: opens viewer
- Pipeline client → 3D viewer: provides result links
- User → Change analysis: requests comparison
- Change analysis → Generated results: produces change grids
