Skip to content

thejesh23/iosapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Nutrient Profile iOS App

View micro and macro nutrients from a bundled Excel file, switch serving sizes, and log foods to a daily calculator with goals (MyFitnessPal-style).

Quick start

  1. Open the project

    • Open NutrientProfileApp.xcodeproj in Xcode (double-click or File → Open).
    • Xcode will resolve the CoreXLSX package dependency automatically.
  2. Add your Excel file to the app bundle

    • Copy nutrient profile.xlsx (e.g. from your Desktop) into the NutrientProfileApp folder in Finder.
    • In Xcode, right-click the NutrientProfileApp group → Add Files to "NutrientProfileApp" → select nutrient profile.xlsx, check Copy items if needed and your app target. Ensure the file appears under Build Phases → Copy Bundle Resources.
  3. Build and run

    • Select a simulator (e.g. iPhone 16) and press ⌘R.

App structure

  • Foods tab: List of foods from the Excel file. Tap a food to see nutrients and serving picker; use Add to Today to log it.
  • Today tab: Daily log, totals (calories, protein, carbs, fat), and goals with progress. Use Goals to set daily targets.
  • Account tab: AI food search API key (see below).
  • AI food search: In the Foods tab, use the AI search section: type a food (e.g. "1 medium banana" or "grilled chicken 100g"), tap Search, then tap an AI result to open it and Add to Today. Requires an OpenAI (or compatible) API key in Account.
  • Apple Health: Logged foods are written to Health (calories, protein, fat, carbs, fiber, sugar, sodium, and selected vitamins/minerals). On first run the app will ask for Health write permission. If you see an entitlement error, add the HealthKit capability in Xcode (Signing & Capabilities → + Capability → HealthKit).

AI food search (LLM)

The Foods tab can search for foods using an LLM and add results to your log.

  1. API key: Open AccountAI food search → enter your OpenAI API key (or another OpenAI-compatible endpoint key) → Save API key. The key is stored in the iOS Keychain.
  2. Search: In Foods, type a query in the AI search field (e.g. "1 medium banana", "grilled chicken breast 100g") and tap Search. Results appear under AI results.
  3. Add to Today: Tap an AI result to open its detail (nutrients); use Add to Today as with profile foods. The entry is saved to your log and can sync to Apple Health.

The app uses the OpenAI chat API (gpt-4o-mini by default). You can change LLMFoodService.apiBaseURL and the model in code to use another provider.

Excel format

  • One sheet per food (or one main sheet). Each sheet:
    • Row 1: Food name (A1), Serving size (B1)
    • Row 2: Headers — Nutrient, Value, %DV
    • Row 3+: One row per nutrient; Value can include unit (e.g. 15g, 210mg); %DV is a number or -
  • Optional Servings sheet: Column A = serving label (e.g. 1 TBSP, 3 TBSP), Column B = ratio (e.g. 0.333, 1) so the app can recalculate when you switch serving.

Your file at nutrient profile.xlsx should be added to the project as described in step 4.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages