How rohith-s378/driftwatch works
DriftWatch is a competitive-intelligence platform. A user submits a company URL through Discovery; the backend profiles it, searches for and verifies competitor candidates, ranks them for review, and can promote a candidate into scheduled monitoring. Monitoring crawls tracked sites, stores snapshots, detects changes, and exposes results through overview, changes, insights, and grounded Ask AI views. A separate webhook ingestion route accepts externally supplied snapshots. The graph follows README-documented workflows and sampled call relationships; some unsampled page and service internals are represented only at subsystem level.
Main entry points: main.py FastAPI endpoints · snapshot_service.py Snapshot processing · crawler.py Website crawler · models.py Domain records
Components 22
Web application
- Discovery page
frontend/src/pages/Discovery.jsx - Overview page
frontend/src/pages/Overview.jsx - Changes page
frontend/src/pages/Changes.jsx - Insights page
frontend/src/pages/Insights.jsx - Ask AI page
frontend/src/pages/askAI.jsx - Backend API client
frontend/src/api.js
Competitor discovery
- FastAPI endpoints
app/main.py - Company profiler
app/services/profiler.py - Competitor discovery
app/services/discovery.py - Search providers
app/services/search_providers.py
Monitoring and alerts
- Website crawler
app/services/crawler.py - SSRF URL guard
app/services/url_validator.py - Monitoring scheduler
app/services/scheduler.py - Webhook ingestion
app/routers/webhook.py
Data and intelligence
- Snapshot processing
app/services/snapshot_service.py - Change detection
app/services/change_detector.py - Content extractors
app/services/extractors.py - Grounded Q&A
app/services/ask_ai.py - Domain records
app/models/models.py - SQL database
app/db/database.py
Other components
- Market analyst
- Search APIs
Connections 25
- Market analyst → Discovery page: submits URL
- Discovery page → Backend API client: requests discovery
frontend/src/pages/Discovery.jsx - Backend API client → FastAPI endpoints: calls endpoints
- FastAPI endpoints → Company profiler: profiles company
app/main.py - FastAPI endpoints → Competitor discovery: starts discovery
app/main.py - Company profiler → Website crawler: crawls site
app/services/profiler.py - Competitor discovery → Search providers: searches candidates
app/services/discovery.py - Search providers → Search APIs: queries provider
app/services/search_providers.py - Competitor discovery → Website crawler: verifies sites
app/services/discovery.py - FastAPI endpoints → Domain records: persists candidates
app/main.py - Market analyst → Overview page: reviews monitoring
- Market analyst → Changes page: reviews changes
- Market analyst → Insights page: reviews insights
- Market analyst → Ask AI page: asks questions
- FastAPI endpoints → Monitoring scheduler: tracks competitors
app/main.py - Monitoring scheduler → Website crawler: schedules crawls
app/services/scheduler.py - Website crawler → SSRF URL guard: validates URLs
app/services/crawler.py - Website crawler → Snapshot processing: submits snapshots
- Webhook ingestion → Snapshot processing: processes payload
app/routers/webhook.py - Snapshot processing → Change detection: runs detectors
app/services/snapshot_service.py - Snapshot processing → Content extractors: extracts prices
app/services/snapshot_service.py - Snapshot processing → Domain records: stores events
app/services/snapshot_service.py - FastAPI endpoints → Grounded Q&A: queries intelligence
app/main.py - Grounded Q&A → Domain records: reads evidence
app/services/ask_ai.py - Domain records → SQL database: maps records
app/models/models.py