# sakshi-malunjkar/estateiq architecture

> Architecture diagram of the GitHub repository sakshi-malunjkar/estateiq, 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/sakshi-malunjkar/estateiq
- Repository: https://github.com/sakshi-malunjkar/estateiq

## Overview

EstateIQ analyzes real-estate call transcripts, extracts buyer requirements and intent, estimates sentiment and lead quality, and exposes results through an API and admin tools. The main workflow is transcript submission to API analysis, NLP and lead scoring, then optional lead persistence and later admin review. The README documents Vapi webhook intake and authenticated lead/analytics endpoints. The client call widget and catalog/project features are represented from the tree, but their runtime wiring was not sampled; uncertain connections are omitted. API wiring is based on the excerpt and SOURCE INDEX references.

Main entry points: [`api/main.py`](https://github.com/sakshi-malunjkar/estateiq/blob/main/api/main.py) (EstateIQ API), [`admin-new/src/admin/AdminRoutes.tsx`](https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/AdminRoutes.tsx) (Admin Routing), [`app/nlp/combined_predict.py`](https://github.com/sakshi-malunjkar/estateiq/blob/main/app/nlp/combined_predict.py) (Combined NLP), [`app/lead_scoring/predict_lead_score.py`](https://github.com/sakshi-malunjkar/estateiq/blob/main/app/lead_scoring/predict_lead_score.py) (Lead Scoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Transcript Intake"]
  node_client_call["Call Widget<br/>[CallWidget.tsx]"]
end

subgraph group_analysis["Lead Analysis"]
  node_nlp["Combined NLP"]
  node_ner["Entity Extraction<br/>[predict.py]"]
  node_entity_rules["Entity Rules<br/>[entity_rules.py]"]
  node_sentiment["Sentiment Prediction"]
  node_intent["Intent Prediction<br/>[intent_predict.py]"]
  node_features["Feature Extraction"]
  node_lead_score["Lead Scoring"]
  node_heuristic["Bootstrap Heuristic<br/>[heuristic.py]"]
end

subgraph group_persistence["Lead Data"]
  node_schema["Lead Schema<br/>[models.py]"]
  node_db[("Async Database<br/>[database.py]")]
  node_crud["Lead Persistence<br/>[crud.py]"]
end

subgraph group_backend["API Services"]
  node_api["EstateIQ API<br/>[main.py]"]
  node_auth["Token Verification<br/>[auth.py]"]
  node_catalog["Catalog API<br/>[catalog.py]"]
end

subgraph group_interfaces["User Interfaces"]
  node_admin_routes["Admin Routing<br/>[AdminRoutes.tsx]"]
  node_admin_login["Admin Login<br/>[AdminLogin.tsx]"]
  node_admin_leads["Lead Management<br/>[Leads.tsx]"]
  node_admin_overview["Lead Overview<br/>[Overview.tsx]"]
  node_admin_analytics["Analytics<br/>[Analytics.tsx]"]
  node_admin_projects["Project Admin<br/>[ProjectAdmin.tsx]"]
  node_streamlit["Analysis Dashboard<br/>[app.py]"]
end

node_caller(("Caller / Vapi"))
node_supabase_auth["Supabase Auth"]

node_caller -->|"submits report"| node_api
node_api -->|"runs analysis"| node_nlp
node_api -->|"extracts entities"| node_entity_rules
node_api -->|"scores lead"| node_lead_score
node_nlp -->|"calls NER"| node_ner
node_nlp -->|"calls sentiment"| node_sentiment
node_nlp -->|"calls intent"| node_intent
node_ner -->|"uses rules"| node_entity_rules
node_lead_score -->|"builds features"| node_features
node_features -->|"extracts entities"| node_ner
node_features -->|"predicts sentiment"| node_sentiment
node_lead_score -.->|"tier thresholds"| node_heuristic
node_api -->|"reads and writes"| node_crud
node_api -->|"opens sessions"| node_db
node_crud -->|"uses models"| node_schema
node_db -->|"creates tables"| node_schema
node_api -->|"guards endpoints"| node_auth
node_auth -->|"verifies tokens"| node_supabase_auth
node_api -->|"routes catalog"| node_catalog
node_admin_routes -->|"routes login"| node_admin_login
node_admin_routes -->|"routes leads"| node_admin_leads
node_admin_routes -->|"routes overview"| node_admin_overview
node_admin_routes -->|"routes analytics"| node_admin_analytics
node_admin_routes -->|"routes projects"| node_admin_projects
node_streamlit -->|"analyzes transcript"| node_nlp
node_streamlit -->|"scores transcript"| node_lead_score

click node_client_call "https://github.com/sakshi-malunjkar/estateiq/blob/main/client-new/src/features/client/CallWidget.tsx"
click node_api "https://github.com/sakshi-malunjkar/estateiq/blob/main/api/main.py"
click node_nlp "https://github.com/sakshi-malunjkar/estateiq/blob/main/app/nlp/combined_predict.py"
click node_ner "https://github.com/sakshi-malunjkar/estateiq/blob/main/app/nlp/predict.py"
click node_entity_rules "https://github.com/sakshi-malunjkar/estateiq/blob/main/app/nlp/entity_rules.py"
click node_sentiment "https://github.com/sakshi-malunjkar/estateiq/blob/main/app/nlp/sentiment_predict.py"
click node_intent "https://github.com/sakshi-malunjkar/estateiq/blob/main/app/nlp/intent_predict.py"
click node_features "https://github.com/sakshi-malunjkar/estateiq/blob/main/app/lead_scoring/extract_features.py"
click node_lead_score "https://github.com/sakshi-malunjkar/estateiq/blob/main/app/lead_scoring/predict_lead_score.py"
click node_heuristic "https://github.com/sakshi-malunjkar/estateiq/blob/main/app/lead_scoring/heuristic.py"
click node_schema "https://github.com/sakshi-malunjkar/estateiq/blob/main/app/lead_scoring/models.py"
click node_db "https://github.com/sakshi-malunjkar/estateiq/blob/main/api/database.py"
click node_crud "https://github.com/sakshi-malunjkar/estateiq/blob/main/api/crud.py"
click node_auth "https://github.com/sakshi-malunjkar/estateiq/blob/main/api/auth.py"
click node_catalog "https://github.com/sakshi-malunjkar/estateiq/blob/main/api/catalog.py"
click node_admin_routes "https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/AdminRoutes.tsx"
click node_admin_login "https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/screens/AdminLogin.tsx"
click node_admin_leads "https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/screens/Leads.tsx"
click node_admin_overview "https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/screens/Overview.tsx"
click node_admin_analytics "https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/screens/Analytics.tsx"
click node_admin_projects "https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/screens/ProjectAdmin.tsx"
click node_streamlit "https://github.com/sakshi-malunjkar/estateiq/blob/main/dashboard/app.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_client_call toneBlue
class node_nlp,node_ner,node_entity_rules,node_sentiment,node_intent,node_features,node_lead_score,node_heuristic toneAmber
class node_schema,node_db,node_crud,node_caller toneMint
class node_api,node_auth,node_catalog toneRose
class node_admin_routes,node_admin_login,node_admin_leads,node_admin_overview,node_admin_analytics,node_admin_projects,node_streamlit,node_supabase_auth toneIndigo
```

## Components

### Transcript Intake

- [Call Widget](https://github.com/sakshi-malunjkar/estateiq/blob/main/client-new/src/features/client/CallWidget.tsx): `client-new/src/features/client/CallWidget.tsx`

### Lead Analysis

- [Combined NLP](https://github.com/sakshi-malunjkar/estateiq/blob/main/app/nlp/combined_predict.py): `app/nlp/combined_predict.py`
- [Entity Extraction](https://github.com/sakshi-malunjkar/estateiq/blob/main/app/nlp/predict.py): `app/nlp/predict.py`
- [Entity Rules](https://github.com/sakshi-malunjkar/estateiq/blob/main/app/nlp/entity_rules.py): `app/nlp/entity_rules.py`
- [Sentiment Prediction](https://github.com/sakshi-malunjkar/estateiq/blob/main/app/nlp/sentiment_predict.py): `app/nlp/sentiment_predict.py`
- [Intent Prediction](https://github.com/sakshi-malunjkar/estateiq/blob/main/app/nlp/intent_predict.py): `app/nlp/intent_predict.py`
- [Feature Extraction](https://github.com/sakshi-malunjkar/estateiq/blob/main/app/lead_scoring/extract_features.py): `app/lead_scoring/extract_features.py`
- [Lead Scoring](https://github.com/sakshi-malunjkar/estateiq/blob/main/app/lead_scoring/predict_lead_score.py): `app/lead_scoring/predict_lead_score.py`
- [Bootstrap Heuristic](https://github.com/sakshi-malunjkar/estateiq/blob/main/app/lead_scoring/heuristic.py): `app/lead_scoring/heuristic.py`

### Lead Data

- [Lead Schema](https://github.com/sakshi-malunjkar/estateiq/blob/main/app/lead_scoring/models.py): `app/lead_scoring/models.py`
- [Async Database](https://github.com/sakshi-malunjkar/estateiq/blob/main/api/database.py): `api/database.py`
- [Lead Persistence](https://github.com/sakshi-malunjkar/estateiq/blob/main/api/crud.py): `api/crud.py`

### API Services

- [EstateIQ API](https://github.com/sakshi-malunjkar/estateiq/blob/main/api/main.py): `api/main.py`
- [Token Verification](https://github.com/sakshi-malunjkar/estateiq/blob/main/api/auth.py): `api/auth.py`
- [Catalog API](https://github.com/sakshi-malunjkar/estateiq/blob/main/api/catalog.py): `api/catalog.py`

### User Interfaces

- [Admin Routing](https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/AdminRoutes.tsx): `admin-new/src/admin/AdminRoutes.tsx`
- [Admin Login](https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/screens/AdminLogin.tsx): `admin-new/src/admin/screens/AdminLogin.tsx`
- [Lead Management](https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/screens/Leads.tsx): `admin-new/src/admin/screens/Leads.tsx`
- [Lead Overview](https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/screens/Overview.tsx): `admin-new/src/admin/screens/Overview.tsx`
- [Analytics](https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/screens/Analytics.tsx): `admin-new/src/admin/screens/Analytics.tsx`
- [Project Admin](https://github.com/sakshi-malunjkar/estateiq/blob/main/admin-new/src/admin/screens/ProjectAdmin.tsx): `admin-new/src/admin/screens/ProjectAdmin.tsx`
- [Analysis Dashboard](https://github.com/sakshi-malunjkar/estateiq/blob/main/dashboard/app.py): `dashboard/app.py`

### Other components

- **Caller / Vapi**
- **Supabase Auth**

## Connections

- Caller / Vapi → EstateIQ API: submits report (evidence: `README.md`)
- EstateIQ API → Combined NLP: runs analysis (evidence: `api/main.py`)
- EstateIQ API → Entity Rules: extracts entities (evidence: `api/main.py`)
- EstateIQ API → Lead Scoring: scores lead (evidence: `api/main.py`)
- Combined NLP → Entity Extraction: calls NER (evidence: `app/nlp/combined_predict.py`)
- Combined NLP → Sentiment Prediction: calls sentiment (evidence: `app/nlp/combined_predict.py`)
- Combined NLP → Intent Prediction: calls intent (evidence: `app/nlp/combined_predict.py`)
- Entity Extraction → Entity Rules: uses rules (evidence: `app/nlp/predict.py`)
- Lead Scoring → Feature Extraction: builds features (evidence: `app/lead_scoring/predict_lead_score.py`)
- Feature Extraction → Entity Extraction: extracts entities (evidence: `app/lead_scoring/extract_features.py`)
- Feature Extraction → Sentiment Prediction: predicts sentiment (evidence: `app/lead_scoring/extract_features.py`)
- Lead Scoring → Bootstrap Heuristic: tier thresholds (evidence: `app/lead_scoring/predict_lead_score.py`)
- EstateIQ API → Lead Persistence: reads and writes (evidence: `api/main.py`)
- EstateIQ API → Async Database: opens sessions (evidence: `api/main.py`)
- Lead Persistence → Lead Schema: uses models (evidence: `api/crud.py`)
- Async Database → Lead Schema: creates tables (evidence: `api/database.py`)
- EstateIQ API → Token Verification: guards endpoints (evidence: `api/main.py`)
- Token Verification → Supabase Auth: verifies tokens (evidence: `api/auth.py`)
- EstateIQ API → Catalog API: routes catalog (evidence: `api/main.py`)
- Admin Routing → Admin Login: routes login (evidence: `admin-new/src/admin/AdminRoutes.tsx`)
- Admin Routing → Lead Management: routes leads (evidence: `admin-new/src/admin/AdminRoutes.tsx`)
- Admin Routing → Lead Overview: routes overview (evidence: `admin-new/src/admin/AdminRoutes.tsx`)
- Admin Routing → Analytics: routes analytics (evidence: `admin-new/src/admin/AdminRoutes.tsx`)
- Admin Routing → Project Admin: routes projects (evidence: `admin-new/src/admin/AdminRoutes.tsx`)
- Analysis Dashboard → Combined NLP: analyzes transcript (evidence: `dashboard/app.py`)
- Analysis Dashboard → Lead Scoring: scores transcript (evidence: `dashboard/app.py`)
