Documentation

Comprehensive guides, API references, and technical documentation for MacroChef.

Getting Started

Everything you need to start using MacroChef effectively

📱

Installation

System Requirements

  • iOS 17.0 or later
  • iPhone 12 or newer (recommended)
  • At least 100MB of storage
  • Camera access for barcode scanning

Beta Installation

  1. Request beta access via contact form
  2. Install TestFlight from the App Store
  3. Accept the beta invitation email
  4. Download MacroChef from TestFlight

Quick Setup

First Launch

  1. Create Account: Sign up with email or Apple ID
  2. Grant Permissions: Allow camera and HealthKit access
  3. Set Goals: Enter your fitness and nutrition goals
  4. Connect Health: Sync with Apple Health (optional)

Essential Settings

  • Choose metric or imperial units
  • Set daily calorie target
  • Configure macro ratios
  • Enable notifications
🎯

Setting Your Goals

Goal Types

  • Weight Loss: Caloric deficit with macro optimization
  • Muscle Gain: Caloric surplus with high protein
  • Maintenance: Balanced intake for current weight
  • Athletic: Performance-based nutrition

TDEE Calculation

MacroChef uses the Mifflin-St Jeor Equation combined with HealthKit data for accurate Total Daily Energy Expenditure calculations.

Feature Documentation

Detailed guides for every MacroChef feature

📊 Food Logging System

Barcode Scanning

MacroChef's barcode scanner uses VisionKit for fast, accurate food identification:

  • Database: 2.8M+ products from OpenFoodFacts
  • Accuracy: 95%+ recognition rate for packaged foods
  • Performance: Sub-second scanning in good lighting
  • Offline Mode: Cached results for previously scanned items

Manual Food Entry

Complete nutrition database with search functionality:

  • Search by food name, brand, or category
  • Custom portion sizes and units
  • Save frequently used foods as favorites
  • Create custom recipes with automatic nutrition calculation

❤️ HealthKit Integration

Data Synchronization

MacroChef integrates with Apple Health for comprehensive tracking:

  • Weight: Automatic weight updates for TDEE recalculation
  • Activity: Active energy from workouts and daily movement
  • Sleep: Sleep duration affects metabolic calculations
  • Heart Rate: Resting heart rate for fitness assessment

Privacy & Security

  • All health data stays on your device
  • Granular permission controls
  • Option to disconnect at any time
  • No health data shared with third parties

🧠 Adaptive TDEE System

Calculation Method

MacroChef uses advanced algorithms to calculate your Total Daily Energy Expenditure:

  1. Baseline: Mifflin-St Jeor Equation for BMR
  2. Activity Factor: HealthKit data for accurate activity levels
  3. Adaptation: Weekly adjustments based on actual progress
  4. Machine Learning: Pattern recognition for personalized predictions

Weekly Check-ins

  • Progress assessment every Sunday
  • Automatic TDEE adjustments based on results
  • Goal modifications if needed
  • Metabolic adaptation detection

API Reference

Technical documentation for developers and integrations

📊 SwiftData Models

UserProfile

@Model
class UserProfile {
    var id: UUID
    var email: String
    var firstName: String
    var lastName: String
    var dateOfBirth: Date
    var biologicalSex: HKBiologicalSex
    var heightCm: Double
    var currentWeightKg: Double
    var goalWeightKg: Double
    var activityLevel: ActivityLevel
    var dietType: DietType
    var dailyCalorieGoal: Int
    var proteinPercentage: Double
    var carbPercentage: Double
    var fatPercentage: Double
    var createdAt: Date
    var updatedAt: Date
}

FoodEntry

@Model
class FoodEntry {
    var id: UUID
    var foodItem: FoodItem
    var servingSize: Double
    var servingUnit: String
    var mealType: MealType
    var loggedAt: Date
    var userProfile: UserProfile
    
    // Calculated properties
    var totalCalories: Double
    var totalProtein: Double
    var totalCarbs: Double
    var totalFat: Double
}

🔌 External API Integrations

OpenFoodFacts API

Food database integration for barcode scanning:

// Barcode lookup
GET https://world.openfoodfacts.org/api/v0/product/{barcode}.json

// Search foods
GET https://world.openfoodfacts.org/cgi/search.pl
?search_terms={query}&json=true&page_size=20

HealthKit Framework

Health data integration and permissions:

// Request permissions
let healthStore = HKHealthStore()
let typesToRead: Set = [
    HKQuantityType.quantityType(forIdentifier: .bodyMass)!,
    HKQuantityType.quantityType(forIdentifier: .activeEnergyBurned)!,
    HKCategoryType.categoryType(forIdentifier: .sleepAnalysis)!
]

healthStore.requestAuthorization(toShare: nil, read: typesToRead) { success, error in
    // Handle authorization result
}

🏗️ Core Data Structures

NutritionFacts

struct NutritionFacts {
    let caloriesPer100g: Double
    let proteinPer100g: Double
    let carbsPer100g: Double
    let fatPer100g: Double
    let fiberPer100g: Double?
    let sugarPer100g: Double?
    let sodiumPer100g: Double?
    
    func calculateForServing(size: Double, unit: String) -> NutritionFacts {
        // Calculate nutrition for specific serving size
    }
}

TDEECalculation

struct TDEECalculation {
    let bmr: Double // Basal Metabolic Rate
    let activityMultiplier: Double
    let tdee: Double // Total Daily Energy Expenditure
    let deficit: Double // For weight loss goals
    let targetCalories: Double
    let lastUpdated: Date
    let confidenceScore: Double // ML confidence in calculation
}

Third-Party Integrations

Connect MacroChef with your favorite health and fitness apps

🍎

Apple Health

Status: ✅ Fully Supported

  • Weight and body measurements
  • Active and resting energy
  • Workout data integration
  • Sleep analysis
  • Heart rate data
🏃

Fitness Apps

Status: 🚧 Coming Soon

  • Strava workout integration
  • MyFitnessPal migration
  • Fitbit device sync
  • Garmin Connect
  • Polar Flow
🛒

Food & Shopping

Status: 📋 Planned

  • Instacart shopping lists
  • Amazon Fresh integration
  • Local grocery store APIs
  • Restaurant menu data
  • Delivery app integration

Troubleshooting

Common issues and solutions

🔧 Common Issues

Barcode Scanner Not Working

  • Check Camera Permissions: Settings > MacroChef > Camera
  • Lighting: Ensure adequate lighting for barcode visibility
  • Distance: Hold device 6-12 inches from barcode
  • Barcode Quality: Ensure barcode is not damaged or obscured

HealthKit Data Not Syncing

  • Permissions: Check Health app > Sharing > MacroChef
  • Data Sources: Ensure your scale/fitness tracker is connected to Health
  • Background Refresh: Settings > General > Background App Refresh
  • Re-authorize: Disconnect and reconnect in MacroChef settings

Incorrect Calorie Calculations

  • Check Profile: Verify height, weight, age, and activity level
  • Update Weight: Regular weight updates improve accuracy
  • Activity Level: Ensure activity level matches your lifestyle
  • Weekly Check-ins: Complete weekly assessments for adaptations

📱 Performance Optimization

Improve App Performance

  • Storage: Ensure at least 500MB free storage
  • iOS Version: Update to latest iOS version
  • Background Apps: Close unnecessary background apps
  • App Updates: Keep MacroChef updated to latest version

Battery Optimization

  • Location Services: Disable if not needed
  • HealthKit Frequency: Adjust sync frequency in settings
  • Notifications: Optimize notification settings
  • Dark Mode: Use dark mode on OLED devices

🆘 Getting Help

Support Channels

Before Contacting Support

  1. Check this troubleshooting guide
  2. Ensure you're running the latest app version
  3. Try restarting the app
  4. Include device model and iOS version in your message