Kalore is a high-performance, privacy-first calorie and macronutrient tracking application built with Flutter. Inspired by Apple Fitness and iOS design principles, Kalore combines fluid gestures, true-black OLED aesthetics, and a multi-tiered nutritional intelligence pipeline to make daily nutrition tracking effortless and accurate.
Whether you are an athlete executing an aggressive cut, preparing for a competition, or simply maintaining a healthy lifestyle, Kalore gives you medical-grade precision calculations (Mifflin-St Jeor + dynamic surplus/deficit models) paired with computer vision food analysis.
- Concentric Activity Rings: Visual progress rings for Calories, Protein, Carbohydrates, and Fats with glowing endpoints and spring physics.
- Gesture-Driven Experience: Interactive swiping between Daily Summary, AI Meal Planner, and History screens.
- OLED Pure Black Dark Mode: High-contrast, energy-efficient true-black interface crafted per Apple Human Interface Guidelines (HIG).
- Direct Visual Food Recognition: Identifies culinary dishes, cooking methods (grilled, roasted, fried), visual cues, and athlete dietary advice from photos.
- Smart Image Compression: Automatic on-device compression and byte-budgeting for camera snapshots and gallery uploads to minimize latency and bandwidth.
- Multi-Tier Engine with Automatic Fallback:
- Tier 1: CalorieAPI direct culinary search.
- Tier 2: CalorieNinjas natural language processing & image text OCR.
- Tier 3: Google Gemini Generative AI (multimodal vision & structured JSON).
- Tier 4: On-Device Smart Nutrition Heuristics (100% offline, zero-network required).
- Aggressive Cutting & Bulking Formulas: Custom target calorie and macro generation tailored to specific target durations (e.g., cutting 10 kg in 4 weeks with safe minimum metabolic thresholds).
- Medical BMR & TDEE Calculations: Accurate energy expenditure formulas based on user gender, age, height, weight, and activity multipliers.
- Quick-tap water logging (250ml quick-add or custom manual input) with real-time hydration progress.
- Detailed transaction log of tracked meals, segmented day/week filters, and macro balance summaries.
- No Hardcoded Secrets: Zero API keys or private credentials in the source code.
- Runtime Environment Injection: Full support for
--dart-defineand--dart-define-from-file=env.json. - In-App BYOK (Bring Your Own Key): Users can supply their personal API keys in settings, saved exclusively in secure local device storage.
- Full Legal Readiness: Built-in Terms of Service, Privacy Policy, and Medical Disclaimer screens.
lib/
โโโ core/
โ โโโ constants/ # App constants, API config, environment bindings
โ โโโ providers/ # Riverpod dependency injection providers
โ โโโ services/ # GeminiService (multimodal vision, NLP tiers, offline engine)
โ โโโ storage/ # Local persistence (SharedPreferences)
โ โโโ theme/ # Apple HIG theme, OLED dark colors, typography
โโโ features/
โ โโโ auth/ # Guest mode & account authentication
โ โโโ history/ # Daily recap, meal log, macro balance breakdown
โ โโโ home/ # Dashboard, Apple Activity Rings, quick log actions
โ โโโ legal/ # Terms of Service, Privacy Policy, Medical Disclaimer
โ โโโ meals/ # Camera vision, manual input, portion adjustments
โ โโโ onboarding/ # Athlete target setup, BMR/TDEE calculation
โ โโโ settings/ # Preferences, client-side API key configuration
โโโ main.dart # Application entrypoint & initialization
- Flutter SDK (
^3.10.4or newer) - Dart SDK
^3.10.4 - Android Studio / Xcode / VS Code
-
Clone the repository:
git clone https://github.com/your-username/kalore.git cd kalore/kalore -
Install Flutter packages:
flutter pub get
-
Configure API Keys (Optional): Kalore runs completely offline without any keys! If you wish to enable cloud AI features:
Copy
env.json.exampletoenv.json:cp env.json.example env.json
Edit
env.jsonwith your credentials:{ "GEMINI_API_KEY": "your_gemini_api_key", "CALORIE_API_KEY": "your_calorie_api_key", "CALORIE_NINJAS_KEY": "your_calorie_ninjas_key" } -
Launch Application:
# With env.json: flutter run --dart-define-from-file=env.json # Or 100% offline (no keys required): flutter run
Kalore includes a comprehensive automated test suite covering medical algorithms, portion scaling, MIME detection, version tracking, and UI widget rendering:
# Run static analysis flutter analyze # Run all automated tests flutter test test/unit_test.dart test/gemini_service_test.dart test/widget_test.dart
This project is licensed under the MIT License - see the LICENSE file for details.