Overview
Many commercial calorie tracking applications require cloud accounts, paywall essential metrics, and monetize personal health information. CalTab was engineered as a privacy-first, local-first mobile application developed during the Mobile Applications module (THWS / TAMK). The primary goal was to provide an intuitive, high-performance nutrition and macro tracker where all personal logs, profile metrics, and body progress history remain strictly stored on the user’s physical device. Network traffic is reserved exclusively for food database queries and optional AI enhancements.
Key Features
- Smart Onboarding & Target Calculation: Automatically calculates Basal Metabolic Rate (BMR), Total Daily Energy Expenditure (TDEE), and tailored macronutrient targets based on user biometric data and fitness goals.
- Open Food Facts & Barcode Scanning: Real-time, paginated food search backed by the Open Food Facts API, accompanied by rapid on-device barcode recognition powered by Google ML Kit.
- Snap2Cal & AI Assistant (BYOK): Multimodal photo-to-macro estimation (“Snap2Cal”) and an interactive in-app nutrition coach utilizing the Google Gemini API with secure on-device API key storage (Bring Your Own Key).
- Dynamic Weight & Progress Analytics: Interactive weight logs that dynamically recalibrate daily caloric needs, coupled with 7-day trend visualizations, macro distribution averages, and meal consistency statistics.
- Custom Meals & Data Portability: Custom recipe and food creation with strict macro validation rules, complemented by JSON export/import (v1.1) for offline backups.
Architecture & Tech Stack
- Framework: Flutter (Dart 3.11+) with Material Design 3 and persisted theme switching.
- State Management: Flutter Riverpod 3 utilizing modern
NotifierandAsyncNotifierpatterns for predictable, asynchronous state synchronization. - Navigation:
go_routerwith declarative routes and strongly typed argument passing. - APIs & Services: Open Food Facts REST API and Google Generative AI SDK (Gemini Vision & Chat).
- Hardware & ML:
cameraandgoogle_mlkit_barcode_scanningfor offline barcode detection. - Storage & Security:
shared_preferencesfor structured offline logs andflutter_secure_storagefor cryptographic isolation of API credentials. - Testing: Comprehensive test suite spanning unit models, validators, repository layers, Riverpod providers, and screen widget tests.
Highlights & Learnings
- Local-First Reactive Architecture: Structuring complex, interconnected state—such as weight updates automatically propagating through user profiles to recalibrate active daily targets across the UI—demonstrated the power and clean separation of concerns enabled by Riverpod 3 async notifiers.
- Defensive Error & Quota Handling: Integrating external REST endpoints alongside multimodal LLMs required robust fallback mechanisms, strict input validation (ensuring macro totals never exceed physical meal weight), and graceful handling of rate limits and offline network conditions.
Keynote











