Calorie Tracker is an iOS app for logging food, calories, and nutrients.
It includes:
- Manual logging and quick add flows
- PCC dining menu import (Nutrislice)
- USDA food search (through Firebase Functions)
- AI meal text analysis
- AI food photo analysis
- AI plate portion estimation for menu items
- Health/step/exercise integration and widget support
Calorie Tracker/: main iOS SwiftUI appCalorie Tracker Widgets/: iOS widgetsCalorie TrackerUITests/: UI test targetfunctions/: Firebase Functions backend (TypeScript)public/: Firebase Hosting site (/privacypage)scripts/stress/: stress and regression test runnerwebapp/: separate Vite TypeScript sandbox/demo app
- macOS + Xcode (for iOS app development)
- Node.js 20 (for
functions/) - Firebase CLI (
npm i -g firebase-tools)
- Open
Calorie Tracker.xcodeprojin Xcode. - Select the
Calorie Trackerscheme. - Choose an iOS Simulator or device.
- Run (
Cmd+R).
The backend exposes these HTTP functions:
searchUSDAFoodsestimatePlatePortionsanalyzeFoodPhotoanalyzeFoodTextproxyNutrislice
Current app usage:
- iOS app calls
searchUSDAFoods,estimatePlatePortions,analyzeFoodPhoto, andanalyzeFoodText. proxyNutrisliceis used by Firebase Hosting rewrites for/api/nutrislice/**.
cd functions
npm install
firebase functions:secrets:set USDA_API_KEY
firebase functions:secrets:set GEMINI_API_KEY
npm run buildcd functions
npm run servecd functions
npm run deployHosting serves files from public/.
/privacyrewrites topublic/privacy.html/api/nutrislice/**rewrites to theproxyNutrislicefunction
Deploy:
firebase deploy --only hostingRun from repo root:
STRESS_TIER=pr ./scripts/stress/run_all.shOther tiers: nightly, pre-release.
Outputs are written under output/stress/<run-id>/.
- Default Firebase project in this repo is
calorie-tracker-364e3(see.firebaserc). - The iOS services currently default to the deployed backend URL:
https://us-central1-calorie-tracker-364e3.cloudfunctions.net