# yaswanth-001aiml/ap-land-resurvey architecture

> Architecture diagram of the GitHub repository yaswanth-001aiml/ap-land-resurvey, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yaswanth-001aiml/ap-land-resurvey
- Repository: https://github.com/yaswanth-001aiml/ap-land-resurvey

## Overview

This is an Andhra Pradesh cadastral parcel and satellite-monitoring platform. Its principal workflow is parcel lookup, selection of observation dates, Sentinel-2 scene retrieval, parcel-level analysis through U-Net classification and spectral change measures, then presentation of an inspection result. The graph also includes the documented model-training path and alternate API/UI implementations. Some frontend-to-backend wiring and unsampled subsystem details are not shown, so those relationships are omitted or marked unverified.

Main entry points: [`backend.py`](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/backend.py) (Main application API), [`src/dl/unet.py`](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/src/dl/unet.py) (Seven-class U-Net), [`frontend/src/App.jsx`](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/frontend/src/App.jsx) (Land dashboard), [`parcel_service.py`](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/parcel_service.py) (Parcel lookup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_dashboard["Land dashboard<br/>[App.jsx]"]
  node_dashboard_alt["Dashboard variant<br/>[App_backup.jsx]"]
  node_change_ui["Change dashboard"]
  node_map_view["Map display<br/>[MapView.jsx]"]
  node_streamlit["Parcel search UI<br/>[app.py]"]
end

subgraph group_parcel["Cadastral search"]
  node_parcel_lookup["Parcel lookup<br/>[parcel_service.py]"]
  node_parcel_search["Parcel search utility<br/>[parcel_search.py]"]
end

subgraph group_imagery["Imagery and analysis"]
  node_parcel_analysis["Parcel analysis"]
  node_sentinel["Sentinel-2 retrieval"]
  node_spectral_change["Spectral change<br/>[change_detector.py]"]
end

subgraph group_learning["Deep learning"]
  node_unet["Seven-class U-Net<br/>[unet.py]"]
  node_dataset["Land-cover dataset<br/>[dataset.py]"]
  node_training["Model training<br/>[train.py]"]
end

subgraph group_service["API services"]
  node_backend["Main application API<br/>[backend.py]"]
  node_segmentation_api["Segmentation API<br/>[main.py]"]
  node_segmentation_api_alt["Segmentation API variant<br/>[main_backup.py]"]
end

node_user(("Land analyst"))

node_user -->|"selects parcel"| node_dashboard
node_user -->|"searches parcel"| node_streamlit
node_dashboard -.->|"requests analysis"| node_backend
node_dashboard_alt -->|"renders map"| node_map_view
node_dashboard -.->|"opens change view"| node_change_ui
node_streamlit -->|"searches"| node_parcel_lookup
node_backend -->|"queries parcels"| node_parcel_lookup
node_backend -->|"requests imagery"| node_sentinel
node_backend -->|"uses model"| node_unet
node_parcel_analysis -->|"loads parcel"| node_parcel_lookup
node_parcel_analysis -->|"downloads scenes"| node_sentinel
node_training -->|"loads samples"| node_dataset
node_training -->|"trains model"| node_unet
node_segmentation_api -->|"runs inference"| node_unet
node_segmentation_api_alt -->|"runs inference"| node_unet
node_backend -.->|"computes changes"| node_spectral_change
node_user -.->|"uploads imagery"| node_segmentation_api

click node_dashboard "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/frontend/src/App.jsx"
click node_dashboard_alt "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/frontend/src/App_backup.jsx"
click node_change_ui "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/frontend/src/ChangeDetection.jsx"
click node_map_view "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/frontend/src/components/MapView.jsx"
click node_streamlit "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/app.py"
click node_parcel_lookup "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/parcel_service.py"
click node_parcel_search "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/parcel_search.py"
click node_parcel_analysis "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/parcel_analysis_service.py"
click node_sentinel "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/satellite_service.py"
click node_spectral_change "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/change_detector.py"
click node_unet "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/src/dl/unet.py"
click node_dataset "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/src/dl/dataset.py"
click node_training "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/src/dl/train.py"
click node_backend "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/backend.py"
click node_segmentation_api "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/api/main.py"
click node_segmentation_api_alt "https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/api/main_backup.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_dashboard,node_dashboard_alt,node_change_ui,node_map_view,node_streamlit toneBlue
class node_parcel_lookup,node_parcel_search toneAmber
class node_parcel_analysis,node_sentinel,node_spectral_change toneMint
class node_unet,node_dataset,node_training toneRose
class node_backend,node_segmentation_api,node_segmentation_api_alt,node_user toneIndigo
```

## Components

### User interfaces

- [Land dashboard](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard variant](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/frontend/src/App_backup.jsx): `frontend/src/App_backup.jsx`
- [Change dashboard](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/frontend/src/ChangeDetection.jsx): `frontend/src/ChangeDetection.jsx`
- [Map display](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/frontend/src/components/MapView.jsx): `frontend/src/components/MapView.jsx`
- [Parcel search UI](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/app.py): `app.py`

### Cadastral search

- [Parcel lookup](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/parcel_service.py): `parcel_service.py`
- [Parcel search utility](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/parcel_search.py): `parcel_search.py`

### Imagery and analysis

- [Parcel analysis](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/parcel_analysis_service.py): `parcel_analysis_service.py`
- [Sentinel-2 retrieval](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/satellite_service.py): `satellite_service.py`
- [Spectral change](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/change_detector.py): `change_detector.py`

### Deep learning

- [Seven-class U-Net](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/src/dl/unet.py): `src/dl/unet.py`
- [Land-cover dataset](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/src/dl/dataset.py): `src/dl/dataset.py`
- [Model training](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/src/dl/train.py): `src/dl/train.py`

### API services

- [Main application API](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/backend.py): `backend.py`
- [Segmentation API](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/api/main.py): `api/main.py`
- [Segmentation API variant](https://github.com/yaswanth-001aiml/ap-land-resurvey/blob/main/api/main_backup.py): `api/main_backup.py`

### Other components

- **Land analyst**

## Connections

- Land analyst → Land dashboard: selects parcel
- Land analyst → Parcel search UI: searches parcel (evidence: `app.py`)
- Land dashboard → Main application API: requests analysis
- Dashboard variant → Map display: renders map (evidence: `frontend/src/App_backup.jsx`)
- Land dashboard → Change dashboard: opens change view
- Parcel search UI → Parcel lookup: searches (evidence: `app.py`)
- Main application API → Parcel lookup: queries parcels (evidence: `backend.py`)
- Main application API → Sentinel-2 retrieval: requests imagery (evidence: `backend.py`)
- Main application API → Seven-class U-Net: uses model (evidence: `backend.py`)
- Parcel analysis → Parcel lookup: loads parcel (evidence: `parcel_analysis_service.py`)
- Parcel analysis → Sentinel-2 retrieval: downloads scenes (evidence: `parcel_analysis_service.py`)
- Model training → Land-cover dataset: loads samples (evidence: `src/dl/train.py`)
- Model training → Seven-class U-Net: trains model (evidence: `src/dl/train.py`)
- Segmentation API → Seven-class U-Net: runs inference (evidence: `api/main.py`)
- Segmentation API variant → Seven-class U-Net: runs inference (evidence: `api/main_backup.py`)
- Main application API → Spectral change: computes changes
- Land analyst → Segmentation API: uploads imagery
