# someshwar-prox/aero-view-ml architecture

> Architecture diagram of the GitHub repository someshwar-prox/aero-view-ml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/someshwar-prox/aero-view-ml
- Repository: https://github.com/someshwar-prox/aero-view-ml

## Overview

AERO-VIEW is a project-based 3D vertical cadastre: users choose an area, inspect parcels and stacked building/floor/unit rights, and explore underground infrastructure and contextual overlays. API handlers serve project data with PostGIS-first, snapshot fallback, access control, editing, and topology validation; the Cesium viewer and detail UI present those results and provenance. The README also documents a separate ML data-preparation pipeline. Edges reflect only excerpted calls or explicit README statements; unsampled capabilities are represented without speculative internal wiring.

Main entry points: [`lib/api/handlers.ts`](https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/api/handlers.ts) (Domain handlers), [`components/globe/CesiumRoot.tsx`](https://github.com/someshwar-prox/aero-view-ml/blob/main/components/globe/CesiumRoot.tsx) (Cesium scene), [`components/ui/DetailPanel.tsx`](https://github.com/someshwar-prox/aero-view-ml/blob/main/components/ui/DetailPanel.tsx) (Detail and provenance), [`ML-PIPELINE/tif-generator/pipeline.py`](https://github.com/someshwar-prox/aero-view-ml/blob/main/ML-PIPELINE/tif-generator/pipeline.py) (Aerial tile generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Project access"]
  node_gallery["Project gallery<br/>[page.tsx]"]
  node_login["Sign-in<br/>[LoginForm.tsx]"]
  node_project["Project viewer<br/>[ProjectViewer.tsx]"]
end

subgraph group_api["Cadastral API"]
  node_session["Session signing<br/>[session.ts]"]
  node_access["Access guards<br/>[guards.ts]"]
  node_routes["API routes<br/>[route.ts]"]
  node_handlers["Domain handlers<br/>[handlers.ts]"]
  node_projectdata["Project registry<br/>[projects.ts]"]
  node_database[("PostGIS and snapshots<br/>[db.ts]")]
  node_cache["Response cache<br/>[store.ts]"]
  node_edit["Validated edits<br/>[edits.ts]"]
  node_topology["Topology validation<br/>[topology.ts]"]
end

subgraph group_viewer["3D viewer"]
  node_viewer3d["Cesium scene<br/>[CesiumRoot.tsx]"]
  node_buildings["Building stack<br/>[BuildingsLayer.tsx]"]
  node_units["Floors and units<br/>[UnitsLayer.tsx]"]
  node_underground["Underground layers<br/>[UtilitiesLayer.tsx]"]
  node_context["Context overlays"]
  node_detail["Detail and provenance<br/>[DetailPanel.tsx]"]
  node_ladm["LADM rights<br/>[LadmTab.tsx]"]
  node_deed["Deed certificate<br/>[certificate.ts]"]
end

subgraph group_ml["ML preparation"]
  node_drone["Aerial tile generation<br/>[pipeline.py]"]
  node_elevation["Elevation inference<br/>[pipeline.py]"]
  node_lidar["LiDAR heights<br/>[lidar_engine.py]"]
  node_consensus["Height consensus<br/>[consensus.py]"]
  node_parcels["Parcel generation<br/>[pipeline.py]"]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_gallery
node_visitor -->|"signs in"| node_login
node_gallery -->|"opens project"| node_project
node_project -->|"renders"| node_viewer3d
node_login -.->|"issues session"| node_session
node_routes -->|"dispatches"| node_handlers
node_handlers -->|"checks access"| node_access
node_handlers -->|"loads data"| node_database
node_handlers -->|"reads conflicts"| node_cache
node_handlers -->|"resolves project"| node_projectdata
node_handlers -->|"validates edits"| node_edit
node_handlers -.->|"runs check"| node_topology
node_viewer3d -.->|"renders layer"| node_buildings
node_viewer3d -.->|"renders layer"| node_units
node_viewer3d -.->|"renders layer"| node_underground
node_viewer3d -.->|"renders overlay"| node_context
node_detail -->|"renders tab"| node_ladm
node_detail -.->|"shows provenance"| node_consensus
node_detail -.->|"offers certificate"| node_deed
node_visitor -.->|"prepares imagery"| node_drone
node_drone -->|"supplies tiles"| node_elevation
node_elevation -->|"fuses heights"| node_consensus
node_lidar -.->|"provides candidates"| node_consensus
node_drone -->|"supports footprints"| node_parcels

click node_gallery "https://github.com/someshwar-prox/aero-view-ml/blob/main/app/page.tsx"
click node_login "https://github.com/someshwar-prox/aero-view-ml/blob/main/app/login/LoginForm.tsx"
click node_project "https://github.com/someshwar-prox/aero-view-ml/blob/main/app/p/%5Bslug%5D/ProjectViewer.tsx"
click node_session "https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/auth/session.ts"
click node_access "https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/auth/guards.ts"
click node_routes "https://github.com/someshwar-prox/aero-view-ml/blob/main/app/api/p/%5Bslug%5D/buildings/route.ts"
click node_handlers "https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/api/handlers.ts"
click node_projectdata "https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/projects.ts"
click node_database "https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/db.ts"
click node_cache "https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/cache/store.ts"
click node_edit "https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/data/edits.ts"
click node_topology "https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/topology.ts"
click node_viewer3d "https://github.com/someshwar-prox/aero-view-ml/blob/main/components/globe/CesiumRoot.tsx"
click node_buildings "https://github.com/someshwar-prox/aero-view-ml/blob/main/components/layers/BuildingsLayer.tsx"
click node_units "https://github.com/someshwar-prox/aero-view-ml/blob/main/components/layers/UnitsLayer.tsx"
click node_underground "https://github.com/someshwar-prox/aero-view-ml/blob/main/components/layers/UtilitiesLayer.tsx"
click node_context "https://github.com/someshwar-prox/aero-view-ml/blob/main/components/layers/HazardRiskLayer.tsx"
click node_detail "https://github.com/someshwar-prox/aero-view-ml/blob/main/components/ui/DetailPanel.tsx"
click node_ladm "https://github.com/someshwar-prox/aero-view-ml/blob/main/components/ui/detail/LadmTab.tsx"
click node_deed "https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/deed/certificate.ts"
click node_drone "https://github.com/someshwar-prox/aero-view-ml/blob/main/ML-PIPELINE/tif-generator/pipeline.py"
click node_elevation "https://github.com/someshwar-prox/aero-view-ml/blob/main/ML-PIPELINE/elevation-engine/pipeline.py"
click node_lidar "https://github.com/someshwar-prox/aero-view-ml/blob/main/ML-PIPELINE/elevation-engine/lidar_engine.py"
click node_consensus "https://github.com/someshwar-prox/aero-view-ml/blob/main/ML-PIPELINE/elevation-engine/consensus.py"
click node_parcels "https://github.com/someshwar-prox/aero-view-ml/blob/main/ML-PIPELINE/parcel-generator/pipeline.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_gallery,node_login,node_project toneBlue
class node_session,node_access,node_routes,node_handlers,node_projectdata,node_database,node_cache,node_edit,node_topology toneAmber
class node_viewer3d,node_buildings,node_units,node_underground,node_context,node_detail,node_ladm,node_deed toneMint
class node_drone,node_elevation,node_lidar,node_consensus,node_parcels toneRose
class node_visitor toneIndigo
```

## Components

### Project access

- [Project gallery](https://github.com/someshwar-prox/aero-view-ml/blob/main/app/page.tsx): `app/page.tsx`
- [Sign-in](https://github.com/someshwar-prox/aero-view-ml/blob/main/app/login/LoginForm.tsx): `app/login/LoginForm.tsx`
- [Project viewer](https://github.com/someshwar-prox/aero-view-ml/blob/main/app/p/%5Bslug%5D/ProjectViewer.tsx): `app/p/[slug]/ProjectViewer.tsx`

### Cadastral API

- [Session signing](https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/auth/session.ts): `lib/auth/session.ts`
- [Access guards](https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/auth/guards.ts): `lib/auth/guards.ts`
- [API routes](https://github.com/someshwar-prox/aero-view-ml/blob/main/app/api/p/%5Bslug%5D/buildings/route.ts): `app/api/p/[slug]/buildings/route.ts`
- [Domain handlers](https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/api/handlers.ts): `lib/api/handlers.ts`
- [Project registry](https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/projects.ts): `lib/projects.ts`
- [PostGIS and snapshots](https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/db.ts): `lib/db.ts`
- [Response cache](https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/cache/store.ts): `lib/cache/store.ts`
- [Validated edits](https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/data/edits.ts): `lib/data/edits.ts`
- [Topology validation](https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/topology.ts): `lib/topology.ts`

### 3D viewer

- [Cesium scene](https://github.com/someshwar-prox/aero-view-ml/blob/main/components/globe/CesiumRoot.tsx): `components/globe/CesiumRoot.tsx`
- [Building stack](https://github.com/someshwar-prox/aero-view-ml/blob/main/components/layers/BuildingsLayer.tsx): `components/layers/BuildingsLayer.tsx`
- [Floors and units](https://github.com/someshwar-prox/aero-view-ml/blob/main/components/layers/UnitsLayer.tsx): `components/layers/UnitsLayer.tsx`
- [Underground layers](https://github.com/someshwar-prox/aero-view-ml/blob/main/components/layers/UtilitiesLayer.tsx): `components/layers/UtilitiesLayer.tsx`
- [Context overlays](https://github.com/someshwar-prox/aero-view-ml/blob/main/components/layers/HazardRiskLayer.tsx): `components/layers/HazardRiskLayer.tsx`
- [Detail and provenance](https://github.com/someshwar-prox/aero-view-ml/blob/main/components/ui/DetailPanel.tsx): `components/ui/DetailPanel.tsx`
- [LADM rights](https://github.com/someshwar-prox/aero-view-ml/blob/main/components/ui/detail/LadmTab.tsx): `components/ui/detail/LadmTab.tsx`
- [Deed certificate](https://github.com/someshwar-prox/aero-view-ml/blob/main/lib/deed/certificate.ts): `lib/deed/certificate.ts`

### ML preparation

- [Aerial tile generation](https://github.com/someshwar-prox/aero-view-ml/blob/main/ML-PIPELINE/tif-generator/pipeline.py): `ML-PIPELINE/tif-generator/pipeline.py`
- [Elevation inference](https://github.com/someshwar-prox/aero-view-ml/blob/main/ML-PIPELINE/elevation-engine/pipeline.py): `ML-PIPELINE/elevation-engine/pipeline.py`
- [LiDAR heights](https://github.com/someshwar-prox/aero-view-ml/blob/main/ML-PIPELINE/elevation-engine/lidar_engine.py): `ML-PIPELINE/elevation-engine/lidar_engine.py`
- [Height consensus](https://github.com/someshwar-prox/aero-view-ml/blob/main/ML-PIPELINE/elevation-engine/consensus.py): `ML-PIPELINE/elevation-engine/consensus.py`
- [Parcel generation](https://github.com/someshwar-prox/aero-view-ml/blob/main/ML-PIPELINE/parcel-generator/pipeline.py): `ML-PIPELINE/parcel-generator/pipeline.py`

### Other components

- **Visitor**

## Connections

- Visitor → Project gallery: browses (evidence: `README.md`)
- Visitor → Sign-in: signs in (evidence: `README.md`)
- Project gallery → Project viewer: opens project (evidence: `app/page.tsx`)
- Project viewer → Cesium scene: renders
- Sign-in → Session signing: issues session
- API routes → Domain handlers: dispatches
- Domain handlers → Access guards: checks access (evidence: `lib/api/handlers.ts`)
- Domain handlers → PostGIS and snapshots: loads data (evidence: `lib/api/handlers.ts`)
- Domain handlers → Response cache: reads conflicts (evidence: `lib/api/handlers.ts`)
- Domain handlers → Project registry: resolves project (evidence: `lib/api/handlers.ts`)
- Domain handlers → Validated edits: validates edits (evidence: `lib/api/handlers.ts`)
- Domain handlers → Topology validation: runs check
- Cesium scene → Building stack: renders layer
- Cesium scene → Floors and units: renders layer
- Cesium scene → Underground layers: renders layer
- Cesium scene → Context overlays: renders overlay
- Detail and provenance → LADM rights: renders tab (evidence: `components/ui/DetailPanel.tsx`)
- Detail and provenance → Height consensus: shows provenance
- Detail and provenance → Deed certificate: offers certificate
- Visitor → Aerial tile generation: prepares imagery
- Aerial tile generation → Elevation inference: supplies tiles (evidence: `ML-PIPELINE/elevation-engine/pipeline.py`)
- Elevation inference → Height consensus: fuses heights (evidence: `ML-PIPELINE/elevation-engine/pipeline.py`)
- LiDAR heights → Height consensus: provides candidates
- Aerial tile generation → Parcel generation: supports footprints (evidence: `ML-PIPELINE/parcel-generator/pipeline.py`)
