# akankshagupta1319/proply-ai architecture

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

- Interactive diagram: https://gitdiagram.com/akankshagupta1319/proply-ai
- Repository: https://github.com/akankshagupta1319/proply-ai

## Overview

Proply AI is a property-price estimation web application. Users enter property characteristics on the prediction page; the page either calculates a client-side estimate or, when FastAPI mode is enabled, sends inputs to the Python backend and displays the returned estimate. The README documents backend preprocessing and Random Forest inference; the sampled backend source was not included, so those internal stages are shown as documented capabilities rather than inspected implementation. Other visible product branches include the marketing site and demo analytics.

Main entry points: [`src/app/predict/page.tsx`](https://github.com/akankshagupta1319/proply-ai/blob/main/src/app/predict/page.tsx) (Prediction page), [`backend/main.py`](https://github.com/akankshagupta1319/proply-ai/blob/main/backend/main.py) (FastAPI service), [`src/lib/api-client.ts`](https://github.com/akankshagupta1319/proply-ai/blob/main/src/lib/api-client.ts) (API client), [`src/app/analytics/page.tsx`](https://github.com/akankshagupta1319/proply-ai/blob/main/src/app/analytics/page.tsx) (Analytics page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web Experience"]
  node_home["Home page<br/>[page.tsx]"]
  node_home_sections["Home sections<br/>[hero-section.tsx]"]
  node_marketing_pages["About, FAQ, pricing<br/>[page.tsx]"]
end

subgraph group_valuation["Valuation"]
  node_predict_page["Prediction page<br/>[page.tsx]"]
  node_property_form["Property form"]
  node_valuation_result["Result display"]
  node_client_valuation["Client valuation<br/>[sample-data.ts]"]
  node_api_client["API client<br/>[api-client.ts]"]
end

subgraph group_backend["Prediction Backend"]
  node_fastapi["FastAPI service<br/>[main.py]"]
  node_preprocessing["Feature preprocessing<br/>[main.py]"]
  node_random_forest["Random Forest model<br/>[main.py]"]
end

subgraph group_insights["Analytics"]
  node_analytics_page["Analytics page<br/>[page.tsx]"]
  node_analytics_charts["Analytics charts"]
  node_analytics_stats["Analytics stat cards<br/>[stat-cards.tsx]"]
  node_demo_data["Demo datasets<br/>[sample-data.ts]"]
end

node_visitor(("Property seeker"))

node_visitor -->|"opens"| node_home
node_visitor -->|"enters details"| node_predict_page
node_home -->|"renders"| node_home_sections
node_predict_page -->|"renders"| node_property_form
node_property_form -->|"submits inputs"| node_predict_page
node_predict_page -->|"calculates fallback"| node_client_valuation
node_predict_page -->|"requests prediction"| node_api_client
node_api_client -->|"posts inputs"| node_fastapi
node_fastapi -->|"prepares features"| node_preprocessing
node_preprocessing -->|"supplies features"| node_random_forest
node_random_forest -->|"returns estimate"| node_fastapi
node_fastapi -->|"returns prediction"| node_api_client
node_predict_page -->|"shows estimate"| node_valuation_result
node_analytics_page -->|"renders"| node_analytics_charts
node_analytics_page -->|"renders"| node_analytics_stats
node_analytics_charts -->|"reads charts data"| node_demo_data
node_analytics_stats -->|"reads metrics"| node_demo_data
node_visitor -.->|"browses"| node_marketing_pages

click node_home "https://github.com/akankshagupta1319/proply-ai/blob/main/src/app/page.tsx"
click node_home_sections "https://github.com/akankshagupta1319/proply-ai/blob/main/src/components/home/hero-section.tsx"
click node_predict_page "https://github.com/akankshagupta1319/proply-ai/blob/main/src/app/predict/page.tsx"
click node_property_form "https://github.com/akankshagupta1319/proply-ai/blob/main/src/components/predict/prediction-form.tsx"
click node_valuation_result "https://github.com/akankshagupta1319/proply-ai/blob/main/src/components/predict/prediction-result.tsx"
click node_client_valuation "https://github.com/akankshagupta1319/proply-ai/blob/main/src/lib/sample-data.ts"
click node_api_client "https://github.com/akankshagupta1319/proply-ai/blob/main/src/lib/api-client.ts"
click node_fastapi "https://github.com/akankshagupta1319/proply-ai/blob/main/backend/main.py"
click node_preprocessing "https://github.com/akankshagupta1319/proply-ai/blob/main/backend/main.py"
click node_random_forest "https://github.com/akankshagupta1319/proply-ai/blob/main/backend/main.py"
click node_analytics_page "https://github.com/akankshagupta1319/proply-ai/blob/main/src/app/analytics/page.tsx"
click node_analytics_charts "https://github.com/akankshagupta1319/proply-ai/blob/main/src/components/analytics/charts-container.tsx"
click node_analytics_stats "https://github.com/akankshagupta1319/proply-ai/blob/main/src/components/analytics/stat-cards.tsx"
click node_demo_data "https://github.com/akankshagupta1319/proply-ai/blob/main/src/lib/sample-data.ts"
click node_marketing_pages "https://github.com/akankshagupta1319/proply-ai/blob/main/src/app/about/page.tsx"

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_home,node_home_sections,node_marketing_pages toneBlue
class node_predict_page,node_property_form,node_valuation_result,node_client_valuation,node_api_client toneAmber
class node_fastapi,node_preprocessing,node_random_forest toneMint
class node_analytics_page,node_analytics_charts,node_analytics_stats,node_demo_data toneRose
class node_visitor toneIndigo
```

## Components

### Web Experience

- [Home page](https://github.com/akankshagupta1319/proply-ai/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Home sections](https://github.com/akankshagupta1319/proply-ai/blob/main/src/components/home/hero-section.tsx): `src/components/home/hero-section.tsx`
- [About, FAQ, pricing](https://github.com/akankshagupta1319/proply-ai/blob/main/src/app/about/page.tsx): `src/app/about/page.tsx`

### Valuation

- [Prediction page](https://github.com/akankshagupta1319/proply-ai/blob/main/src/app/predict/page.tsx): `src/app/predict/page.tsx`
- [Property form](https://github.com/akankshagupta1319/proply-ai/blob/main/src/components/predict/prediction-form.tsx): `src/components/predict/prediction-form.tsx`
- [Result display](https://github.com/akankshagupta1319/proply-ai/blob/main/src/components/predict/prediction-result.tsx): `src/components/predict/prediction-result.tsx`
- [Client valuation](https://github.com/akankshagupta1319/proply-ai/blob/main/src/lib/sample-data.ts): `src/lib/sample-data.ts`
- [API client](https://github.com/akankshagupta1319/proply-ai/blob/main/src/lib/api-client.ts): `src/lib/api-client.ts`

### Prediction Backend

- [FastAPI service](https://github.com/akankshagupta1319/proply-ai/blob/main/backend/main.py): `backend/main.py`
- [Feature preprocessing](https://github.com/akankshagupta1319/proply-ai/blob/main/backend/main.py): `backend/main.py`
- [Random Forest model](https://github.com/akankshagupta1319/proply-ai/blob/main/backend/main.py): `backend/main.py`

### Analytics

- [Analytics page](https://github.com/akankshagupta1319/proply-ai/blob/main/src/app/analytics/page.tsx): `src/app/analytics/page.tsx`
- [Analytics charts](https://github.com/akankshagupta1319/proply-ai/blob/main/src/components/analytics/charts-container.tsx): `src/components/analytics/charts-container.tsx`
- [Analytics stat cards](https://github.com/akankshagupta1319/proply-ai/blob/main/src/components/analytics/stat-cards.tsx): `src/components/analytics/stat-cards.tsx`
- [Demo datasets](https://github.com/akankshagupta1319/proply-ai/blob/main/src/lib/sample-data.ts): `src/lib/sample-data.ts`

### Other components

- **Property seeker**

## Connections

- Property seeker → Home page: opens
- Property seeker → Prediction page: enters details (evidence: `README.md`)
- Home page → Home sections: renders (evidence: `src/app/page.tsx`)
- Prediction page → Property form: renders (evidence: `src/app/predict/page.tsx`)
- Property form → Prediction page: submits inputs (evidence: `src/app/predict/page.tsx`)
- Prediction page → Client valuation: calculates fallback (evidence: `src/app/predict/page.tsx`)
- Prediction page → API client: requests prediction (evidence: `src/app/predict/page.tsx`)
- API client → FastAPI service: posts inputs (evidence: `src/lib/api-client.ts`)
- FastAPI service → Feature preprocessing: prepares features (evidence: `README.md`)
- Feature preprocessing → Random Forest model: supplies features (evidence: `README.md`)
- Random Forest model → FastAPI service: returns estimate (evidence: `README.md`)
- FastAPI service → API client: returns prediction (evidence: `README.md`)
- Prediction page → Result display: shows estimate (evidence: `src/app/predict/page.tsx`)
- Analytics page → Analytics charts: renders (evidence: `src/app/analytics/page.tsx`)
- Analytics page → Analytics stat cards: renders (evidence: `src/app/analytics/page.tsx`)
- Analytics charts → Demo datasets: reads charts data (evidence: `src/components/analytics/charts-container.tsx`)
- Analytics stat cards → Demo datasets: reads metrics (evidence: `src/components/analytics/stat-cards.tsx`)
- Property seeker → About, FAQ, pricing: browses
