Skip to content

Praashon/Real-Estate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ˜๏ธ Real Estate App - Django Property Management Platform

Django Python Channels Redis AI

An intelligent real estate platform with AI-powered search and real-time chat

Demo | Documentation | Report Bug

๐Ÿ“‹ Overview

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.

โœจ Key Features

Property Management

  • ๐Ÿ  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

AI & Machine Learning

  • ๐Ÿค– 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

Real-Time Features

  • ๐Ÿ’ฌ 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

User Management

  • ๐Ÿ” 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

Admin Panel

  • ๐Ÿ“Š 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

๐Ÿ› ๏ธ Tech Stack

Backend

  • 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

AI/ML Stack

  • 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

Additional Technologies

  • 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

๐Ÿ“ฆ Installation

Prerequisites

  • Python 3.10 or higher
  • Redis server
  • PostgreSQL or SQLite
  • pip package manager
  • Virtual environment (recommended)

Setup Instructions

  1. Clone the Repository
git clone https://github.com/yourusername/real-estate-app.git
cd Real-Estate/real_estate_app
  1. Create Virtual Environment
python -m venv venv

# Windows
venv\Scripts\activate

# Linux/Mac
source venv/bin/activate
  1. Install Dependencies
pip install -r requirements.txt
  1. 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
  1. Install and Start Redis

Windows:

# Download Redis for Windows or use WSL
# Or use Docker
docker run -d -p 6379:6379 redis

Linux/Mac:

# Install Redis
sudo apt-get install redis-server  # Ubuntu/Debian
brew install redis                  # macOS

# Start Redis
redis-server
  1. Run Migrations
python manage.py makemigrations
python manage.py migrate
  1. Create Superuser
python manage.py createsuperuser
  1. Load Sample Data (Optional)
python manage.py loaddata fixtures/sample_properties.json
  1. 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:application

Or use the provided batch file (Windows):

start_server.bat
  1. Access the Application
  • Main site: http://localhost:8000
  • Admin panel: http://localhost:8000/admin

๐ŸŽฏ Usage

For Property Seekers

  1. Browse Properties

    • View all available properties
    • Use filters to narrow down search
    • View detailed property information
  2. AI-Powered Search

    • Describe your ideal property in natural language
    • Get intelligent recommendations based on preferences
    • Discover similar properties
  3. Save Favorites

    • Bookmark properties you like
    • Get alerts when prices change
    • Compare saved properties
  4. Contact Agents

    • Use real-time chat to connect with agents
    • Schedule property viewings
    • Ask questions instantly

For Property Owners/Agents

  1. List Properties

    • Add new property listings
    • Upload multiple images
    • Set pricing and details
  2. Manage Listings

    • Edit property information
    • Mark as sold/rented
    • Track property views
  3. Communicate with Buyers

    • Respond to inquiries in real-time
    • Manage multiple conversations
    • Share property details

For Administrators

  1. Dashboard Access

    • Login to admin panel
    • View analytics and metrics
    • Monitor system health
  2. Content Management

    • Approve/reject listings
    • Manage user accounts
    • Moderate chat messages
  3. System Configuration

    • Configure AI models
    • Adjust search parameters
    • Set up email templates

๐Ÿ“ Project Structure

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

๐Ÿค– AI/ML Features

Property Recommendation System

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)

Semantic Search

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"

Price Prediction

ML model predicts property values based on:

  • Location
  • Size and features
  • Market trends
  • Historical data

๐Ÿ’ฌ WebSocket Chat

Setup

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)],
        },
    },
}

Consumer Example

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
            }
        )

๐Ÿš€ Deployment

Production Setup

  1. Set DEBUG to False
DEBUG = False
ALLOWED_HOSTS = ['yourdomain.com']
  1. Configure Database
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'realestate_db',
        'USER': 'your_user',
        'PASSWORD': 'your_password',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}
  1. Static Files
python manage.py collectstatic
  1. 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
  1. 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/;
    }
}

Docker Deployment

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"]

๐Ÿงช Testing

# 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 report

๐Ÿค Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Write/update tests
  5. Submit a pull request

๐Ÿ“ License

This project is licensed under the MIT License - see LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Django community for the excellent framework
  • Hugging Face for transformer models
  • Redis for caching and channels
  • PyTorch for ML capabilities

๐Ÿ“ž Support

  • ๐Ÿ“ง Email: mr.prashon@gmail.com
  • ๐Ÿ› Issues: GitHub Issues
  • ๐Ÿ“š Docs: Project Wiki

๐Ÿ”ฎ Future Enhancements

  • 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 ๐Ÿ 

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors