How utsapoddar/pcos-scanner works
PCOS Food Scanner is a Streamlit prototype for turning packaged-food scans or meal photos into deterministic nutrition scores and profile-aware guidance, with saved foods and PCOS profile management. The app coordinates both scan routes and meal estimation, then applies scoring and optional personalization. Supabase stores profiles, saved foods, and cached guidance; startup also runs SQL migrations. The graph reflects the documented capabilities and sampled call sites; some UI implementation is excerpted, so uncertain wiring is omitted.
Main entry points: app.py Streamlit app · personalize.py Score personalization · db.py Supabase data access · food_photo.py Meal photo estimator
Components 17
App and inputs
- Streamlit app
app.py - Barcode decoder
core/barcode.py - Label extraction
core/vision.py - Meal photo estimator
core/food_photo.py
Nutrition analysis
- Meal aggregation
core/food_photo.py - Rule-based scoring
core/scoring.py
Profile guidance
- Score personalization
core/personalize.py - PCOS guidelines
knowledge/pcos_guidelines.md - PCOS profile model
core/profile.py
Data persistence
- Supabase data access
core/db.py - Supabase database
- Startup migrations
core/migrations.py - SQL migrations
migrations
Other components
- Scanner user
- Open Food Facts
- USDA FoodData Central
- NVIDIA model API
Connections 19
- Scanner user → Streamlit app: uses
- Streamlit app → Barcode decoder: decodes image
- Streamlit app → Open Food Facts: fetches barcode product
- Streamlit app → Label extraction: extracts label
- Streamlit app → Meal photo estimator: estimates meal
- Meal photo estimator → NVIDIA model API: identifies foods
- Meal photo estimator → USDA FoodData Central: looks up nutrients
- Streamlit app → Meal aggregation: aggregates portions
- Streamlit app → Rule-based scoring: scores nutrients
- Streamlit app → Score personalization: requests guidance
- Score personalization → NVIDIA model API: personalizes score
- Score personalization → PCOS guidelines: references guidance
- Score personalization → Supabase data access: reads or caches
- Supabase data access → PCOS profile model: converts profile
- Streamlit app → Supabase data access: loads and saves
- Supabase data access → Supabase database: reads and writes
- Streamlit app → Startup migrations: runs at startup
- Startup migrations → SQL migrations: loads SQL
- Startup migrations → Supabase database: applies schema