Real estate scraper and visualization tool for nehnutelnosti.sk with multi-objective optimization (Pareto-optimal solutions).
- Web Scraping: Automated scraping of flats and houses from nehnutelnosti.sk
- Interactive Map: Leaflet map with marker clustering showing all properties
- Pareto Optimization: Highlights properties that are Pareto-optimal based on:
- Minimize price
- Minimize price per m²
- Maximize rooms
- Maximize year built
- Filtering: Filter by type, price, rooms, area, year, and map bounds
- Geocoding: Automatic geocoding of addresses using Nominatim (with caching)
- Scheduled Scraping: Optional scheduled scraping via APScheduler
docker-compose up --buildServices:
- API: http://localhost:8000/docs (FastAPI Swagger UI)
- Web: http://localhost:5173 (React frontend)
- Database: PostgreSQL on port 5432
Create a .env file (optional):
POSTGRES_USER=opti
POSTGRES_PASSWORD=opti
POSTGRES_DB=optihome
CORS_ORIGINS=http://localhost:5173
VITE_API_BASE_URL=http://localhost:8000
# Scheduler (optional)
ENABLE_SCHEDULER=false
SCHEDULE_HOUR=2
SCHEDULE_MINUTE=0
SCRAPE_PAGES_PER_RUN=5Trigger scraping via API:
# Scrape flats (2 pages)
curl -X POST "http://localhost:8000/scrape/run?kind=flat&pages=2"
# Scrape houses (1 page)
curl -X POST "http://localhost:8000/scrape/run?kind=house&pages=1"GET /properties- List properties with filtersGET /properties/{id}- Get property detailsGET /properties/pareto- Get Pareto-optimal propertiesPOST /scrape/run- Trigger scraping
docker compose exec backend pytest- Backend: FastAPI + SQLAlchemy + PostgreSQL
- Frontend: React + TypeScript + Vite + Leaflet
- Scraping: BeautifulSoup4 + httpx with rate limiting
- Geocoding: Nominatim with database caching
- Scheduler: APScheduler for periodic scraping
cd backend
pip install -r requirements.txt
uvicorn app.main:app --reloadcd frontend
npm install
npm run dev