# itsranjith95/realprop_mvp architecture

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

- Interactive diagram: https://gitdiagram.com/itsranjith95/realprop_mvp
- Repository: https://github.com/itsranjith95/realprop_mvp

## Overview

RealProp is a Bengaluru property legal due-diligence MVP focused on Mother Deed and Khata documents. Its principal workflow accepts a document through the API, performs OCR and classification, extracts fields, checks cross-document consistency, assesses risk, and supports lawyer review and report generation. The Streamlit lawyer UI and review pipeline are documented in the source index; SQLite and local artifacts are the stated storage. Several pipeline internals are unsampled, so the graph limits detailed links to excerpted calls or explicit documentation.

Main entry points: [`src/api/routes/pipeline.py`](https://github.com/itsranjith95/realprop_mvp/blob/main/src/api/routes/pipeline.py) (Full Process Route), [`src/api/main.py`](https://github.com/itsranjith95/realprop_mvp/blob/main/src/api/main.py) (FastAPI API), [`src/pipelines/extraction_pipeline.py`](https://github.com/itsranjith95/realprop_mvp/blob/main/src/pipelines/extraction_pipeline.py) (Field Extraction), [`src/pipelines/validation_pipeline.py`](https://github.com/itsranjith95/realprop_mvp/blob/main/src/pipelines/validation_pipeline.py) (Cross-Document Validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Intake and OCR"]
  node_api["FastAPI API<br/>[main.py]"]
  node_pipeline_route["Full Process Route<br/>[pipeline.py]"]
  node_file_service["File Handling<br/>[file_service.py]"]
  node_ocr_pipeline["OCR Pipeline<br/>[ocr_pipeline.py]"]
  node_ocr_service["OCR Service<br/>[ocr_service.py]"]
end

subgraph group_analysis["Document Analysis"]
  node_classification["Document Classification<br/>[rule_engine.py]"]
  node_extraction_pipeline["Field Extraction"]
  node_extraction_service["Extraction Service"]
end

subgraph group_due_diligence["Due Diligence"]
  node_validation["Cross-Document Validation"]
  node_risk["Rules and Risk<br/>[rules_pipeline.py]"]
end

subgraph group_review["Lawyer Review"]
  node_lawyer_ui["Lawyer UI<br/>[lawyer_ui.py]"]
  node_review_pipeline["Review and Reports<br/>[review_pipeline.py]"]
end

node_user(("Document Submitter"))
node_lawyer(("Lawyer"))
node_sqlite[("SQLite Database<br/>[database.py]")]
node_artifacts[("Local Artifacts")]
node_models["Domain Models<br/>[models.py]"]

node_user -->|"uploads document"| node_api
node_api -->|"routes requests"| node_pipeline_route
node_api -->|"runs OCR"| node_ocr_pipeline
node_api -->|"validates and stores"| node_file_service
node_ocr_pipeline -->|"runs OCR"| node_ocr_service
node_pipeline_route -->|"classifies document"| node_classification
node_pipeline_route -->|"runs extraction"| node_extraction_pipeline
node_pipeline_route -->|"runs validation"| node_validation
node_pipeline_route -->|"runs rules"| node_risk
node_extraction_pipeline -->|"extracts entities"| node_extraction_service
node_extraction_pipeline -->|"writes extraction output"| node_artifacts
node_extraction_pipeline -->|"persists entities"| node_sqlite
node_validation -->|"reads extracted data"| node_artifacts
node_lawyer -.->|"reviews case"| node_lawyer_ui
node_lawyer_ui -->|"uses review workflow"| node_review_pipeline
node_review_pipeline -->|"reads case data"| node_sqlite
node_review_pipeline -->|"reads and writes reports"| node_artifacts
node_validation -->|"uses domain results"| node_models

click node_api "https://github.com/itsranjith95/realprop_mvp/blob/main/src/api/main.py"
click node_pipeline_route "https://github.com/itsranjith95/realprop_mvp/blob/main/src/api/routes/pipeline.py"
click node_file_service "https://github.com/itsranjith95/realprop_mvp/blob/main/src/services/file_service.py"
click node_ocr_pipeline "https://github.com/itsranjith95/realprop_mvp/blob/main/src/services/ocr_pipeline.py"
click node_ocr_service "https://github.com/itsranjith95/realprop_mvp/blob/main/src/services/ocr_service.py"
click node_classification "https://github.com/itsranjith95/realprop_mvp/blob/main/src/classification/rule_engine.py"
click node_extraction_pipeline "https://github.com/itsranjith95/realprop_mvp/blob/main/src/pipelines/extraction_pipeline.py"
click node_extraction_service "https://github.com/itsranjith95/realprop_mvp/blob/main/src/services/extractionservice.py"
click node_validation "https://github.com/itsranjith95/realprop_mvp/blob/main/src/pipelines/validation_pipeline.py"
click node_risk "https://github.com/itsranjith95/realprop_mvp/blob/main/src/pipelines/rules_pipeline.py"
click node_lawyer_ui "https://github.com/itsranjith95/realprop_mvp/blob/main/src/app/lawyer_ui.py"
click node_review_pipeline "https://github.com/itsranjith95/realprop_mvp/blob/main/src/pipelines/review_pipeline.py"
click node_sqlite "https://github.com/itsranjith95/realprop_mvp/blob/main/src/core/database.py"
click node_models "https://github.com/itsranjith95/realprop_mvp/blob/main/src/core/models.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_api,node_pipeline_route,node_file_service,node_ocr_pipeline,node_ocr_service toneBlue
class node_classification,node_extraction_pipeline,node_extraction_service,node_sqlite,node_artifacts toneAmber
class node_validation,node_risk toneMint
class node_lawyer_ui,node_review_pipeline toneRose
class node_user,node_lawyer,node_models toneIndigo
```

## Components

### Intake and OCR

- [FastAPI API](https://github.com/itsranjith95/realprop_mvp/blob/main/src/api/main.py): `src/api/main.py`
- [Full Process Route](https://github.com/itsranjith95/realprop_mvp/blob/main/src/api/routes/pipeline.py): `src/api/routes/pipeline.py`
- [File Handling](https://github.com/itsranjith95/realprop_mvp/blob/main/src/services/file_service.py): `src/services/file_service.py`
- [OCR Pipeline](https://github.com/itsranjith95/realprop_mvp/blob/main/src/services/ocr_pipeline.py): `src/services/ocr_pipeline.py`
- [OCR Service](https://github.com/itsranjith95/realprop_mvp/blob/main/src/services/ocr_service.py): `src/services/ocr_service.py`

### Document Analysis

- [Document Classification](https://github.com/itsranjith95/realprop_mvp/blob/main/src/classification/rule_engine.py): `src/classification/rule_engine.py`
- [Field Extraction](https://github.com/itsranjith95/realprop_mvp/blob/main/src/pipelines/extraction_pipeline.py): `src/pipelines/extraction_pipeline.py`
- [Extraction Service](https://github.com/itsranjith95/realprop_mvp/blob/main/src/services/extractionservice.py): `src/services/extractionservice.py`

### Due Diligence

- [Cross-Document Validation](https://github.com/itsranjith95/realprop_mvp/blob/main/src/pipelines/validation_pipeline.py): `src/pipelines/validation_pipeline.py`
- [Rules and Risk](https://github.com/itsranjith95/realprop_mvp/blob/main/src/pipelines/rules_pipeline.py): `src/pipelines/rules_pipeline.py`

### Lawyer Review

- [Lawyer UI](https://github.com/itsranjith95/realprop_mvp/blob/main/src/app/lawyer_ui.py): `src/app/lawyer_ui.py`
- [Review and Reports](https://github.com/itsranjith95/realprop_mvp/blob/main/src/pipelines/review_pipeline.py): `src/pipelines/review_pipeline.py`

### Other components

- **Document Submitter**
- **Lawyer**
- [SQLite Database](https://github.com/itsranjith95/realprop_mvp/blob/main/src/core/database.py): `src/core/database.py`
- **Local Artifacts**
- [Domain Models](https://github.com/itsranjith95/realprop_mvp/blob/main/src/core/models.py): `src/core/models.py`

## Connections

- Document Submitter → FastAPI API: uploads document (evidence: `src/api/main.py`)
- FastAPI API → Full Process Route: routes requests (evidence: `src/api/main.py`)
- FastAPI API → OCR Pipeline: runs OCR (evidence: `src/api/main.py`)
- FastAPI API → File Handling: validates and stores (evidence: `src/api/main.py`)
- OCR Pipeline → OCR Service: runs OCR (evidence: `src/services/ocr_pipeline.py`)
- Full Process Route → Document Classification: classifies document (evidence: `src/api/routes/pipeline.py`)
- Full Process Route → Field Extraction: runs extraction (evidence: `src/api/routes/pipeline.py`)
- Full Process Route → Cross-Document Validation: runs validation (evidence: `src/api/routes/pipeline.py`)
- Full Process Route → Rules and Risk: runs rules (evidence: `src/api/routes/pipeline.py`)
- Field Extraction → Extraction Service: extracts entities (evidence: `src/pipelines/extraction_pipeline.py`)
- Field Extraction → Local Artifacts: writes extraction output (evidence: `src/pipelines/extraction_pipeline.py`)
- Field Extraction → SQLite Database: persists entities (evidence: `src/pipelines/extraction_pipeline.py`)
- Cross-Document Validation → Local Artifacts: reads extracted data (evidence: `src/pipelines/validation_pipeline.py`)
- Lawyer → Lawyer UI: reviews case
- Lawyer UI → Review and Reports: uses review workflow (evidence: `src/app/lawyer_ui.py`)
- Review and Reports → SQLite Database: reads case data (evidence: `src/pipelines/review_pipeline.py`)
- Review and Reports → Local Artifacts: reads and writes reports (evidence: `src/pipelines/review_pipeline.py`)
- Cross-Document Validation → Domain Models: uses domain results (evidence: `src/pipelines/validation_pipeline.py`)
