Skip to content

ojedat25/MacroScout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MacroScout

MacroScout is an iOS app for tracking daily calories and macros. Search foods from the USDA database, log what you eat, save favorites, and set personal nutrition goals, all in one place.


Features

  • Food Search: Search the USDA food database by name and view nutrition info
  • Track Macros: Log food to track daily calories, protein, carbs, and fats
  • Set Goals: Set daily targets for calories and each macro
  • Favorites: Save foods for quick access and re-logging
  • Custom Entry: Manually add a food with your own nutrition values
  • Edit Foods: Update any saved food's name, values, or serving info

App Structure

MacroScout/
Views/           # Screens (HomePage, FoodDBModal, FavoritesModal, etc.)
Components/      # Reusable UI pieces (NutrientCard, FoodItemCard, etc.)
Controller/      # State management (GoalsController, FoodController, etc.)
Models/          # SwiftData models (FoodItem, Goal, DailyProgress, Username)
Services/        # API and database logic (APIService, DatabaseService)
Configuration.swift  # Environment-based config (API key, debug mode)

Tech Stack

  • SwiftUI: UI framework
  • SwiftData: Local database
  • USDA FoodData Central API: Food nutrition database

Setup

  1. Clone the repo and open the .xcodeproj in Xcode
  2. Add your USDA API key as an environment variable named APIKey in the scheme's Run settings
  3. Build and run on a simulator or device running iOS 17+

How It Works

Logging food Tap + on the home screen -> choose Custom Entry, Food Database, or Favorites -> add an item -> the home screen updates with your new totals.

Setting goals On first launch, a Goal Setup sheet appears automatically. Tap Edit Goal on the home screen anytime to update your targets.

Setting your name Tap the profile icon -> enter your name -> it appears as a greeting on the home screen.


Docs

Additional documentation is in the docs/ folder:


About

iOS nutrition tracker: search the USDA food database, log meals, track macros, save favorites, and set daily goals.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages