Hungry is a SwiftUI-based iOS application that helps users create recipes based on ingredients they have in their kitchen. The app uses computer vision and natural language processing to identify ingredients from photos and generate suitable recipes.
- Image Capture: Users can take photos of their kitchen or ingredients.
- Ingredient Recognition: The app uses OpenAI's Vision API to identify ingredients in the captured images.
- Recipe Generation: Based on identified ingredients, the app generates recipes using OpenAI's GPT-4.
- Ingredient Management: Users can manually add, edit, or remove ingredients from the identified list.
- Recipe Saving: Favorite recipes can be saved for quick access later.
- Recipe Filtering: Users can filter recipes based on dietary preferences (All, Vegetarian, Vegan, Gluten-Free).
- Detailed Recipe View: Each recipe includes name, ingredients, instructions, preparation time, and required appliances.
- iOS 14.0+
- Xcode 12.0+
- Swift 5.3+
- OpenAI API Key
Clone this repository:
git clone https://github.com/yourusername/kitchen-assistant.git
Open the project in Xcode:
cd kitchen-assistant
open KitchenAssistant.xcodeproj
Install dependencies using Swift Package Manager:
- In Xcode, go to
File > Swift Packages > Add Package Dependency
. - Enter the URL:
https://github.com/MacPaw/OpenAI.git
.
Add your OpenAI API key:
- In
ContentView.swift
, replace"YOUR_API_KEY_HERE"
with your actual OpenAI API key.
Build and run the project in Xcode.
- Launch the app and tap the camera button to take photos of your kitchen or ingredients.
- After capturing images, tap "Process Images" to identify ingredients.
- Review and edit the identified ingredients if necessary.
- The app will generate recipe suggestions based on the ingredients.
- Use the dietary filter to narrow down recipe options.
- Tap on a recipe to view details, including ingredients, instructions, and required appliances.
- Save favorite recipes for future reference.
The app follows a simple MVVM (Model-View-ViewModel) architecture:
- Models:
Recipe
struct - Views:
ContentView
,RecipeDetailView
,RecipeRowView
,IngredientManagementView
,SavedRecipesView
- ViewModels: The logic is currently in
ContentView
, but could be refactored into a separate ViewModel for better separation of concerns.
- OpenAI Swift: For interacting with OpenAI's API
- Implement local storage (Core Data or UserDefaults) for saved recipes.
- Add unit tests and UI tests.
- Implement error handling and retry mechanisms for API calls.
- Add a shopping list feature for missing ingredients.
- Implement portion adjustment for recipes.
- Add more advanced filtering and sorting options.
- Implement user accounts and cloud syncing for saved recipes.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- OpenAI for providing the API for ingredient recognition and recipe generation.
- The SwiftUI community for inspiration and resources.