AI-powered, fully on-device iOS nutrition & body-recomposition tracker. Snap a photo of a meal, get an instant macro + micronutrient breakdown, and let an adaptive coach steer your targets toward your goals.
MacroLens keeps all of your data on-device (SwiftData). The only thing that ever leaves your phone is a single meal-photo analysis request to the Google Gemini API.
- πΈ AI meal analysis β photo(s) + a short description β calories, macros, sugar, and a per-ingredient breakdown via Gemini. Every number is editable before saving.
- π Today dashboard β calorie ring, macro rings, and a sugar bar. Tap any metric to drill into exactly which foods contributed β down to each ingredient in a composite meal.
- 𧬠Vitamins & minerals β per-ingredient micronutrient estimates with RDA progress bars and deficiency / excess flags, driven by an extensible nutrient catalog.
- π₯€ Drinks & π§ hydration β log caloric beverages (protein/carbs/fat/sugar) and water, with per-beverage hydration coefficients and a 7-day hydration chart.
- π Supplements & creatine β manual logging (e.g. a 5 g creatine scoop) plus creatine estimated from food, combined into a daily total.
- π§ Adaptive nutrition planning β estimates your real maintenance calories from intake + weight trend (energy balance) and proposes target adjustments, with a plain-language explanation of what changed and why.
- π€ Coach β prioritized, trend-based, encouraging recommendations generated from your history, plus a conversational chat coach.
- π· Per-100 g label entry β type a package's per-100 values and how much you had; the totals are computed for you.
- ποΈ History β a day-by-day timeline of meals, drinks, and water; calendar view; swipe to delete; tap a meal to edit or re-analyze.
- βοΈ Body metrics β weight & body-fat logging with a Swift Charts trend, optional HealthKit-ready design.
- π Configurable day boundary β late-night meals (before, say, 3 AM) count toward the previous day.
- π Reminders β on-device meal & hydration reminders (no paid entitlement required).
- π Localized β English, Russian, and Kazakh.
- Swift + SwiftUI, targeting iOS 26
- SwiftData for all local persistence
- Swift Charts for trends
- PhotosUI + camera for meal photos
- Google Gemini API (
gemini-3-flash-preview, free tier) as the single networking layer - No backend, no cloud database, no third-party analytics
MacroLens/
βββ MacroLensApp.swift # @main, SwiftData ModelContainer
βββ Models/ # @Model types, the extensible Nutrient catalog, computed DayLog
βββ Services/ # Gemini, HistoryAnalyzer, AdaptivePlanner, Keychain, AppRouter,
β # AppShortcuts, Notifications, ImageProcessing, Localization, DayBoundary
βββ DesignSystem/ # "Calm Instrument" β Theme (tokens/motion) + reusable Components
βββ Views/ # Today Β· Add (Meal/Drink/Supplement) Β· History Β· Body Β· Coach Β· Settings
An extensible nutrient catalog (Models/Nutrient.swift) is the single source of truth: it drives the Gemini response schema, the per-metric drill-downs, and RDA tracking β adding a new vitamin, mineral, or supplement is a one-line change.
The UI is built on a single design system (DesignSystem/): one card, one ring scale, one status ramp, one row β so every tab reads as one system, in light & dark and across English/Russian/Kazakh. Back-tap shortcuts ("Log Meal" / "Log Drink") deep-link into logging via App Intents.
Requirements: Xcode 26, an iPhone on iOS 26, and an Apple ID (a free one works β this app is built for personal sideloading).
git clone https://github.com/YeraSss/MacroLens.git- Open
MacroLens.xcodeproj. - Select the MacroLens target β Signing & Capabilities β choose your team (free Apple ID is fine). Change the bundle identifier if it collides.
- Build & run on your device (βR). On the iPhone, enable Developer Mode and trust the developer certificate on first launch.
The app never ships a key. Add yours in Settings β API Key β it's stored only in the iOS Keychain, on your device. Get a free key at https://aistudio.google.com/apikey and keep billing disabled to stay on the free tier.
(Optional: you can pre-seed a key via a gitignored Secrets.xcconfig β see Secrets.example.xcconfig.)
All data lives locally via SwiftData. The only outbound network request is the single meal-photo (and drink) analysis to Gemini. No accounts, no analytics, no servers.
A personal project, built for one device via free-Apple-ID sideloading β not on the App Store. Not affiliated with Google or Apple.