Comprehensive guides, API references, and technical documentation for MacroChef.
Everything you need to start using MacroChef effectively
MacroChef uses the Mifflin-St Jeor Equation combined with HealthKit data for accurate Total Daily Energy Expenditure calculations.
Detailed guides for every MacroChef feature
MacroChef's barcode scanner uses VisionKit for fast, accurate food identification:
Complete nutrition database with search functionality:
MacroChef integrates with Apple Health for comprehensive tracking:
MacroChef uses advanced algorithms to calculate your Total Daily Energy Expenditure:
Technical documentation for developers and integrations
@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
}
@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
}
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
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
}
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
}
}
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
}
Connect MacroChef with your favorite health and fitness apps
Status: ✅ Fully Supported
Status: 🚧 Coming Soon
Status: 📋 Planned
Common issues and solutions