5.5 KiB
5.5 KiB
SousChefAI - Quick Setup Guide
This guide will help you get SousChefAI up and running.
Prerequisites
- macOS 14.0 or later
- Xcode 15.0 or later
- iOS 17.0+ device or simulator
- Active internet connection for API calls
Step 1: Configure API Keys
Overshoot Vision API
- Visit the Overshoot API provider website and create an account
- Generate an API key for video inference
- Open
SousChefAI/Config/AppConfig.swift - Replace
INSERT_KEY_HEREwith your Overshoot API key:
static let overshootAPIKey = "your_overshoot_api_key_here"
Google Gemini API
- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key
- In
SousChefAI/Config/AppConfig.swift, replace:
static let geminiAPIKey = "your_gemini_api_key_here"
Step 2: Add Firebase (Optional but Recommended)
Add Firebase SDK
- In Xcode, go to
File>Add Package Dependencies - Enter:
https://github.com/firebase/firebase-ios-sdk - Select version
10.0.0or later - Add these products to your target:
- FirebaseAuth
- FirebaseFirestore
Configure Firebase Project
- Go to Firebase Console
- Create a new project or select existing
- Click "Add app" and select iOS
- Enter bundle identifier:
com.yourcompany.SousChefAI - Download
GoogleService-Info.plist - Drag the file into your Xcode project (ensure it's added to the SousChefAI target)
Enable Firebase in Code
- Open
SousChefAI/SousChefAIApp.swift - Uncomment these lines:
import FirebaseCore
init() {
FirebaseApp.configure()
}
Configure Firestore Database
- In Firebase Console, go to Firestore Database
- Click "Create database"
- Start in test mode (or production mode with proper rules)
- Choose a location close to your users
Step 3: Configure Camera Permissions (CRITICAL)
⚠️ The app will crash without this step!
Add Privacy Descriptions in Xcode
- In Xcode, select the SousChefAI target
- Go to the Info tab
- Under "Custom iOS Target Properties", click the + button
- Add these two keys:
Camera Permission:
- Key:
Privacy - Camera Usage Description(orNSCameraUsageDescription) - Value:
SousChefAI needs camera access to scan your fridge for ingredients and monitor your cooking progress in real-time.
Microphone Permission:
- Key:
Privacy - Microphone Usage Description(orNSMicrophoneUsageDescription) - Value:
SousChefAI uses the microphone to provide voice-guided cooking instructions.
📖 See PRIVACY_SETUP.md for detailed step-by-step instructions with screenshots.
Step 4: Build and Run
- Open
SousChefAI.xcodeprojin Xcode - Select your target device (iOS 17.0+ required)
- Press
⌘ + Rto build and run - Allow camera permissions when prompted
Testing Without API Keys
If you want to test the UI without API keys:
- The app will show placeholder data and errors for API calls
- You can still navigate through the UI
- Manual ingredient entry will work
- Recipe generation will fail gracefully
Troubleshooting
Build Errors
"Missing GoogleService-Info.plist"
- Ensure the file is in your project and added to the target
- Check that it's not in a subdirectory
"Module 'Firebase' not found"
- Make sure you added the Firebase package correctly
- Clean build folder:
⌘ + Shift + K - Rebuild:
⌘ + B
"API Key Missing" errors
- Check that you replaced "INSERT_KEY_HERE" in AppConfig.swift
- API keys should be strings without quotes inside the quotes
Runtime Errors
"Camera access denied"
- Go to Settings > Privacy & Security > Camera
- Enable camera access for SousChefAI
"Network request failed"
- Check internet connection
- Verify API keys are valid
- Check API endpoint URLs in AppConfig.swift
"Firebase configuration error"
- Ensure GoogleService-Info.plist is properly added
- Verify Firebase initialization is uncommented
- Check Firestore is enabled in Firebase Console
Architecture Overview
The app follows MVVM architecture with clean separation:
Views → ViewModels → Services → APIs/Firebase
↓ ↓ ↓
Models ← Repository ← Firestore
Next Steps
Once the app is running:
- Test the Scanner: Point camera at ingredients and scan
- Review Inventory: Edit quantities and add items manually
- Set Preferences: Configure dietary restrictions
- Generate Recipes: Get AI-powered recipe suggestions
- Cooking Mode: Try the live cooking assistant
Optional Enhancements
Add Google Generative AI SDK
For better Gemini integration:
- Add package:
https://github.com/google/generative-ai-swift - Update
GeminiRecipeService.swiftto use the SDK - Uncomment the SDK-based code in the service
Configure Overshoot WebSocket
If using WebSocket for real-time detection:
- Update
overshootWebSocketURLin AppConfig.swift - Verify the WebSocket endpoint with Overshoot documentation
- Test real-time detection in Scanner view
Support
For issues or questions:
- Check the main README.md
- Open an issue on GitHub
- Review the inline documentation in code files
Security Notes
⚠️ Important: Never commit API keys to version control!
Consider:
- Using environment variables for keys
- Adding
AppConfig.swiftto.gitignore(but keep a template) - Using a secrets management service in production
- Rotating keys regularly
You're all set! Happy cooking with SousChefAI! 🍳