How sathvick07/unpack works
UnPack is a packaged-food label evidence and nutrition-tracking application. Users can register and set dietary preferences, scan a label, inspect OCR evidence and safety findings, correct extracted fields for server-side re-evaluation, and record confirmed consumption for daily nutrient totals. The frontend routes these tasks through a typed API client to Django endpoints; the backend provides label analysis, user/data persistence, and nutrition calculations. The README documents the analysis stages, while several backend call details and auth/intake endpoint internals were not sampled, so those links are shown only where supported or marked unverified.
Main entry points: views.py API endpoints · client.ts Typed API client · ocr_engine.py OCR extraction · App.tsx App routing
Components 18
Web application
- App routing
frontend/src/App.tsx - Scan workflow
frontend/src/pages/ScanPage.tsx - Evidence review
frontend/src/components/EvidenceLens.tsx - Nutrition dashboard
frontend/src/pages/NutritionPage.tsx - Auth and onboarding
frontend/src/context/AuthContext.tsx - Typed API client
frontend/src/api/client.ts
API and persistence
- API endpoints
backend/api/views.py - Application records
backend/api/models.py - Data serialization
backend/api/serializers.py
Label analysis
- OCR extraction
backend/api/label_analyzer/ocr_engine.py - Image quality audit
backend/api/label_analyzer/quality.py - Evidence validation
backend/api/label_analyzer/validator.py - Restriction matching
backend/api/label_analyzer/matching.py - Claim contradictions
backend/api/label_analyzer/contradiction.py
Nutrition tracking
- Intake calculator
backend/api/nutrition/calculator.py - Nutrient references
backend/api/nutrition/reference_limits.py
User identity
- Identity endpoints
backend/api/views.py
Other components
- User
Connections 22
- User → App routing: uses
frontend/src/App.tsx - App routing → Scan workflow: routes to
frontend/src/App.tsx - App routing → Nutrition dashboard: routes to
frontend/src/App.tsx - App routing → Auth and onboarding: provides context
frontend/src/App.tsx - Scan workflow → Typed API client: requests analysis
frontend/src/api/client.ts - Typed API client → API endpoints: calls endpoints
frontend/src/api/client.ts - Scan workflow → Evidence review: renders review
frontend/src/components/EvidenceLens.tsx - Evidence review → Typed API client: submits corrections
frontend/src/components/EvidenceLens.tsx - API endpoints → OCR extraction: dispatches analysis
backend/api/views.py - OCR extraction → Image quality audit: uses quality audit
backend/api/label_analyzer/ocr_engine.py - OCR extraction → Evidence validation: validates extraction
backend/api/label_analyzer/ocr_engine.py - OCR extraction → Restriction matching: uses restriction matching
backend/api/label_analyzer/ocr_engine.py - OCR extraction → Claim contradictions: checks claims
backend/api/label_analyzer/ocr_engine.py - API endpoints → Restriction matching: invokes matching
backend/api/views.py - API endpoints → Application records: reads and writes
backend/api/views.py - API endpoints → Data serialization: serializes data
backend/api/views.py - Nutrition dashboard → Typed API client: requests intake
frontend/src/api/client.ts - API endpoints → Intake calculator: calculates summaries
backend/api/views.py - Intake calculator → Nutrient references: uses limits
backend/api/nutrition/calculator.py - API endpoints → Identity endpoints: serves identity
backend/api/views.py - Auth and onboarding → Typed API client: restores session
frontend/src/context/AuthContext.tsx - Typed API client → Identity endpoints: calls auth endpoints
frontend/src/api/client.ts