Skip to content

yasaminashoori/DivarAnalyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏠 Divar Real Estate Analyzer

Live Demo .NET JavaScript License

A powerful web-based tool for analyzing Tehran real estate market data from Divar.ir

Discover market trends β€’ Analyze property prices β€’ Visualize data insights


See online:

https://divarrealstatesinthesedays.netlify.app/

✨ Features

πŸ“Š Comprehensive Data Analysis

  • Real-time property data processing
  • Interactive filtering by date, district, and price ranges
  • Advanced statistical metrics and market insights
  • Trend analysis with growth calculations

πŸ“ˆ Rich Visualizations

  • Time Series Charts: Track property listings over time
  • Price Distribution: Compare average prices across districts
  • Interactive Maps: Geographic visualization with Leaflet
  • Statistical Dashboard: Key market indicators at a glance

🎯 Smart Filtering

  • Date range selection with Persian calendar support
  • District-based filtering (Districts 1, 2, 3, 6, 15)
  • Real-time data updates
  • Export filtered results to CSV

🌍 User Experience

  • Responsive design for all devices
  • Persian/Farsi number formatting
  • Dark theme with modern UI
  • Fast client-side processing

πŸš€ Quick Start

🌐 Try Online

Visit the live demo: divarrealstatesinthesedays.netlify.app

πŸ’» Local Development

Prerequisites:

Installation:

# Clone the repository
git clone https://github.com/yourusername/divar-analyzer.git
cd divar-analyzer

# Navigate to backend
cd Backend/DivarAnalyzer

# Restore dependencies
dotnet restore

# Run the application
dotnet run

# Open browser
# Navigate to https://localhost:5001

Using Docker Compose

docker compose up --build

πŸ“± How to Use

1. Load Data

🎯 Click "Click to load sample data" to generate demo data
πŸ“ Or upload your own CSV file with property listings

2. Apply Filters

πŸ“… Set date ranges using the date pickers
🏘️ Select specific districts (1, 2, 3, 6, 15)
πŸ” Filter by price ranges and property types

3. Analyze & Visualize

πŸ“Š Click "Analyze" to generate comprehensive analysis
πŸ“ˆ View interactive charts and market trends
πŸ—ΊοΈ Explore geographic distribution on the map
πŸ“‹ Review detailed statistics and insights

4. Export Results

πŸ’Ύ Download filtered data as CSV
πŸ“‘ Generate detailed market reports
πŸ“Š Share analysis results

πŸ—οΈ Architecture

Backend Stack

🎯 ASP.NET Core 8.0        # Web API Framework
πŸ“„ CsvHelper              # CSV Processing
🌐 AngleSharp             # Web Scraping
πŸ“Š System.Text.Json       # JSON Serialization
πŸ—„οΈ Entity Framework       # Data Access (Future)

Frontend Stack

⚑ Vanilla JavaScript      # Core Logic
πŸ“Š Chart.js               # Interactive Charts
πŸ—ΊοΈ Leaflet               # Interactive Maps
πŸ“„ PapaParse              # CSV Processing
🎨 Custom CSS             # Modern UI Design

Key Components

  • DivarDataAnalyzer: Core analysis engine
  • DivarScraper: Data collection service
  • DivarController: RESTful API endpoints
  • Interactive Dashboard: Real-time visualization

🎯 API Reference

Core Endpoints

GET  /api/divar/sample-data?count=100

Generate sample real estate data for testing

POST /api/divar/analyze
Content-Type: application/json

{
  "data": [...],
  "fromDate": "2024-01-01",
  "toDate": "2024-12-31",
  "district": "all"
}
POST /api/divar/export-csv
Content-Type: application/json

[...propertyData]

Response Format

{
  "success": true,
  "data": {
    "rawData": [...],
    "aggregatedData": [...],
    "metrics": {
      "totalListings": 1250,
      "avgTotal": 15000000000,
      "avgSqm": 85000000
    },
    "insights": [...]
  },
  "message": "Analysis completed successfully"
}

πŸ“Š Data Model

RealEstateData

public class RealEstateData
{
    public DateTime ScrapedDate { get; set; }
    public string District { get; set; }
    public int? Size { get; set; }
    public long? TotalPrice { get; set; }
    public long? PricePerSqm { get; set; }
    public double? Latitude { get; set; }
    public double? Longitude { get; set; }
    public string Title { get; set; }
    public int? Age { get; set; }
}

Supported Districts

  • District 1: Shemiran (Ψ΄Ω…ΫŒΨ±Ψ§Ω†)
  • District 2: Vanak (ΩˆΩ†Ϊ©)
  • District 3: Zaferaniyeh (Ψ²ΨΉΩΨ±Ψ§Ω†ΫŒΩ‡)
  • District 6: Yusefabad (ΫŒΩˆΨ³Ωβ€ŒΨ’Ψ¨Ψ§Ψ―)
  • District 15: Shahrak (Ψ΄Ω‡Ψ±Ϊ©)

πŸ”§ Configuration

Backend Settings (appsettings.json)

{
  "DivarScraper": {
    "RequestDelayMs": 2000,
    "MaxRetryAttempts": 3,
    "RateLimitPerMinute": 30
  },
  "DataAnalysis": {
    "MaxRecordsPerAnalysis": 50000,
    "DefaultSampleSize": 100,
    "BaselineDate": "2024-06-12"
  }
}

πŸš€ Deployment

Frontend (Netlify)

The frontend is deployed on Netlify with automatic builds:

Backend Deployment Options

# Azure App Service
az webapp up --name divar-analyzer --resource-group myResourceGroup

# Docker
docker build -t divar-analyzer .
docker run -p 5000:5000 divar-analyzer

# Railway/Heroku
git push railway main

πŸ“ˆ Features Roadmap

Phase 1 βœ…

  • Basic data analysis and visualization
  • Interactive charts and maps
  • CSV export functionality
  • Responsive design

Phase 2

  • Real-time data scraping
  • Advanced filtering options
  • Price prediction models
  • Historical trend analysis

Phase 3

  • User authentication
  • Saved searches and alerts
  • API rate limiting
  • Chatbot using LLM Agent for asking about the infrmations
  • Database integration

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow C# coding conventions
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation

πŸ™ Acknowledgments


πŸ“ž Support


GitHub stars GitHub forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •