How divrajgit/companysale works
CompanySale scrapes configured retailer pages, extracts qualifying discounts, writes JSON, and serves that data in a React dashboard. The scraper is the documented runtime orchestrator; the frontend fetches the published JSON and includes product and usage-oriented display components. Email and SMS alert modules exist, but the excerpts do not show them being invoked. App wiring beyond the React entry point is unsampled, so those relationships are omitted.
Main entry points: scraper.py Scrape orchestrator · yaml_loader.py YAML loader · sale_data.json Published sale data · main.tsx React entry
Components 18
Scraping
- Scrape orchestrator
scraper/scraper.py - Site configuration
config/sites.yaml - YAML loader
scraper/utils/yaml_loader.py - Retailer website
- Body Shop parser
scraper/parsers/thebodyshop.py
Data publication
- JSON writer
scraper/utils/json_store.py - Published sale data
frontend/sales-frontend/public/data/sale_data.json
Dashboard
- React entry
frontend/sales-frontend/src/main.tsx - Dashboard app
frontend/sales-frontend/src/App.tsx - Sale data API
frontend/sales-frontend/src/api.ts - Discounted products
frontend/sales-frontend/src/components/ProjectsTable.tsx - Usage cards
frontend/sales-frontend/src/components/UsageCards.tsx - Navigation sidebar
frontend/sales-frontend/src/components/Sidebar.tsx
Alerts
- Email alerts
scraper/alerts/email_alerts.py - SMTP service
- SMS alerts
scraper/alerts/sms_alerts.py - Twilio service
Other components
- Scraper operator
Connections 11
- Scraper operator → Scrape orchestrator: runs
README.md - Scrape orchestrator → YAML loader: loads sites
scraper/scraper.py - YAML loader → Site configuration: reads
scraper/utils/yaml_loader.py - Scrape orchestrator → Retailer website: fetches HTML
scraper/scraper.py - Scrape orchestrator → Body Shop parser: parses HTML
scraper/scraper.py - Scrape orchestrator → JSON writer: saves results
scraper/scraper.py - Scrape orchestrator → Published sale data: writes combined data
README.md - React entry → Dashboard app: renders
frontend/sales-frontend/src/main.tsx - Sale data API → Published sale data: fetches JSON
frontend/sales-frontend/src/api.ts - Email alerts → SMTP service: sends email
scraper/alerts/email_alerts.py - SMS alerts → Twilio service: sends messages
scraper/alerts/sms_alerts.py