A full-stack AI-powered real estate analytics platform that processes property data and provides intelligent insights using natural language queries.
π Live Demo:
- Frontend: https://real-estate-chatbot-hbzp.vercel.app/
- Backend API: https://real-estate-chatbot-ev0r.onrender.com/
- π Overview
- β¨ Features
- ποΈ Technology Stack
- π Project Structure
- π Quick Start
- π§ Detailed Setup
- π‘ API Documentation
- π§ AI Integration
- π’ Deployment
- π Security
- π€ Contributing
- π License
The Real Estate Analysis Chatbot is a modern web application that helps users analyze real estate market data through intelligent queries. Upload your property dataset (Excel/CSV) and ask questions like:
"Analyze Wakad" β Get AI-powered insights, price trends, and detailed analytics
- π Analyze property data by area/locality
- π€ AI-generated market insights using GPT-4o
- π Interactive price trend charts
- π Detailed data tables with filters
- π€ Support for Excel (.xlsx, .xls) and CSV files
- π― Up to 100MB file uploads
- Upload Excel (.xlsx, .xls) or CSV files
- Automatic column detection (Area, Price, Year)
- Support for files up to 100MB
- Sample area suggestions from uploaded data
- Natural language query processing
- Area-based data filtering
- Smart column detection (handles variations like "locality", "location", "region")
- Real-time analysis results
- Price Trends Chart: View price evolution over time
- Interactive Charts: Built with Recharts for responsive design
- Data Tables: Display detailed property information with formatting
- Integration with OpenAI GPT-4o-mini
- Context-aware market analysis
- Investment recommendations
- Trend analysis and market strength assessment
- Fallback to rule-based insights if API unavailable
- CORS configured for cross-origin requests
- CSRF protection enabled
- Environment variables for sensitive data
- No hardcoded API keys
| Layer | Technology |
|---|---|
| Frontend | React 19, Bootstrap 5, Recharts, Axios |
| Backend | Django 5, Django REST Framework, pandas, openpyxl |
| AI/ML | OpenAI GPT-4o-mini |
| Database | SQLite (development), PostgreSQL (production-ready) |
| File Processing | pandas, openpyxl |
| Deployment | Vercel (frontend), Render.com (backend) |
| Styling | Bootstrap 5 CSS |
real-estate-chatbot/
β
βββ backend/ # Django Backend
β βββ realestate_backend/ # Project settings
β β βββ settings.py # Configuration & CORS
β β βββ urls.py # URL routing
β β βββ wsgi.py # WSGI application
β β βββ asgi.py # ASGI application
β β
β βββ api/ # API Application
β β βββ views.py # API endpoints
β β βββ urls.py # API routes
β β βββ models.py # Data models
β β βββ migrations/ # Database migrations
β β
β βββ manage.py # Django CLI
β βββ requirements.txt # Python dependencies
β βββ db.sqlite3 # Development database
β
βββ frontend/ # React Frontend
β βββ public/ # Static files
β β βββ index.html # HTML entry point
β β
β βββ src/ # Source code
β β βββ App.js # Main React component
β β βββ App.css # Application styles
β β βββ config.js # Configuration
β β βββ index.js # React entry point
β β βββ .env # Environment variables
β β
β βββ package.json # Node dependencies
β βββ README.md # Frontend documentation
β
βββ data/ # Sample datasets
β βββ Sample_data.xlsx # Example Excel file
β
βββ docs/ # Documentation files
β βββ LOCAL_TESTING_GUIDE.md # Testing instructions
β βββ SYNC_DEPLOYMENT_GUIDE.md # Deployment guide
β βββ QUICK_REFERENCE.md # Quick reference card
β βββ SYNC_SUMMARY.md # Summary of changes
β
βββ .gitignore # Git ignore rules
βββ render.yaml # Render.com configuration
βββ README.md # This file
βββ CONTRIBUTING.md # Contribution guidelines
βββ LICENSE # MIT License
- Python 3.8+
- Node.js 14+
- Git
- (Optional) OpenAI API key for AI features
git clone https://github.com/yourusername/real-estate-chatbot.git
cd real-estate-chatbot# Navigate to backend
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create .env file
echo "OPENAI_API_KEY=your-api-key-here" > .env
# Run migrations
python manage.py migrate
# Start server
python manage.py runserver 0.0.0.0:8000Backend runs at: http://127.0.0.1:8000
# In a new terminal, navigate to frontend
cd frontend
# Create .env file
echo "REACT_APP_API_URL=http://127.0.0.1:8000" > .env
# Install dependencies
npm install
# Start development server
npm startFrontend runs at: http://localhost:3000
- Open http://localhost:3000 in your browser
- Upload
data/Sample_data.xlsx - Enter a query like "Analyze Wakad"
- View results with AI insights, charts, and data
File: backend/realestate_backend/settings.py
Key configurations:
- β CORS enabled for frontend domain
- β File upload limits: 100MB
- β CSRF protection configured
- β OpenAI integration ready
Environment Variables:
# Required for production
OPENAI_API_KEY=sk-your-api-key
DEBUG=False
# Optional
DJANGO_SECRET_KEY=your-secret-key
ALLOWED_HOSTS=yourdomain.comFile: frontend/.env
# Backend API URL
REACT_APP_API_URL=http://127.0.0.1:8000 # Development
REACT_APP_API_URL=https://your-backend.onrender.com # ProductionGET /api/health/Response:
{
"status": "Backend is running with AI! π€"
}POST /api/upload/
Content-Type: multipart/form-data
file: <Excel or CSV file>Success Response (200):
{
"message": "File uploaded successfully!",
"rows": 1000,
"columns": ["Area", "Price", "Year", "BHK"],
"sample_areas": ["Wakad", "Aundh", "Baner", "Viman Nagar", "Koregaon Park"]
}Error Response (400):
{
"error": "Please upload Excel (.xlsx, .xls) or CSV file"
}POST /api/analyze/
Content-Type: application/json
{
"query": "Analyze Wakad"
}Success Response (200):
{
"summary": "ποΈ Real Estate Analysis for Wakad\n\nπ Quick Stats:\nβ’ Properties Analyzed: 125\nβ’ Average Price: βΉ5,250,000\nβ’ Latest Data: 2024\n\nπ€ AI Analysis:\n[Generated insights...]",
"chart_data": [
{
"area": "Wakad",
"year": 2020,
"price": 5000
},
{
"area": "Wakad",
"year": 2021,
"price": 5200
}
],
"table_data": [
{
"Area": "Wakad",
"Price": 5000000,
"Year": 2020,
"BHK": 2
}
]
}Error Response (400):
{
"error": "Please upload a file first"
}-
Get API Key:
- Visit https://platform.openai.com/api-keys
- Create new secret key
- Copy and save securely
-
Configure Backend:
# backend/.env OPENAI_API_KEY=sk-your-actual-key
-
How It Works:
- Extracts area data from uploaded file
- Creates contextual prompt with statistics
- Calls GPT-4o-mini for market analysis
- Returns AI-generated insights with formatting
If OpenAI API fails or key is missing:
- System falls back to rule-based analysis
- Provides basic market strength assessment
- No interruption to user experience
-
Connect Repository
- Push code to GitHub
- Go to https://vercel.com
- Import repository
-
Configure Environment
- Settings β Environment Variables
- Add:
REACT_APP_API_URL=https://your-backend-url
-
Deploy
- Vercel auto-deploys on push
- Preview URL provided
-
Create Service
- Go to https://render.com
- Create new "Web Service"
- Connect GitHub repository
-
Configure
- Build Command:
pip install -r requirements.txt && python manage.py migrate - Start Command:
gunicorn realestate_backend.wsgi:application - Add Environment Variables:
OPENAI_API_KEY=your-key DEBUG=False ALLOWED_HOSTS=your-render-url.onrender.com
- Build Command:
-
Deploy
- Click Deploy
- Monitor build in dashboard
- Test file upload on production
- Verify AI insights generation
- Check CORS settings match frontend URL
- Monitor error logs
- Test all API endpoints
β Do's:
- Use environment variables for secrets
- Keep
.envin.gitignore - Rotate API keys regularly
- Use HTTPS in production
- Validate file uploads
- Implement rate limiting
β Don'ts:
- Hardcode API keys in code
- Commit
.envfiles - Use development keys in production
- Allow large file uploads without limits
- Skip CORS configuration
- Expose sensitive data in logs
# settings.py
CORS_ALLOWED_ORIGINS = [
"https://your-frontend.vercel.app",
"https://your-backend.onrender.com",
]
CORS_ALLOW_ALL_ORIGINS = False # Restrictive approach- Maximum 100MB file size
- Only accept
.xlsx,.xls,.csv - Files stored in temporary memory
- No persistent file storage
See CONTRIBUTING.md for detailed guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
# Create branch
git checkout -b feature/your-feature
# Make changes and test locally
npm test # Frontend
python manage.py test # Backend
# Commit and push
git add .
git commit -m "feat: add your feature"
git push origin feature/your-feature
# Create Pull Request on GitHubThis project is licensed under the MIT License - see LICENSE file for details.
Original Author: Vighnesh Tule
- GitHub: @vighneshtule
- Email: vighnesh@example.com
Contributors: See CONTRIBUTING.md for contribution guidelines
- Django & Django REST Framework team
- React community
- OpenAI for GPT-4o API
- Render.com and Vercel for hosting
- Bootstrap for UI framework
- Recharts for visualization
- π Documentation: Check docs/ folder
- π Report Bug: Open an issue on GitHub
- π‘ Feature Request: Create a new discussion
- π§ Contact: vighnesh@example.com
| Issue | Solution |
|---|---|
| CORS error | Check CORS_ALLOWED_ORIGINS in settings.py |
| File upload fails | Verify file format (.xlsx, .xls, .csv) |
| AI insights not showing | Check OpenAI API key and credits |
| Charts not displaying | Check browser console for errors |
- User authentication & accounts
- Saved analysis history
- Advanced filtering options
- Multi-language support
- Mobile app
- Real-time data integration
- Predictive analytics
- Export to PDF
Built with β€οΈ for real estate professionals and data enthusiasts
Owner : Vighnesh Tule https://github.com/vighneshtule
Last Updated: December 2025