Skip to content

A lightweight and intuitive iOS application for tracking daily macro intake with barcode scanning functionality.

Notifications You must be signed in to change notification settings

ryansoe/macro-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯‘ Macro Tracker App πŸ—πŸ₯¦

A lightweight and intuitive iOS application for tracking daily macro intake with barcode scanning functionality.

πŸ“Œ Overview

Macro Tracker is a SwiftUI-based iOS application that helps users track their daily macronutrient intake (carbohydrates, protein, and fat). Users can manually enter meal macros, set daily goals, view historical entries, and scan barcodes to fetch nutrition data from Open Food Facts API.

The app ensures data persistence even after closing, and features an intuitive UI with a smooth user experience.

✨ Features

βœ… Manual Entry of Macros – Users can input carbs, protein, and fat per meal.
βœ… Automatic Macro Summation – Every meal entry adds to the total daily intake.
βœ… Barcode Scanning – Scan food barcodes and retrieve macronutrient info from Open Food Facts.
βœ… Serving Size Adjustment – Users can edit the number of servings before adding macros.
βœ… Set Daily Goals – Users can set macro targets, and progress bars update accordingly.
βœ… Edit Macros – If a mistake is made, users can edit their daily macros manually.
βœ… History Tracking – Users can save daily macros and view past entries.
βœ… Confirmation Pop-ups – Prevents accidental macro updates or history deletions.
βœ… Persistent Storage – Macro data remains stored even after closing the app.

πŸ“² Installation & Setup

Prerequisites

  • Xcode 15+
  • iOS 16+ device or simulator
  • Apple Developer Account (if testing on a real device)

Clone Repository

git clone https://github.com/yourusername/macro-tracker.git
cd macro-tracker

Open in Xcode

  1. Open MacroTracker.xcodeproj in Xcode.
  2. Select your device or simulator.
  3. Click Run ▢️ to build and launch the app.

Testing on a Real Device

  1. Connect your iPhone.
  2. Go to Xcode β†’ Signing & Capabilities.
  3. Select your Apple ID and enable Development Signing.
  4. Run the app on your device.

πŸ›  Technologies Used

  • SwiftUI – Modern declarative UI framework
  • VisionKit – Barcode scanning integration
  • Open Food Facts API – Retrieves nutrition data
  • UserDefaults – Persistent data storage
  • AppStorage – Manages daily macro values
  • MVVM Architecture – Ensures clean and modular code structure

πŸ“– How It Works

  1. Entering Macros: Users manually input and add meal macros to the daily total.
  2. Barcode Scanning: Scans a barcode using VisionKit, fetches macros from Open Food Facts API, and allows the user to confirm/edit before adding.
  3. Editing Macros: Users can manually adjust daily macro values.
  4. Setting Goals: Users define daily macro targets, and progress bars indicate how close they are to reaching them.
  5. Saving Daily Macros: Users can save their daily macro data and view their intake history.
  6. History Management: Saved entries are persistent, and users can delete or clear history if needed.

πŸš€ Future Improvements

πŸ”Ή Meal Pre-Logging for Future Days

πŸ”Ή Custom Food Entries

πŸ”Ή Apple Health Integration

πŸ“Έ Screenshots

(coming soon)

πŸ‘¨β€πŸ’» Author

Ryan Soe

πŸ“ GitHub: github/ryansoe

πŸ“ LinkedIn: linkedin/ryansoe

About

A lightweight and intuitive iOS application for tracking daily macro intake with barcode scanning functionality.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages