About This Architecture
BiteWise implements a layered MVVM architecture combining local heuristic scoring with AI-powered health analysis for food products. Data flows from UI fragments through ViewModels to repositories, which cache product details via Room DB and coordinate batch AI analysis through WorkManager and Gemini API. The HealthScoringEngine calculates instant safety scores offline using allergen and nutritional heuristics, while AiBatchWorker asynchronously enriches results with AI reasoning, merging local and remote intelligence into a final composite score. Fork this diagram to customize feature routing, adjust batch sizing, or integrate alternative AI providers like Claude or local TensorFlow models. The architecture prioritizes offline responsiveness and adaptive batch processing, making it ideal for health apps serving users with intermittent connectivity.