help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
real-estate-bot
RSK World
real-estate-bot
Real Estate Bot - Python + Flask + OpenAI + SQLite + Property Search + AI Chatbot + Viewing Scheduler
real-estate-bot
  • __pycache__
  • data
  • src
  • static
  • templates
  • tests
  • .env608 B
  • .env.example608 B
  • .gitignore2.5 KB
  • AR_VR_FEATURES.md4.2 KB
  • CREATE_RELEASE.md2.1 KB
  • FEATURES.md6.1 KB
  • INSTALL.md2 KB
  • LICENSE1.3 KB
  • README.md7.8 KB
  • RELEASE_NOTES_v1.0.0.md7.3 KB
  • SETUP_GUIDE.md10.4 KB
  • STATUS_REPORT.md11.8 KB
  • requirements-optional.txt984 B
  • requirements.txt284 B
  • run.py2.7 KB
SETUP_GUIDE.md
SETUP_GUIDE.md
Raw Download

SETUP_GUIDE.md

# 🚀 Complete Setup Guide - Real Estate Bot

## 📋 **Prerequisites Check**

### ✅ **Core Requirements**
- Python 3.8 or higher
- pip package manager
- Git (for version control)

### 🔧 **Installation Steps**

#### **1. Clone/Download Project**
```bash
# If downloading from repository
git clone <repository-url>
cd real-estate-bot

# Or navigate to existing project
cd real-estate-bot
```

#### **2. Create Virtual Environment**
```bash
# Create virtual environment
python -m venv venv

# Activate (Windows)
venv\Scripts\activate

# Activate (macOS/Linux)
source venv/bin/activate
```

#### **3. Install Dependencies**
```bash
# Install core dependencies (required)
pip install -r requirements.txt

# Install optional dependencies for advanced features
pip install -r requirements-optional.txt

# Verify installation
pip list
```

#### **4. Environment Configuration**
```bash
# Copy environment template
copy .env.example .env

# Edit .env file with your configuration
notepad .env
```

**Required Environment Variables:**
```env
# OpenAI API Configuration
OPENAI_API_KEY=your_openai_api_key_here

# Flask Configuration
FLASK_ENV=development
FLASK_DEBUG=True
SECRET_KEY=your_secret_key_here

# Database Configuration
DATABASE_URL=sqlite:///real_estate_bot.db

# Optional: External API Keys
REAL_ESTATE_API_KEY=your_real_estate_api_key_here
REAL_ESTATE_API_URL=https://api.example.com/properties

# Optional: Blockchain Configuration
WEB3_PROVIDER_URL=https://mainnet.infura.io/v3/YOUR_INFURA_KEY
```

#### **5. Database Initialization**
```bash
# The database will be automatically created on first run
# Manual database creation (optional)
python -c "
from src.database import DatabaseManager
db = DatabaseManager()
print('Database initialized successfully')
"
```

#### **6. Run Application**
```bash
# Development mode
python run.py

# Production mode
gunicorn -w 4 -b 0.0.0.0:5000 src.app:app

# Or using the run script with production settings
set FLASK_ENV=production
python run.py
```

## 🔧 **Configuration Options**

### **Development Mode**
- **Debug**: Enabled by default
- **Auto-reload**: Enabled
- **Port**: 5000 (default)
- **Host**: 0.0.0.0 (accessible from any IP)

### **Production Mode**
- **Debug**: Disabled
- **Workers**: 4 (default)
- **Port**: 5000 (configurable)
- **SSL**: Configure with SSL certificates

### **Environment Variables**
```env
# Server Configuration
FLASK_HOST=0.0.0.0
FLASK_PORT=5000
FLASK_DEBUG=False

# Database Configuration
DATABASE_PATH=data/real_estate_bot.db

# Feature Flags
ENABLE_VOICE_ASSISTANT=True
ENABLE_VIRTUAL_TOURS=True
ENABLE_PRICE_PREDICTION=True
ENABLE_BLOCKCHAIN=False

# API Configuration
OPENAI_MODEL=gpt-3.5-turbo
OPENAI_MAX_TOKENS=150
OPENAI_TEMPERATURE=0.7

# External Services
GOOGLE_PLACES_API_KEY=your_google_api_key
CRIME_API_KEY=your_crime_api_key
```

## 🚨 **Troubleshooting Guide**

### **Common Issues & Solutions**

#### **1. Import Errors**
```bash
# Error: ModuleNotFoundError
# Solution: Install missing dependencies
pip install -r requirements.txt requirements-optional.txt

# Error: Microsoft Visual C++ build tools
# Solution: Install Visual Studio Build Tools or use conda
conda install -c conda-forge flask numpy opencv
```

#### **2. Database Issues**
```bash
# Error: Permission denied
# Solution: Check directory permissions
chmod 755 data/

# Error: Database locked
# Solution: Close other database connections
python -c "
import sqlite3
conn = sqlite3.connect('data/real_estate_bot.db')
conn.close()
print('Database unlocked')
"
```

#### **3. Port Conflicts**
```bash
# Error: Port already in use
# Solution: Change port or kill process
netstat -ano | findstr :5000
# Or change port
set FLASK_PORT=5001
python run.py
```

#### **4. API Key Issues**
```bash
# Error: Invalid OpenAI API key
# Solution: Verify API key and permissions
curl -H "Authorization: Bearer YOUR_API_KEY" https://api.openai.com/v1/models

# Error: Rate limit exceeded
# Solution: Wait or upgrade plan
# Check usage at https://platform.openai.com/usage
```

#### **5. Voice Recognition Issues**
```bash
# Error: Microphone not found
# Solution: Check microphone permissions
# Test microphone
python -c "
import speech_recognition as sr
try:
with sr.Microphone() as source:
print('Microphone working:', source)
except Exception as e:
print('Microphone error:', e)
"
```

#### **6. Memory Issues**
```bash
# Error: Out of memory
# Solution: Increase memory limit or reduce batch size
export PYTHONMALLOC=debug
python run.py
```

## 🔧 **Advanced Features Setup**

### **Voice Assistant**
```bash
# Test voice recognition
python -c "
from src.voice_assistant import VoiceAssistant
from src.database import DatabaseManager

va = VoiceAssistant(None, DatabaseManager())
va.start_listening()
print('Voice assistant started')
"
```

### **Virtual Tours**
```bash
# Test 360° tour generation
python -c "
from src.virtual_tour_manager import VirtualTourManager
from src.database import DatabaseManager

vtm = VirtualTourManager(DatabaseManager())
tour_data = {
'title': 'Test Property Tour',
'scenes': [
{
'name': 'Living Room',
'type': '360_image',
'media_path': 'test_images/living_room.jpg'
}
]
}

result = vtm.create_virtual_tour(1, tour_data)
print('Tour created:', result)
"
```

### **Price Prediction**
```bash
# Test price prediction
python -c "
from src.price_prediction_engine import PricePredictionEngine
from src.database import DatabaseManager

ppe = PricePredictionEngine(DatabaseManager())
prediction = ppe.predict_property_price({
'bedrooms': 2,
'area_sqft': 1000,
'location': 'Mumbai',
'year_built': 2022
})
print('Price prediction:', prediction)
"
```

## 📱 **Mobile App Setup**

### **Android**
```bash
# Requirements for Android development
# Install Android Studio
# Set up Android SDK
# Configure Gradle
# Build APK
```

### **iOS**
```bash
# Requirements for iOS development
# Install Xcode
# Configure iOS SDK
# Set up provisioning profiles
# Build IPA
```

## 🔒 **Security Configuration**

### **SSL/HTTPS Setup**
```bash
# Generate SSL certificate
openssl req -x509 -newkey rsa:4096 -nodes -keyout key.pem -out cert.pem -days 365

# Configure Flask with SSL
python -c "
from flask import Flask
from flask_sslify import SSLify

app = Flask(__name__)
app = SSLify(app, certfile='cert.pem', keyfile='key.pem')
"
```

### **Firewall Configuration**
```bash
# Windows Firewall
netsh advfirewall firewall add rule name="Real Estate Bot" dir=in action=allow program=python

# Linux Firewall
sudo ufw allow 5000/tcp
sudo ufw reload
```

## 📊 **Performance Monitoring**

### **Health Check Endpoint**
```bash
# Test application health
curl -f http://localhost:5000/api/health

# Check system resources
python -c "
import psutil
print('CPU Usage:', psutil.cpu_percent())
print('Memory Usage:', psutil.virtual_memory().percent)
print('Disk Usage:', psutil.disk_usage('/').percent)
"
```

### **Logging Configuration**
```bash
# Enable debug logging
export FLASK_DEBUG=True
export FLASK_LOG_LEVEL=DEBUG

# Custom logging
python -c "
import logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler('app.log'),
logging.StreamHandler()
]
)
"
```

## 🌐 **Deployment Options**

### **Docker Deployment**
```dockerfile
FROM python:3.9-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .
EXPOSE 5000

CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "src.app:app"]
```

```bash
# Build and run Docker
docker build -t real-estate-bot .
docker run -p 5000:5000 real-estate-bot
```

### **Cloud Deployment**
```bash
# Heroku
heroku create real-estate-bot
heroku config:set FLASK_ENV=production
git push heroku main

# AWS Elastic Beanstalk
eb init -p python-3.9
eb create real-estate-bot-production
eb deploy
```

## 📚 **API Documentation**

### **Available Endpoints**
```
GET / # Main interface
POST /api/chat # Chat messages
POST /api/properties/search # Property search
GET /api/properties/<id> # Property details
POST /api/appointments/schedule # Schedule viewing
GET /api/appointments/<user_id> # User appointments
POST /api/inquiries/submit # Submit inquiry
POST /api/image/enhance # Enhance images
POST /api/virtual-tour/start # Start virtual tour
GET /api/market/analysis/<location> # Market analysis
```

### **API Usage Examples**
```bash
# Property search
curl -X POST http://localhost:5000/api/properties/search \
-H "Content-Type: application/json" \
-d '{"location": "Mumbai", "bedrooms": 2}'

# Chat with bot
curl -X POST http://localhost:5000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Show me 2BHK apartments in Mumbai"}'

# Price prediction
curl -X POST http://localhost:5000/api/price/predict \
-H "Content-Type: application/json" \
-d '{"property_data": {"bedrooms": 2, "area_sqft": 1000}}'
```

## 🎯 **Success Verification**

### **Application Health Check**
```bash
# Test all major features
python -c "
import requests
import json

# Test basic functionality
response = requests.get('http://localhost:5000')
print('Status Code:', response.status_code)

# Test API endpoints
try:
chat_response = requests.post('http://localhost:5000/api/chat',
json={'message': 'test'})
print('Chat API:', chat_response.status_code)
except:
print('Chat API: Failed')

print('Application is running correctly!')
"
```

---

## 📞 **Support & Help**

### **Getting Help**
- **Documentation**: Check `README.md` and `FEATURES.md`
- **Issues**: Check `SETUP_GUIDE.md` troubleshooting section
- **Community**: Visit https://rskworld.in for support

### **Contact Information**
- **Email**: info@rskworld.com
- **Phone**: +91 93305 39277
- **Website**: https://rskworld.in
- **Support**: support@rskworld.com

---

**© 2026 RSK World. All rights reserved.**
*Developed by Molla Samser | Designed & Tested by Rima Khatun*

**🚀 Your Real Estate Bot is now ready for deployment!**

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer