A comprehensive web scraping pipeline and frontend for aggregating real estate listings from Latvia's top property websites.
ProScrape/
βββ spiders/ # Scrapy spiders for data collection
βββ models/ # Pydantic data models
βββ api/ # FastAPI backend application
βββ frontend/ # SvelteKit frontend application
βββ tasks/ # Celery task queue
βββ utils/ # Database, proxies, normalization
βββ config/ # Environment configuration
- ss.com/en/real-estate/ - Static HTML scraping with BeautifulSoup/XPath
- city24.lv/en/ - Dynamic JavaScript scraping with Playwright
- pp.lv/lv/landing/nekustamais-ipasums - Dynamic JavaScript scraping with Playwright
- Scrapy Spiders - All three site scrapers implemented and tested
- FastAPI API - Full REST API with pagination, filtering, export
- MongoDB Storage - Atlas cluster with data validation
- Celery Tasks - Background job processing with Redis
- Proxy Rotation - Intelligent proxy health monitoring
- Error Handling - Dead letter queues and alerting system
- WebSocket Support - Real-time updates for live data
- SvelteKit + TypeScript - Modern web framework setup
- TailwindCSS - Responsive design system
- API Integration - Full REST client and WebSocket manager
- Component Library - Listing cards, grids, layout components
- Type Safety - Complete TypeScript coverage
- Development Ready - Environment configuration and build system
# Install dependencies
pip install -r requirements.txt
python -m playwright install chromium
# Start services
start_redis.bat # Redis server
python run.py api # FastAPI server
python run.py worker # Celery worker
python run.py beat # Celery scheduler
# Test scrapers
python -m scrapy crawl ss_spider
python -m scrapy crawl city24_spider
python -m scrapy crawl pp_spidercd frontend
npm install
npm run dev # Development server on :3000# Backend (.env)
MONGODB_URL=mongodb+srv://...
REDIS_URL=redis://localhost:6379
LOG_LEVEL=INFO
# Frontend (frontend/.env)
VITE_API_URL=http://localhost:8000
VITE_WS_URL=ws://localhost:8000/wsGET /- API rootGET /health- Health checkGET /listings- Paginated listings with filtersGET /listings/{id}- Individual listing detailsGET /listings/search- Text searchGET /stats- Database statistics
WebSocket /ws- Live listing updatesGET /export/csv- CSV export with filteringGET /export/json- JSON export with filtering
GET /proxy/stats- Proxy health statisticsGET /monitoring/health- System health checkGET /monitoring/alerts- Alert system status
- Homepage - Hero section with search and stats
- Listings Page - Grid/list view with infinite scroll
- Navigation - Responsive header with mobile menu
- Property Cards - Rich display with images and details
- Loading States - Skeleton screens and error handling
- Type Safety - Full TypeScript integration
- Advanced Search - Multi-criteria filtering interface
- Individual Listings - Detailed property pages with galleries
- Map Integration - Leaflet-based geographic search
- User Preferences - Saved listings and alerts
- Real-time Updates - WebSocket integration for live data
python test_connection.py # MongoDB connectivity
python test_celery_worker.py # Celery worker health
pytest tests/ # Unit testscd frontend
npm run dev # Development server
npm run build # Production build
npm run check # Type checking# Docker deployment
docker-compose -f docker-compose.redis.yml up -d
# Manual deployment
# See DEPLOYMENT.md for detailed instructionsReady for deployment to:
- Vercel (recommended)
- Netlify
- Static hosting
- Node.js servers
- Flower - Celery task monitoring on :5555
- System Health - Comprehensive health checks
- Proxy Statistics - Rotation and success rates
- Dead Letter Queue - Failed item tracking
- Alert System - Email/webhook notifications
- Proxy Rotation - Intelligent IP management
- Rate Limiting - Request throttling per site
- User-Agent Rotation - Realistic browser simulation
- Error Handling - Graceful failure recovery
- Data Validation - Pydantic model validation
- CLAUDE.md - Comprehensive project documentation
- FRONTEND.md - Frontend implementation plan
- DEPLOYMENT.md - Production deployment guide
The system provides a complete real estate aggregation solution:
- Data Collection - Automated scraping from multiple sources
- Data Processing - Normalization and validation
- API Layer - RESTful access with real-time updates
- Frontend Interface - Modern web application for browsing
- Monitoring - Health checks and performance metrics
Perfect for real estate platforms, property search engines, or market analysis tools.