A vibe Coded Automated phone market scraper for Algerian marketplaces including Ouedkniss, Jumia Algeria, and Facebook Marketplace. This system provides real-time data aggregation, population tracking, price trend analysis, and comprehensive market insights.
- Multi-Marketplace Scraping: Automated scraping from Ouedkniss, Jumia Algeria, and Facebook Marketplace
- Scheduled Automation: Configurable scraping schedules for each marketplace
- Population Tracking: Track listing counts, stock levels, and availability across all marketplaces
- Price Trend Analysis: Historical price tracking and analysis
- Advanced Search & Filtering: Multi-dimensional filtering by brand, price, condition, marketplace, and more
- Analytics Dashboard: Visual insights into market trends and phone popularity
- Admin Panel: Control scraping jobs, view logs, and manage system health
- Real-time Updates: Fresh data with automated scheduling
- Node.js & Express
- MySQL Database
- Puppeteer & Cheerio for scraping
- node-cron for scheduling
- Winston for logging
- React
- Vite
- TailwindCSS
- Recharts for data visualization
- Axios for API calls
- Node.js (v16 or higher)
- MySQL (v8.0 or higher)
- npm or yarn
- Clone the repository
git clone <repository-url>
cd Scrapping- Install dependencies
npm install
cd frontend && npm install && cd ..- Configure environment variables
cp .env.example .env
# Edit .env with your configuration- Set up the database
# Create the database
mysql -u root -p -e "CREATE DATABASE phone_scraper;"
# Run migrations
npm run migrate- (Optional) Seed the database
npm run seed# Run both backend and frontend
npm run dev
# Run only backend
npm run server:dev
# Run only frontend
npm run client:dev# Build frontend
npm run build
# Start server
npm start# Run the scheduler (for automated scraping)
npm run scheduler# Scrape specific marketplace
npm run scrape:ouedkniss
npm run scrape:jumia
npm run scrape:facebook
# Scrape all marketplaces
npm run scrape:all.
├── backend/
│ ├── server.js # Express server
│ ├── config/ # Configuration files
│ │ ├── database.js
│ │ └── scraper.config.js
│ ├── database/ # Database related
│ │ ├── migrations/
│ │ ├── connection.js
│ │ └── migrate.js
│ ├── models/ # Database models
│ │ ├── Phone.js
│ │ ├── PhonePopulation.js
│ │ └── ...
│ ├── scrapers/ # Scraper modules
│ │ ├── BaseScraper.js
│ │ ├── OuedknissScraper.js
│ │ ├── JumiaScraper.js
│ │ ├── FacebookScraper.js
│ │ └── runScraper.js
│ ├── scheduler/ # Scheduling system
│ │ ├── index.js
│ │ └── jobManager.js
│ ├── services/ # Business logic
│ │ ├── phoneService.js
│ │ ├── analyticsService.js
│ │ └── deduplicationService.js
│ ├── routes/ # API routes
│ │ ├── phones.js
│ │ ├── analytics.js
│ │ └── admin.js
│ ├── middleware/ # Express middleware
│ │ ├── errorHandler.js
│ │ └── validation.js
│ └── utils/ # Utility functions
│ ├── logger.js
│ └── notifications.js
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── services/
│ │ └── App.jsx
│ └── package.json
└── package.json
GET /api/phones- Get all phones with filteringGET /api/phones/:id- Get phone detailsGET /api/phones/:id/listings- Get all listings for a phoneGET /api/phones/:id/price-history- Get price history
GET /api/analytics/marketplace-stats- Get marketplace statisticsGET /api/analytics/trending- Get trending phonesGET /api/analytics/price-trends- Get price trend analysisGET /api/analytics/popularity- Get popularity metrics
GET /api/admin/jobs- Get scraping jobs statusPOST /api/admin/jobs/:marketplace/trigger- Manually trigger scrapingGET /api/admin/logs- Get system logsPUT /api/admin/jobs/:id/schedule- Update job schedule
Default scraping intervals:
- Ouedkniss: Every 6 hours
- Jumia Algeria: Every 4 hours
- Facebook Marketplace: Every 8 hours
Schedules can be configured via environment variables or admin panel.
phones- Phone listingsphone_populations- Population metrics trackingmarketplace_stats- Aggregated marketplace datascraping_jobs- Scheduled job trackingprice_trends- Historical price data
See database migrations for complete schema.
- Comprehensive error logging with Winston
- Email notifications for scraping failures
- Retry mechanism with exponential backoff
- Health monitoring dashboard
- Database indexing for fast queries
- Result caching
- Image lazy loading
- Pagination for large datasets
- Code splitting
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
ISC
For issues and questions, please open an issue on GitHub.