# lakshanga-dev/proppredict-ai architecture

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

- Interactive diagram: https://gitdiagram.com/lakshanga-dev/proppredict-ai
- Repository: https://github.com/lakshanga-dev/proppredict-ai

## Overview

PropPredict is a two-market real-estate estimation prototype: users enter India or US property details in the HTML dashboard, receive a model estimate and calibrated approximate 80% interval, and can use related scenario and bulk tools. The API validates requests and applies the shared feature pipeline before inference. Separate training modules build market-specific stacked models. The graph also preserves documented dashboard capabilities; unsampled frontend behavior and API internals are represented only where README or excerpts support them. Estimates trained on synthetic demo data are not reliable market valuations.

Main entry points: [`api.py`](https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py) (Single prediction), [`feature_engineering.py`](https://github.com/lakshanga-dev/proppredict-ai/blob/main/feature_engineering.py) (India features), [`model_india.py`](https://github.com/lakshanga-dev/proppredict-ai/blob/main/model_india.py) (India model training), [`model_usa.py`](https://github.com/lakshanga-dev/proppredict-ai/blob/main/model_usa.py) (US model training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Dashboard"]
  node_dashboard["HTML dashboard<br/>[index.html]"]
end

subgraph group_service["API service"]
  node_api["FastAPI service<br/>[api.py]"]
  node_request_validation["Request validation<br/>[api.py]"]
  node_single_prediction["Single prediction<br/>[api.py]"]
  node_bulk_prediction["CSV prediction<br/>[api.py]"]
  node_explanations["SHAP explanations<br/>[api.py]"]
  node_scenario_tools["Scenario tools<br/>[api.py]"]
end

subgraph group_features["Feature pipeline"]
  node_india_features["India features"]
  node_us_features["US features"]
  node_encoding["Category encoding"]
  node_india_training_data["India data loading"]
  node_us_training_data["US data loading"]
end

subgraph group_models["Market models"]
  node_india_model["India model training<br/>[model_india.py]"]
  node_us_model["US model training<br/>[model_usa.py]"]
  node_india_bundle["India model bundle<br/>[india_model.joblib]"]
  node_us_bundle["US model bundle<br/>[us_model.joblib]"]
end

node_user(("Property user"))

node_user -->|"enters property"| node_dashboard
node_dashboard -->|"requests estimates"| node_api
node_api -->|"validates input"| node_request_validation
node_api -->|"routes requests"| node_single_prediction
node_api -->|"routes CSV"| node_bulk_prediction
node_api -->|"routes scenarios"| node_scenario_tools
node_single_prediction -->|"engineers India rows"| node_india_features
node_single_prediction -->|"engineers US rows"| node_us_features
node_bulk_prediction -->|"engineers India rows"| node_india_features
node_bulk_prediction -->|"engineers US rows"| node_us_features
node_india_features -->|"uses category maps"| node_encoding
node_us_features -->|"uses category maps"| node_encoding
node_single_prediction -->|"predicts with"| node_india_bundle
node_single_prediction -->|"predicts with"| node_us_bundle
node_bulk_prediction -->|"predicts with"| node_india_bundle
node_bulk_prediction -->|"predicts with"| node_us_bundle
node_single_prediction -->|"requests explanations"| node_explanations
node_india_training_data -.->|"supplies training data"| node_india_model
node_us_training_data -.->|"supplies training data"| node_us_model
node_india_model -->|"engineers training data"| node_india_features
node_us_model -->|"engineers training data"| node_us_features
node_india_model -.->|"saves trained bundle"| node_india_bundle
node_us_model -.->|"saves trained bundle"| node_us_bundle
node_scenario_tools -.->|"returns results"| node_dashboard

click node_dashboard "https://github.com/lakshanga-dev/proppredict-ai/blob/main/index.html"
click node_api "https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py"
click node_request_validation "https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py"
click node_single_prediction "https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py"
click node_bulk_prediction "https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py"
click node_explanations "https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py"
click node_scenario_tools "https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py"
click node_india_features "https://github.com/lakshanga-dev/proppredict-ai/blob/main/feature_engineering.py"
click node_us_features "https://github.com/lakshanga-dev/proppredict-ai/blob/main/feature_engineering.py"
click node_encoding "https://github.com/lakshanga-dev/proppredict-ai/blob/main/feature_engineering.py"
click node_india_training_data "https://github.com/lakshanga-dev/proppredict-ai/blob/main/feature_engineering.py"
click node_us_training_data "https://github.com/lakshanga-dev/proppredict-ai/blob/main/feature_engineering.py"
click node_india_model "https://github.com/lakshanga-dev/proppredict-ai/blob/main/model_india.py"
click node_us_model "https://github.com/lakshanga-dev/proppredict-ai/blob/main/model_usa.py"
click node_india_bundle "https://github.com/lakshanga-dev/proppredict-ai/blob/main/india_model.joblib"
click node_us_bundle "https://github.com/lakshanga-dev/proppredict-ai/blob/main/us_model.joblib"

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_user toneBlue
class node_api,node_request_validation,node_single_prediction,node_bulk_prediction,node_explanations,node_scenario_tools toneAmber
class node_india_features,node_us_features,node_encoding,node_india_training_data,node_us_training_data toneMint
class node_india_model,node_us_model,node_india_bundle,node_us_bundle toneRose
```

## Components

### Dashboard

- [HTML dashboard](https://github.com/lakshanga-dev/proppredict-ai/blob/main/index.html): `index.html`

### API service

- [FastAPI service](https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py): `api.py`
- [Request validation](https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py): `api.py`
- [Single prediction](https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py): `api.py`
- [CSV prediction](https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py): `api.py`
- [SHAP explanations](https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py): `api.py`
- [Scenario tools](https://github.com/lakshanga-dev/proppredict-ai/blob/main/api.py): `api.py`

### Feature pipeline

- [India features](https://github.com/lakshanga-dev/proppredict-ai/blob/main/feature_engineering.py): `feature_engineering.py`
- [US features](https://github.com/lakshanga-dev/proppredict-ai/blob/main/feature_engineering.py): `feature_engineering.py`
- [Category encoding](https://github.com/lakshanga-dev/proppredict-ai/blob/main/feature_engineering.py): `feature_engineering.py`
- [India data loading](https://github.com/lakshanga-dev/proppredict-ai/blob/main/feature_engineering.py): `feature_engineering.py`
- [US data loading](https://github.com/lakshanga-dev/proppredict-ai/blob/main/feature_engineering.py): `feature_engineering.py`

### Market models

- [India model training](https://github.com/lakshanga-dev/proppredict-ai/blob/main/model_india.py): `model_india.py`
- [US model training](https://github.com/lakshanga-dev/proppredict-ai/blob/main/model_usa.py): `model_usa.py`
- [India model bundle](https://github.com/lakshanga-dev/proppredict-ai/blob/main/india_model.joblib): `india_model.joblib`
- [US model bundle](https://github.com/lakshanga-dev/proppredict-ai/blob/main/us_model.joblib): `us_model.joblib`

### Other components

- **Property user**

## Connections

- Property user → HTML dashboard: enters property (evidence: `README.md`)
- HTML dashboard → FastAPI service: requests estimates (evidence: `README.md`)
- FastAPI service → Request validation: validates input (evidence: `api.py`)
- FastAPI service → Single prediction: routes requests (evidence: `README.md`)
- FastAPI service → CSV prediction: routes CSV (evidence: `README.md`)
- FastAPI service → Scenario tools: routes scenarios (evidence: `README.md`)
- Single prediction → India features: engineers India rows (evidence: `api.py`)
- Single prediction → US features: engineers US rows (evidence: `api.py`)
- CSV prediction → India features: engineers India rows (evidence: `api.py`)
- CSV prediction → US features: engineers US rows (evidence: `api.py`)
- India features → Category encoding: uses category maps (evidence: `api.py`)
- US features → Category encoding: uses category maps (evidence: `api.py`)
- Single prediction → India model bundle: predicts with (evidence: `api.py`)
- Single prediction → US model bundle: predicts with (evidence: `api.py`)
- CSV prediction → India model bundle: predicts with (evidence: `api.py`)
- CSV prediction → US model bundle: predicts with (evidence: `api.py`)
- Single prediction → SHAP explanations: requests explanations (evidence: `README.md`)
- India data loading → India model training: supplies training data (evidence: `model_india.py`)
- US data loading → US model training: supplies training data (evidence: `model_usa.py`)
- India model training → India features: engineers training data (evidence: `model_india.py`)
- US model training → US features: engineers training data (evidence: `model_usa.py`)
- India model training → India model bundle: saves trained bundle
- US model training → US model bundle: saves trained bundle
- Scenario tools → HTML dashboard: returns results
