How sarthak23-2008/enigma_innoquads works
SafeBite is a personalized food-safety and dietary-pattern assistant. Users create a dietary profile, check food through label scanning, search, manual entry or restaurant choices, review results and log foods they ate; rolling trends, goals, alerts and alternatives help interpret that history. The frontend API client connects these journeys to FastAPI routes, which use services, deterministic engines and persisted user data. OCR provider details and most route-to-service wiring were not sampled, so those internal links are shown only where documented capabilities support them.
Main entry points: main.py FastAPI application · session.py Database access · api/analysis.py Assessment routes · services/analysis.py Assessment service
Components 24
User application
- Route application
frontend/src/App.jsx - Food entry
frontend/src/pages - Label review
frontend/src/components/OCRReview.jsx - History and trends
frontend/src/pages - API client
frontend/src/services/api.js
API and identity
- FastAPI application
backend/app/main.py - Authentication
backend/app/api/auth.py - Profile routes
backend/app/api/profile.py - Assessment routes
backend/app/api/analysis.py - OCR routes
backend/app/api/ocr.py - Food logs
backend/app/api/logs.py - Insights and goals
backend/app/api/insights.py - Database access
backend/app/database/session.py - Application data
backend/app/models/__init__.py
Food assessment
- OCR processing
backend/app/services/ocr - Label parser
backend/app/services/ocr/label_parser.py - Food catalog
backend/app/data/food_catalog.py - Ingredient normalization
backend/app/engines/ingredient_normalizer.py - Ingredient risk engine
backend/app/engines/risk_engine.py - Food alternatives
backend/app/services/alternatives.py - Assessment service
backend/app/services/analysis.py
Diet patterns
- Diet pattern engine
backend/app/engines/diet_pattern_engine.py - Reports and notifications
backend/app/services/reports.py
Other components
- Food checker
Connections 27
- Food checker → Route application: uses
- Route application → Food entry: routes to
- Route application → History and trends: routes to
- Food entry → API client: requests
- Label review → Food entry: submits edits
- History and trends → API client: requests
- API client → FastAPI application: HTTP requests
- FastAPI application → Authentication: mounts routes
- FastAPI application → Profile routes: mounts routes
- FastAPI application → Assessment routes: mounts routes
- FastAPI application → OCR routes: mounts routes
- FastAPI application → Food logs: mounts routes
- FastAPI application → Insights and goals: mounts routes
- OCR routes → OCR processing: processes labels
- OCR processing → Label parser: parses text
- Assessment routes → Assessment service: delegates assessment
- Assessment service → Ingredient normalization: normalizes ingredients
- Assessment service → Ingredient risk engine: checks risk
- Assessment service → Food alternatives: gets alternatives
- Assessment routes → Food catalog: searches foods
- Authentication → Database access: queries users
- Assessment routes → Database access: persists results
- Food logs → Database access: reads and writes logs
- Insights and goals → Database access: loads diet history
- Database access → Application data: accesses
- Insights and goals → Diet pattern engine: analyzes patterns
- Reports and notifications → Diet pattern engine: summarizes patterns