How karthik1804-ui/food-label-verification-system works
This is a consumer food-label verification system with two intentionally separate analyses: barcode-based product identity and ingredient-based dietary/safety evaluation. Users scan a barcode or submit label text/image; the frontend sends analysis requests to Flask, which combines product lookup, parsing, scoring, personalized checks, and audit evaluation, then presents results and supports history, profiles, and review. The README documents major capabilities not fully shown in excerpts; those subsystems are included, with unverified connections omitted or marked dashed.
Main entry points: app.py API controller · api.js API client · App.js Workflow UI · auth_service.py Authentication and profiles
Components 25
Consumer interface
- Workflow UI
frontend/src/App.js - API client
frontend/src/api.js - Product scanning
frontend/src/components/ProductScanningView.jsx - Analysis results
frontend/src/components/AnalysisResultsView.jsx - UI icons
frontend/src/components/Icons.jsx
Product identity
- Image barcode decode
backend/services/barcode_decoder.py - EAN validation and lookup
backend/services/barcode.py
Label analysis
- API controller
backend/app.py - Image preprocessing and OCR gate
backend/services/ocr_service.py - Ingredient taxonomy parser
backend/services/parser.py - Safety scoring
backend/services/scoring_engine.py - Dietary preference evaluation
backend/services/preference_engine.py - Reformulation suggestions
backend/services/counterfactual.py - Regulatory checks
backend/services/regulatory_checker.py
Accounts and records
- Account interface
frontend/src/components/AuthCard.jsx - Authentication and profiles
backend/services/auth_service.py - Scan history
frontend/src/components/AnalysisHistoryView.jsx - History and personal scoring
backend/services/personal_scoring.py - User and profile entities
backend/models/user.py - Dietary profile entity
backend/models/profile.py - Analysis record entity
backend/models/analysis.py - SQLite database
backend/models/database.py
Human review
- Confidence audit
backend/services/audit.py - Audit queue
frontend/src/components/AuditQueueModal.jsx
Other components
- Consumer
Connections 32
- Consumer → Workflow UI: uses
- Workflow UI → Product scanning: renders
frontend/src/App.js - Workflow UI → Analysis results: renders
frontend/src/App.js - Workflow UI → API client: submits analysis
frontend/src/App.js - Workflow UI → API client: preprocesses image
frontend/src/App.js - Workflow UI → UI icons: renders
frontend/src/App.js - Product scanning → UI icons: uses
frontend/src/components/ProductScanningView.jsx - Analysis results → UI icons: uses
frontend/src/components/AnalysisResultsView.jsx - API client → API controller: sends HTTP requests
frontend/src/api.js - API controller → EAN validation and lookup: validates and looks up
backend/app.py - API controller → Ingredient taxonomy parser: parses ingredients
backend/app.py - API controller → Safety scoring: scores product
backend/app.py - API controller → Dietary preference evaluation: checks preferences
backend/app.py - API controller → Reformulation suggestions: requests suggestions
backend/app.py - API controller → Confidence audit: evaluates confidence
backend/app.py - API controller → Image preprocessing and OCR gate: preprocesses image
backend/app.py - API controller → Image barcode decode: decodes image barcode
backend/app.py - Image barcode decode → EAN validation and lookup: uses validation
backend/services/barcode_decoder.py - API controller → Regulatory checks: checks regulations
backend/app.py - API controller → History and personal scoring: persists scan
backend/app.py - Account interface → API client: registers and logs in
frontend/src/components/AuthCard.jsx - API client → Authentication and profiles: requests authentication
- Authentication and profiles → SQLite database: uses SQLite
backend/services/auth_service.py - Authentication and profiles → User and profile entities: uses user model
- Authentication and profiles → Dietary profile entity: uses profile model
- Scan history → API client: requests history
frontend/src/components/AnalysisHistoryView.jsx - API client → History and personal scoring: requests history
- History and personal scoring → SQLite database: uses SQLite
backend/services/personal_scoring.py - History and personal scoring → Analysis record entity: uses analysis records
backend/models/analysis.py - Audit queue → API client: submits review actions
frontend/src/components/AuditQueueModal.jsx - API client → Confidence audit: requests audit operations
- Confidence audit → SQLite database: persists audit queue