Skip to content

3takita/MealEngine

Repository files navigation

MealEngine

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.


Core Idea

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.


Core User Stories

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

Features

Food Search

  • Search foods by name
  • OpenFoodFacts API integration (primary)
  • USDA FoodData Central API integration (secondary)
  • Fast cached search results
  • Loading/error handling

Smart Recommendationse

  • Knapsack nutrient optimization
  • Calorie limit filtering
  • Ranked recommended foods list

Nutrition Tracking

  • Calories tracked
  • Protein tracked
  • Carbs tracked
  • Fat tracked

Meal Logging

  • Save meals
  • Daily history
  • Historical tracked days

Persistence

  • UserDefaults
  • @AppStorage
  • Codable
  • Local file storage

Architecture

  • SwiftUI
  • MVVM
  • ObservableObject ViewModels
  • Dependency Injection
  • Protocol-based services

Performance

  • Async/await networking
  • Memory cache
  • Disk cache
  • Timeout-safe requests

Tech Stack

  • Swift
  • SwiftUI
  • Local Persistence (UserDefaults / file storage)
  • REST API integration (OpenFoodFacts)
  • Knapsack Optimization

Core UI Components

MealEngine uses 8–9 essential SwiftUI components for interraction and layout:

  • Text
  • TextField
  • Toggle
  • Slider
  • Picker
  • Button
  • List
  • NavigationView
  • Image

Screenshots

Landing Page

Fig. 1: Screenshot of the landing page

Goals View

Fig. 2: Screenshot of the Daily Goals View

Settings View

Fig. 3: Screenshot of the Settings View

History View

Fig. 4: Screenshot of the History View

Meal Saving

Fig. 5: Confirmation for meal saved

TDEE Calculator

Fig. 6: This is the landing page


Installation

  1. Clone the repository: bash git clone git@github.com:3takita/MealEngine.git
  2. Open the project in Xcode: open MealEngine.xcodeproj
  3. Run on a simulator or physical iPhone.

--

Group Members and Contributors

  • Stephen Anaba
  • Isaias Soria
  • Yixu Chen
  • Andrew Kim

License:

This project is licensed under the MIT License. See LICENSE file for details.

Releases

No releases published

Packages

 
 
 

Contributors

Languages