FoodRecipe v2.0 is a native iOS culinary discovery, smart pantry ingredient matcher, hands-free cooking timer, and macro meal planner built with Swift 6, SwiftUI, Combine, Swift Charts, and Protocol-Oriented MVVM.
- Smart Pantry Ingredient Matcher (
PantryMatcherViewModel): Scores and ranks recipes in real time by Pantry Match % based on the ingredients currently available in the user's kitchen, isolating missing items for 1-tap export to the shopping cart. - Hybrid Live + Offline Recipe Engine (
LiveRecipeRepository): Fetches live dishes and high-resolution meal photography asynchronously fromTheMealDBOpen API while bundling an offline-first curated chef catalog (Anatolian, Mediterranean, High-Protein, Italian, and Asian bowls). - Actor-Isolated Image Caching (
actor RemoteImageCache): Two-tier (NSCachememory + disk directory) image pipeline with in-flight task coalescing to prevent duplicate network requests while scrolling. - Dynamic Portion & Macro Scaling (
Recipe.scaledIngredients(forServings:)): Pure functional scaling engine that recalculates gram/unit measurements and calorie/protein/carb/fat totals dynamically from1to12servings. - Hands-Free Step-by-Step Cooking Mode (
CookingSessionView): High-contrast full-screen kitchen assistant with per-step countdown timers, progress tracking, and chef tips. - Weekly Macro Analytics & Aisle-Grouped Shopping List (
MealPlannerView): Native Swift Charts visualization comparing scheduled daily calories and protein against user targets, paired with an automated grocery list organized by supermarket aisle.
flowchart LR
subgraph UI["SwiftUI Feature Layer (Features/ & UI/)"]
EX["ExploreView & RecipeDetailView"]
PM["PantryMatcherView (Match % Engine)"]
CM["CookingSessionView (Step Timers)"]
MP["MealPlannerView (Swift Charts)"]
end
subgraph VM["@MainActor ViewModels"]
EVM["ExploreViewModel (Combine Debounce)"]
PVM["PantryMatcherViewModel"]
CVM["CookingSessionViewModel"]
MVM["MealPlannerViewModel"]
end
subgraph Core["Core Domain, Networking & Persistence"]
REP["RecipeRepositoryProtocol / LiveRecipeRepository"]
IMG["actor RemoteImageCache (NSCache + Disk)"]
STR["KitchenStore (Pantry, Meal Plan & Cart)"]
end
EX --> EVM
PM --> PVM
CM --> CVM
MP --> MVM
EVM --> REP
EX --> IMG
EVM --> STR
PVM --> STR
MVM --> STR
FoodRecipe/
├── App/
│ ├── FoodRecipeApp.swift # App entry point & DI root
│ └── MainTabView.swift # 4-tab dark-mode navigation shell
├── Core/
│ ├── DI/
│ │ └── AppContainer.swift # Protocol-oriented dependency container
│ ├── Models/
│ │ └── RecipeModels.swift # Recipe, MacroBreakdown, PantryMatchResult, CookingStep
│ ├── Networking/
│ │ ├── RecipeRepository.swift # TheMealDB async client + offline chef catalog
│ │ └── RemoteImageCache.swift # Actor-isolated memory + disk image cache
│ └── Persistence/
│ └── KitchenStore.swift # Favorites, Pantry inventory, Weekly Meal Plan & Cart
├── Features/
│ ├── CookingMode/ # Hands-free step timer assistant
│ ├── Explore/ # Recipe search, cuisine filters & dynamic portion scaler
│ ├── Favorites/ # Saved personal cookbook
│ ├── MealPlanner/ # Swift Charts weekly calorie/macro telemetry & aisle cart
│ └── PantryMatcher/ # "What's in My Kitchen?" % match ranking engine
├── UI/
│ ├── Components/
│ │ ├── CachedMealImageView.swift # Async cached dish photography view
│ │ └── MacroRingBadge.swift # Circular protein/carb/fat telemetry ring
│ └── Theme/
│ └── CulinaryTheme.swift # Saffron & Emerald dark-mode design tokens
└── FoodRecipeTests/
└── FoodRecipeTests.swift # XCTest suite for portion scaling, pantry matching & macros
swiftc -typecheck -swift-version 6 \
-sdk $(xcrun --sdk iphonesimulator --show-sdk-path) \
-target arm64-apple-ios17.0-simulator \
$(find FoodRecipe -name '*.swift')
xcodebuild -project FoodRecipe.xcodeproj -listMIT — see LICENSE.