MealEngine is a Swift-based iOS app designed to help users meet their dietary goals before (not after) meals are consumed. Unlike traditional calorie trackers that analyze past behavior, MealEngine meets and supports users where they are. The app leverages a Knapsack optimization algorithm to recommend meals in real time that respect user-defined goals. What sets MealEngine apart from other related apps is this: While others are reactive by logging after eating, MealEngine optimizes before eating.
Users enter goals and search foods. MealEngine evaluates available options and recommends foods that best match calorie and macro targets. MealEngine transforms nutrition from a reactive tracking process into a proactive decision-making system, ensuring every meal constributs toward the user's health goals.
As a user:
- I want to set calorie and macro goals
- I want to search foods quickly
- I want food suggestions before I eat
- I want to log meals easily
- I want to track progress over time
- Search foods by name
- OpenFoodFacts API integration (primary)
- USDA FoodData Central API integration (secondary)
- Fast cached search results
- Loading/error handling
- Knapsack nutrient optimization
- Calorie limit filtering
- Ranked recommended foods list
- Calories tracked
- Protein tracked
- Carbs tracked
- Fat tracked
- Save meals
- Daily history
- Historical tracked days
- UserDefaults
@AppStorageCodable- Local file storage
- SwiftUI
- MVVM
- ObservableObject ViewModels
- Dependency Injection
- Protocol-based services
- Async/await networking
- Memory cache
- Disk cache
- Timeout-safe requests
- Swift
- SwiftUI
- Local Persistence (UserDefaults / file storage)
- REST API integration (OpenFoodFacts)
- Knapsack Optimization
MealEngine uses 8–9 essential SwiftUI components for interraction and layout:
TextTextFieldToggleSliderPickerButtonListNavigationViewImage
- Clone the repository:
bash git clone git@github.com:3takita/MealEngine.git Open the project in Xcode: open MealEngine.xcodeprojRun on a simulator or physical iPhone.
--
Stephen AnabaIsaias SoriaYixu ChenAndrew Kim
This project is licensed under the MIT License. See LICENSE file for details.





