Repository navigation
Architecture Overview
MedScan Wiki edited this page Oct 19, 2026
·
1 revision
Full diagrams and data model: docs/architecture.md.
[ Web (React/PWA) ]──┐
[ Android (Flutter) ]──┼──► Flask API ──► Postgres
│ │
│ ├── scrapers (httpx + Playwright)
│ ├── OCR (Azure DI / Tesseract)
│ └── scheduler (reminders, cache sweep)
│
└── Supabase Auth ──► POST /api/auth/supabase ──► MedScan JWT
- Client calls
GET /api/search-medicine(or compare / alternatives) -
Cache hit →
200with prices -
Cache miss →
202{ pending, job_id, poll_after_ms } - Client polls
GET /api/scrape-jobs/<id>untildone/failed - Client retries the original search (no
refresh) for the payload
Web: getScraped in frontend/src/services/api.js
Mobile: _getScraped in mobile/lib/core/api/medscan_api.dart
Clients never send Supabase tokens to business routes. They exchange once for MedScan JWTs, then use Authorization: Bearer …. Production may also require X-Medscan-Api-Key.
- Backend layout:
docs/backend.md - API routes:
docs/api-reference.md - Frontend:
docs/frontend.md - Mobile:
docs/mobile.md