π Live Demo: ai-powered-property-price-predictor.vercel.app β
βοΈ API: estatelens-backend.onrender.com/docs β
Pune EstateLens is a production-grade, full-stack AI web application that delivers real-time residential property price predictions across Pune's two fastest-growing real estate corridors. The system combines an XGBoost machine learning model with a modern React frontend, a FastAPI REST backend, and MongoDB Atlas for persistent prediction analytics.
Built as a complete end-to-end ML product β from data generation and model training to cloud deployment with a premium UI.
| Corridor | Direction | Key Localities |
|---|---|---|
| Dehu Road β Solapur Road | West β Southeast | Dehu Road, Kiwale, Ravet, Hadapsar, Manjri, Loni Kalbhor, Uruli Kanchan |
| Kolhapur Road β Nashik Road | South β North | Katraj, Khed Shivapur, Bhosari, Chakan, Moshi, Alandi |
These two corridors represent Pune's highest infrastructure investment zones (metro, IT parks, ring roads), making them ideal for property price modeling.
The core feature. Enter property specifications and receive an instant AI-generated valuation.
Inputs accepted:
- Growth corridor (Dehu-Solapur vs Kolhapur-Nashik)
- Locality (dynamically populated based on corridor)
- BHK configuration (1β4 BHK)
- Total area in sq.ft. (300β3500)
- Number of bathrooms (1β4)
- Floor level (0β30)
- Amenities: Parking, Gym, Swimming Pool, Garden, Security, Clubhouse
Output delivered:
- π° Predicted price in βΉ Lakhs (e.g., βΉ72.5L)
- π Price per sq.ft. (e.g., βΉ7,631/sqft)
- π― Confidence band (Β±8% range: e.g., βΉ66.7L β βΉ78.3L)
- π Market comparison charts (BHK trends, locality benchmarks, amenity impact)
- Leaflet.js powered dark-mode map with CartoDB DarkMatter tiles
- Toggle between both corridors with visual route overlays
- Custom glowing markers for each locality
- Click markers to see locality-level price statistics
- Configure two properties independently, each with their own corridor and locality
- Side-by-side valuation results with price, per-sqft rate, and confidence bands
- Comparison Dashboard appears after both predictions:
- Summary banner with price difference (βΉL and %), rate comparison
- Bar chart comparing predicted prices
- Radar chart comparing feature profiles (BHK, area, floor, amenities)
- Confidence band overlap visualization
- Full factor breakdown table with impact explanations
- "Why the price difference?" dynamic explanation section
- All predictions are automatically logged to MongoDB Atlas
- Scatter chart showing Price vs. Area correlation colored by corridor
- Side-by-side corridor comparison cards with average predicted price, count, min/max
- Full sortable prediction table with timestamp, locality, BHK, floor, amenities, price
- Upload a new
.csvdataset to retrain the XGBoost model live - Safe Fallback system: staging environment used before live swap β if training fails, previous model stays live (zero downtime)
- Post-retraining metrics (RΒ², RMSE) displayed instantly
- Required CSV schema documented in the UI
- Immersive 100vh scrolling hero landing page
- Professionally designed Charcoal and Amber dark mode aesthetic
- Seamless glassmorphism interface components with interactive hover states
- Built-in "Market Aesthetics" luxury architectural gallery
The model is trained on a synthetic dataset of 2,000+ Pune residential property records generated using realistic pricing distributions based on Pune's actual real estate market dynamics (corridor premiums, locality tiers, amenity multipliers, floor pricing).
| Field | Type | Description |
|---|---|---|
corridor |
categorical | dehu_solapur or kolhapur_nashik |
locality |
categorical | One of 13 localities |
bhk |
integer | Bedroom count (1β4) |
sqft |
integer | Total carpet area (300β3500) |
bathrooms |
integer | Bathroom count (1β4) |
floor |
integer | Floor level (0β30) |
parking |
binary | 0 or 1 |
gym |
binary | 0 or 1 |
swimming_pool |
binary | 0 or 1 |
garden |
binary | 0 or 1 |
security |
binary | 0 or 1 |
clubhouse |
binary | 0 or 1 |
amenities_score |
integer | Sum of all amenity flags (derived) |
price_lakhs |
float | Target variable |
Built using scikit-learn's Pipeline + ColumnTransformer:
Raw Input (13 features)
β
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β ColumnTransformer β
β ββββββββββββββββββββ ββββββββββββ β
β β OneHotEncoder β β Standard β β
β β (corridor, β β Scaler β β
β β locality) β β(numeric β β
β ββββββββββββββββββββ β features)β β
β ββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β XGBRegressor β
β n_estimators=500, max_depth=7 β
β learning_rate=0.05, subsample=0.8 β
β colsample_bytree=0.8 β
β reg_alpha=0.1, reg_lambda=1.0 β
ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
prediction (βΉ Lakhs)
| Metric | Train | Test |
|---|---|---|
| RΒ² Score | ~0.97 | ~0.91 |
| RMSE | ~5.2L | ~8.4L |
| MAE | ~3.8L | ~6.1L |
| 5-Fold CV RΒ² | 0.91 Β± 0.02 | β |
| Property | Benefit |
|---|---|
| Handles mixed feature types | Both categorical (locality, corridor) and numeric (sqft, floor) natively |
| Non-linear relationships | Floor-price interactions, locality premiums, amenity stacking effects |
| Robust to outliers | Real estate data inherently has premium outliers |
| Feature importance | Can explain which features drive the price most |
| Fast inference | Sub-millisecond predictions suitable for real-time API responses |
The system reports a Β±8% confidence interval around every prediction. This is the empirically observed MAPE (Mean Absolute Percentage Error) of the model on the test set, providing users with realistic uncertainty bounds rather than false precision.
| Layer | Technology | Version | Purpose |
|---|---|---|---|
| Frontend Framework | React | 19 | Component-based SPA |
| Build Tool | Vite | 8 | Dev server + production bundler |
| Styling | Tailwind CSS | 3 | Utility-first design system |
| Charts | Recharts | 3 | Interactive data visualization |
| Maps | React Leaflet | 5 | Corridor map with markers |
| Icons | Lucide React | 1.8 | Consistent icon system |
| Routing | React Router | 7 | SPA client-side routing |
| Backend | FastAPI | 0.115 | Async REST API |
| ML Model | XGBoost | 2+ | Gradient boosted regression |
| ML Pipeline | Scikit-learn | 1.8 | Preprocessing + pipeline |
| Database | MongoDB Atlas | β | Prediction log persistence |
| DB Driver | PyMongo | 4.16 | MongoDB Python driver |
| Data | Pandas + NumPy | β | Data manipulation |
| Deployment | Render + Vercel | β | Cloud hosting |
Base URL (production): https://estatelens-backend.onrender.com
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET |
/api/health |
None | Server health + MongoDB status |
GET |
/api/meta |
None | Available corridors and localities |
POST |
/api/predict |
None | Get AI price prediction |
POST |
/api/compare |
None | Compare same property across corridors |
GET |
/api/stats |
None | Market statistics (avg price per locality, BHK) |
GET |
/api/amenity-impact |
None | Price premium per amenity type |
GET |
/api/history |
None | Last 50 predictions from MongoDB |
GET |
/api/history/corridor-stats |
None | Corridor aggregation from history |
POST |
/api/retrain |
None | Upload CSV to retrain model |
POST /api/predict
{
"corridor": "dehu_solapur",
"locality": "Hadapsar",
"bhk": 2,
"sqft": 950,
"bathrooms": 2,
"floor": 5,
"parking": 1,
"gym": 1,
"swimming_pool": 0,
"garden": 0,
"security": 1,
"clubhouse": 0
}{
"predicted_price_lakhs": 72.5,
"price_per_sqft": 7631.0,
"corridor": "dehu_solapur",
"locality": "Hadapsar",
"confidence_band": { "low": 66.7, "high": 78.3 },
"input_summary": {
"bhk": 2,
"sqft": 950,
"bathrooms": 2,
"floor": 5,
"amenities_score": 3
}
}AI-Powered-Property-Price-Predictor/
β
βββ backend/ # FastAPI Python backend
β βββ data/
β β βββ generate_dataset.py # Synthetic data generator
β β βββ pune_properties.csv # 2000+ row training dataset
β βββ model/
β β βββ train_model.py # XGBoost training pipeline
β β βββ xgb_pipeline.joblib # Serialized trained model (2.1 MB)
β β βββ model_meta.json # Corridors & localities metadata
β β βββ metrics.json # Training & evaluation metrics
β βββ database.py # MongoDB connection module (graceful degradation)
β βββ main.py # FastAPI app with all endpoints
β βββ requirements.txt # All Python dependencies
β βββ .env # Local env vars (gitignored β never committed)
β
βββ frontend/ # React + Vite frontend
β βββ public/
β β βββ favicon.svg
β βββ src/
β β βββ components/
β β β βββ Header.jsx # App header with branding
β β β βββ Footer.jsx # Footer with GitHub CTA
β β β βββ Dashboard.jsx # Market charts component
β β β βββ PredictionForm.jsx # Property input form
β β β βββ PredictionResult.jsx # Result display card
β β βββ pages/
β β β βββ PredictPage.jsx # Main valuation page
β β β βββ MapPage.jsx # Interactive map with corridors
β β β βββ ComparePage.jsx # Corridor comparison with visualizations
β β β βββ HistoryPage.jsx # MongoDB prediction history
β β β βββ AdminPage.jsx # Model retraining dashboard
β β βββ api.js # Centralized API service layer
β β βββ App.jsx # Root with routing & navigation
β β βββ index.css # Design system (Tailwind + custom tokens)
β β βββ main.jsx # Entry point
β βββ vercel.json # SPA routing rewrites for Vercel
β βββ package.json
β βββ vite.config.js
β
βββ sample_data.csv # CSV template for model retraining
βββ .gitignore
βββ README.md
- Python 3.9+
- Node.js 18+
- MongoDB Atlas account (free M0 cluster)
git clone https://github.com/ranvirdeshmukh2004/AI-Powered-Property-Price-Predictor.git
cd AI-Powered-Property-Price-Predictor# Install dependencies
pip install -r backend/requirements.txt
# Configure MongoDB (edit this file with your Atlas URI)
# backend/.env β MONGODB_URI=mongodb+srv://user:pass@cluster.mongodb.net/?appName=Cluster0
# Start API server
cd backend
python3 -m uvicorn main:app --reload --port 8000Backend runs at: http://localhost:8000 | Swagger UI: http://localhost:8000/docs
cd frontend
npm install
npm run devFrontend runs at: http://localhost:5173 (or next available port)
| Field | Value |
|---|---|
| Root Directory | backend |
| Build Command | pip install -r requirements.txt |
| Start Command | uvicorn main:app --host 0.0.0.0 --port $PORT |
| Environment Var | MONGODB_URI = your Atlas URI |
| Field | Value |
|---|---|
| Root Directory | frontend |
| Framework | Vite (auto-detected) |
| Build Command | npm run build |
| Output Directory | dist |
| Environment Var | VITE_API_BASE_URL = https://your-render-url.onrender.com/api |
| Decision | Rationale |
|---|---|
.env is gitignored |
MongoDB credentials never enter version control |
| MongoDB write is fire-and-forget | A DB failure never blocks or delays the prediction response |
| Safe fallback retraining | Staging environment used before live swap β guarantees zero downtime |
CORS allow_origins=["*"] |
Permissive for demo; should be locked to Vercel domain in production |
| XGBoost serialized with joblib | Committed to repo so Render doesn't need to retrain on every deploy |
Pune EstateLens β Production-Grade AI Property Intelligence
Live App β β’
API Docs β β’
Source Code β