An intelligent real estate platform with AI-powered search and real-time chat
A comprehensive real estate management platform built with Django, featuring AI-powered property recommendations, real-time chat functionality, advanced search capabilities, and a complete admin dashboard. This application leverages machine learning for intelligent property matching and WebSocket technology for instant communication between buyers, sellers, and agents.
- ๐ Property Listings - Comprehensive property database with detailed information
- ๐ธ Image Gallery - Multiple images per property with Pillow processing
- ๐ Advanced Search - Filter by location, price, type, amenities
- ๐บ๏ธ Location Based - Geographic property search
- โญ Featured Listings - Highlight premium properties
- ๐ Property Analytics - Track views and engagement
- ๐ค Smart Recommendations - AI-powered property suggestions using:
- Sentence Transformers - Semantic similarity matching
- scikit-learn - Machine learning algorithms
- PyTorch - Deep learning models
- Hugging Face - Pre-trained models
- ๐ฏ Personalized Search - Learn from user preferences
- ๐ Price Prediction - ML-based property valuation
- ๐ฎ Trend Analysis - Market insights and predictions
- ๐ฌ Live Chat - WebSocket-based instant messaging
- ๐ Notifications - Real-time alerts for new properties
- ๐ฅ Multi-user Chat - Group conversations
- ๐ฑ Online Status - See who's available
- ๐ Auto-Updates - Live property status changes
- ๐ Authentication - Secure user registration and login
- ๐ค User Profiles - Customizable user accounts
- ๐ข Agent Profiles - Dedicated agent/realtor accounts
- ๐ Saved Properties - Bookmark favorite listings
- ๐ง Email Notifications - Property alerts and updates
- ๐ Dashboard - Comprehensive admin interface
- ๐๏ธ Property Management - CRUD operations
- ๐ฅ User Management - Manage buyers, sellers, agents
- ๐ Analytics - Sales and engagement metrics
- ๐ง System Configuration - App settings and preferences
- Django 5.2.1 - High-level Python web framework
- Django Channels 4.2 - WebSocket and async support
- Daphne 4.2 - ASGI server for Django Channels
- Redis 6.2 - In-memory data structure store for caching
- PyTorch 2.7 - Deep learning framework
- Transformers 4.52 - Hugging Face transformers
- Sentence Transformers 4.1 - Semantic text embeddings
- scikit-learn 1.6 - Machine learning library
- NumPy 2.2 - Numerical computing
- SciPy 1.15 - Scientific computing
- Pillow 11.2 - Image processing
- python-decouple 3.8 - Environment management
- Twisted 24.11 - Event-driven networking
- channels_redis 4.2 - Redis channel layer
- PyYAML 6.0 - YAML parser
- Python 3.10 or higher
- Redis server
- PostgreSQL or SQLite
- pip package manager
- Virtual environment (recommended)
- Clone the Repository
git clone https://github.com/yourusername/real-estate-app.git
cd Real-Estate/real_estate_app- Create Virtual Environment
python -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate- Install Dependencies
pip install -r requirements.txt- Configure Environment Variables
Create .env file in the project root:
# Django Settings
SECRET_KEY=your_secret_key_here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
# Database
DATABASE_URL=sqlite:///db.sqlite3
# OR PostgreSQL
# DATABASE_URL=postgresql://user:password@localhost:5432/realestate
# Redis (for Channels)
REDIS_URL=redis://localhost:6379/0
# Email Configuration
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your_email@gmail.com
EMAIL_HOST_PASSWORD=your_app_password
# AI/ML Settings
MODEL_PATH=./models/
ENABLE_ML_RECOMMENDATIONS=True- Install and Start Redis
Windows:
# Download Redis for Windows or use WSL
# Or use Docker
docker run -d -p 6379:6379 redisLinux/Mac:
# Install Redis
sudo apt-get install redis-server # Ubuntu/Debian
brew install redis # macOS
# Start Redis
redis-server- Run Migrations
python manage.py makemigrations
python manage.py migrate- Create Superuser
python manage.py createsuperuser- Load Sample Data (Optional)
python manage.py loaddata fixtures/sample_properties.json- Start the Development Server
# For development with auto-reload
python manage.py runserver
# For production-like environment
daphne -b 0.0.0.0 -p 8000 real_estate_app.asgi:applicationOr use the provided batch file (Windows):
start_server.bat- Access the Application
- Main site:
http://localhost:8000 - Admin panel:
http://localhost:8000/admin
-
Browse Properties
- View all available properties
- Use filters to narrow down search
- View detailed property information
-
AI-Powered Search
- Describe your ideal property in natural language
- Get intelligent recommendations based on preferences
- Discover similar properties
-
Save Favorites
- Bookmark properties you like
- Get alerts when prices change
- Compare saved properties
-
Contact Agents
- Use real-time chat to connect with agents
- Schedule property viewings
- Ask questions instantly
-
List Properties
- Add new property listings
- Upload multiple images
- Set pricing and details
-
Manage Listings
- Edit property information
- Mark as sold/rented
- Track property views
-
Communicate with Buyers
- Respond to inquiries in real-time
- Manage multiple conversations
- Share property details
-
Dashboard Access
- Login to admin panel
- View analytics and metrics
- Monitor system health
-
Content Management
- Approve/reject listings
- Manage user accounts
- Moderate chat messages
-
System Configuration
- Configure AI models
- Adjust search parameters
- Set up email templates
Real-Estate/
โโโ real_estate_app/
โ โโโ accounts/ # User authentication & profiles
โ โ โโโ models.py # User models
โ โ โโโ views.py # Auth views
โ โ โโโ urls.py # Auth URLs
โ โ
โ โโโ properties/ # Property listings
โ โ โโโ models.py # Property models
โ โ โโโ views.py # Property views
โ โ โโโ serializers.py # API serializers
โ โ โโโ urls.py # Property URLs
โ โ
โ โโโ chat/ # Real-time chat
โ โ โโโ consumers.py # WebSocket consumers
โ โ โโโ routing.py # WebSocket routing
โ โ โโโ models.py # Chat models
โ โ
โ โโโ search/ # Search functionality
โ โ โโโ views.py # Search views
โ โ โโโ utils.py # Search utilities
โ โ โโโ ml_engine.py # AI/ML search engine
โ โ
โ โโโ admin_panel/ # Admin dashboard
โ โ โโโ views.py # Admin views
โ โ โโโ templates/ # Admin templates
โ โ
โ โโโ core/ # Core app functionality
โ โ โโโ settings.py # Django settings
โ โ โโโ urls.py # URL configuration
โ โ โโโ asgi.py # ASGI config
โ โ โโโ wsgi.py # WSGI config
โ โ
โ โโโ templates/ # HTML templates
โ โ โโโ base.html # Base template
โ โ โโโ home.html # Homepage
โ โ โโโ properties/ # Property templates
โ โ โโโ chat/ # Chat templates
โ โ
โ โโโ static/ # Static files
โ โ โโโ css/
โ โ โโโ js/
โ โ โโโ images/
โ โ
โ โโโ media/ # User uploads
โ โ โโโ properties/ # Property images
โ โ
โ โโโ models/ # ML models (if applicable)
โ โ
โ โโโ manage.py # Django management
โ โโโ requirements.txt # Python dependencies
โ โโโ start_server.bat # Quick start script
โ โโโ .env.example # Environment template
โ
โโโ README.md # This file
The app uses advanced NLP and machine learning:
from sentence_transformers import SentenceTransformer
from sklearn.metrics.pairwise import cosine_similarity
# Load pre-trained model
model = SentenceTransformer('all-MiniLM-L6-v2')
# Generate embeddings
property_embeddings = model.encode(property_descriptions)
query_embedding = model.encode(user_query)
# Calculate similarity
similarities = cosine_similarity(query_embedding, property_embeddings)Users can search using natural language:
- "3 bedroom house near schools with a garden"
- "Modern apartment in downtown under $300k"
- "Family home with garage and pool"
ML model predicts property values based on:
- Location
- Size and features
- Market trends
- Historical data
Channels configuration in settings.py:
INSTALLED_APPS = [
# ...
'channels',
]
ASGI_APPLICATION = 'real_estate_app.asgi.application'
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {
"hosts": [('127.0.0.1', 6379)],
},
},
}from channels.generic.websocket import AsyncWebsocketConsumer
import json
class ChatConsumer(AsyncWebsocketConsumer):
async def connect(self):
self.room_name = self.scope['url_route']['kwargs']['room_name']
await self.channel_layer.group_add(
self.room_name,
self.channel_name
)
await self.accept()
async def receive(self, text_data):
data = json.loads(text_data)
message = data['message']
await self.channel_layer.group_send(
self.room_name,
{
'type': 'chat_message',
'message': message
}
)- Set DEBUG to False
DEBUG = False
ALLOWED_HOSTS = ['yourdomain.com']- Configure Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'realestate_db',
'USER': 'your_user',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '5432',
}
}- Static Files
python manage.py collectstatic- Use Gunicorn or Daphne
# Install
pip install gunicorn daphne
# Run with Daphne (for WebSockets)
daphne -b 0.0.0.0 -p 8000 real_estate_app.asgi:application
# Or Gunicorn (without WebSockets)
gunicorn real_estate_app.wsgi:application- Configure Nginx
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /ws/ {
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /static/ {
alias /path/to/staticfiles/;
}
location /media/ {
alias /path/to/media/;
}
}FROM python:3.10
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
RUN python manage.py collectstatic --noinput
EXPOSE 8000
CMD ["daphne", "-b", "0.0.0.0", "-p", "8000", "real_estate_app.asgi:application"]# Run all tests
python manage.py test
# Run specific app tests
python manage.py test properties
# Run with coverage
pip install coverage
coverage run manage.py test
coverage reportContributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Write/update tests
- Submit a pull request
This project is licensed under the MIT License - see LICENSE file for details.
- Django community for the excellent framework
- Hugging Face for transformer models
- Redis for caching and channels
- PyTorch for ML capabilities
- ๐ง Email: mr.prashon@gmail.com
- ๐ Issues: GitHub Issues
- ๐ Docs: Project Wiki
- Virtual property tours (3D/VR)
- Mortgage calculator
- Property comparison tool
- Mobile apps (iOS/Android)
- Blockchain for property records
- Advanced analytics dashboard
- Multi-language support
- Voice search
- Augmented reality previews
Built with โค๏ธ using Django, AI, and WebSockets
Find your dream property with intelligent search ๐