# luckypant10307-coder/sih26018_landrecorddigitization architecture

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

- Interactive diagram: https://gitdiagram.com/luckypant10307-coder/sih26018_landrecorddigitization
- Repository: https://github.com/luckypant10307-coder/sih26018_landrecorddigitization

## Overview

This is a land-record digitization and validation application. An operator submits a document; the server extracts text, structures land-record fields, validates them and routes the result for approval, review, or blocking. Records and audit history are stored, and human corrections feed the learning loop. The README documents additional cadastral-map, geospatial and building-analysis capabilities. Some links are supported only by documented workflow or the source index; unsampled implementations are not assumed to have been inspected.

Main entry points: [`backend/server.py`](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/server.py) (HTTP API and ingestion), [`backend/validator.py`](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/validator.py) (Rules and trust scoring), [`frontend/app.js`](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/frontend/app.js) (Web application), [`backend/ocr_engine.py`](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/ocr_engine.py) (OCR and text extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_frontend["Web application<br/>[app.js]"]
end

subgraph group_ingest["Document processing"]
  node_server["HTTP API and ingestion<br/>[server.py]"]
  node_ocr["OCR and text extraction<br/>[ocr_engine.py]"]
  node_fields["Land-field extraction<br/>[field_extractor.py]"]
  node_doctype["Document classification<br/>[doc_type.py]"]
  node_llm["Optional field suggestions<br/>[llm_extractor.py]"]
  node_bhashini["Indic script bridge<br/>[bhashini.py]"]
end

subgraph group_review["Validation and learning"]
  node_validator["Rules and trust scoring<br/>[validator.py]"]
  node_fact["Registry fact-check<br/>[fact_checker.py]"]
  node_ner["Entity cross-check<br/>[ner_extractor.py]"]
  node_auth["API authentication<br/>[auth.py]"]
  node_db[("Records and audit store<br/>[db.py]")]
  node_learning["Correction learning<br/>[learning.py]"]
  node_anomaly["Anomaly detection"]
end

subgraph group_geo["Cadastral and geospatial"]
  node_cadastral["Parcel map processing<br/>[cadastral.py]"]
  node_cityjson["CityJSON processing<br/>[cityjson.py]"]
  node_height["Building height analysis<br/>[building_height.py]"]
  node_openbuildings["Open buildings data<br/>[open_buildings.py]"]
  node_vertical["Vertical analysis<br/>[vertical.py]"]
end

node_operator(("Land-record operator"))

node_operator -->|"submits documents"| node_frontend
node_frontend -->|"calls API"| node_server
node_server -->|"verifies callers"| node_auth
node_server -->|"extracts text"| node_ocr
node_server -->|"extracts fields"| node_fields
node_server -->|"classifies document"| node_doctype
node_server -->|"requests suggestions"| node_llm
node_server -->|"validates fields"| node_validator
node_validator -->|"checks registry"| node_fact
node_validator -->|"cross-checks entities"| node_ner
node_server -->|"stores outcomes"| node_db
node_server -->|"applies corrections"| node_learning
node_server -->|"uses detection"| node_anomaly
node_server -->|"uses script bridge"| node_bhashini
node_server -->|"serves map workflows"| node_cadastral
node_server -->|"serves map workflows"| node_cityjson
node_server -->|"serves building analysis"| node_height
node_server -->|"uses building data"| node_openbuildings
node_server -->|"serves vertical analysis"| node_vertical

click node_frontend "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/frontend/app.js"
click node_server "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/server.py"
click node_ocr "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/ocr_engine.py"
click node_fields "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/field_extractor.py"
click node_doctype "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/doc_type.py"
click node_llm "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/llm_extractor.py"
click node_validator "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/validator.py"
click node_fact "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/fact_checker.py"
click node_ner "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/ner_extractor.py"
click node_auth "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/auth.py"
click node_db "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/db.py"
click node_learning "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/learning.py"
click node_anomaly "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/anomaly_detector.py"
click node_bhashini "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/bhashini.py"
click node_cadastral "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/cadastral.py"
click node_cityjson "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/cityjson.py"
click node_height "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/building_height.py"
click node_openbuildings "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/open_buildings.py"
click node_vertical "https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/vertical.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_frontend toneBlue
class node_server,node_ocr,node_fields,node_doctype,node_llm,node_bhashini toneAmber
class node_validator,node_fact,node_ner,node_auth,node_db,node_learning,node_anomaly toneMint
class node_cadastral,node_cityjson,node_height,node_openbuildings,node_vertical toneRose
class node_operator toneIndigo
```

## Components

### User interface

- [Web application](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/frontend/app.js): `frontend/app.js`

### Document processing

- [HTTP API and ingestion](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/server.py): `backend/server.py`
- [OCR and text extraction](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/ocr_engine.py): `backend/ocr_engine.py`
- [Land-field extraction](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/field_extractor.py): `backend/field_extractor.py`
- [Document classification](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/doc_type.py): `backend/doc_type.py`
- [Optional field suggestions](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/llm_extractor.py): `backend/llm_extractor.py`
- [Indic script bridge](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/bhashini.py): `backend/bhashini.py`

### Validation and learning

- [Rules and trust scoring](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/validator.py): `backend/validator.py`
- [Registry fact-check](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/fact_checker.py): `backend/fact_checker.py`
- [Entity cross-check](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/ner_extractor.py): `backend/ner_extractor.py`
- [API authentication](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/auth.py): `backend/auth.py`
- [Records and audit store](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/db.py): `backend/db.py`
- [Correction learning](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/learning.py): `backend/learning.py`
- [Anomaly detection](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/anomaly_detector.py): `backend/anomaly_detector.py`

### Cadastral and geospatial

- [Parcel map processing](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/cadastral.py): `backend/cadastral.py`
- [CityJSON processing](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/cityjson.py): `backend/cityjson.py`
- [Building height analysis](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/building_height.py): `backend/building_height.py`
- [Open buildings data](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/open_buildings.py): `backend/open_buildings.py`
- [Vertical analysis](https://github.com/luckypant10307-coder/sih26018_landrecorddigitization/blob/main/backend/vertical.py): `backend/vertical.py`

### Other components

- **Land-record operator**

## Connections

- Land-record operator → Web application: submits documents (evidence: `README.md`)
- Web application → HTTP API and ingestion: calls API (evidence: `README.md`)
- HTTP API and ingestion → API authentication: verifies callers (evidence: `backend/server.py`)
- HTTP API and ingestion → OCR and text extraction: extracts text (evidence: `README.md`)
- HTTP API and ingestion → Land-field extraction: extracts fields (evidence: `README.md`)
- HTTP API and ingestion → Document classification: classifies document (evidence: `backend/server.py`)
- HTTP API and ingestion → Optional field suggestions: requests suggestions (evidence: `backend/server.py`)
- HTTP API and ingestion → Rules and trust scoring: validates fields (evidence: `README.md`)
- Rules and trust scoring → Registry fact-check: checks registry (evidence: `backend/validator.py`)
- Rules and trust scoring → Entity cross-check: cross-checks entities (evidence: `backend/validator.py`)
- HTTP API and ingestion → Records and audit store: stores outcomes (evidence: `README.md`)
- HTTP API and ingestion → Correction learning: applies corrections (evidence: `README.md`)
- HTTP API and ingestion → Anomaly detection: uses detection (evidence: `backend/server.py`)
- HTTP API and ingestion → Indic script bridge: uses script bridge (evidence: `backend/server.py`)
- HTTP API and ingestion → Parcel map processing: serves map workflows (evidence: `backend/server.py`)
- HTTP API and ingestion → CityJSON processing: serves map workflows (evidence: `backend/server.py`)
- HTTP API and ingestion → Building height analysis: serves building analysis (evidence: `run.py`)
- HTTP API and ingestion → Open buildings data: uses building data (evidence: `run.py`)
- HTTP API and ingestion → Vertical analysis: serves vertical analysis (evidence: `run.py`)
