     1→import Foundation
     2→import CoreLocation
     3→
     4→/// Lightweight model for storing favorite restaurants
     5→struct FavoriteRestaurant: Codable, Identifiable, Hashable {
     6→    let id: UUID
     7→    let name: String
     8→    let address: String
     9→    let latitude: Double
    10→    let longitude: Double
    11→    let phoneNumber: String?
    12→    let addedAt: Date
    13→
    14→    var coordinate: CLLocationCoordinate2D {
    15→        CLLocationCoordinate2D(latitude: latitude, longitude: longitude)
    16→    }
    17→
    18→    init(from restaurant: Restaurant) {
    19→        self.id = restaurant.id
    20→        self.name = restaurant.name
    21→        self.address = restaurant.address
    22→        self.latitude = restaurant.coordinate.latitude
    23→        self.longitude = restaurant.coordinate.longitude
    24→        self.phoneNumber = restaurant.phoneNumber
    25→        self.addedAt = Date()
    26→    }
    27→}
    28→
    29→/// Service for managing favorite restaurants
    30→@MainActor
    31→class FavoritesService: ObservableObject {
    32→
    33→    // MARK: - Published State
    34→
    35→    @Published private(set) var favorites: [FavoriteRestaurant] = []
    36→
    37→    // MARK: - Storage Keys
    38→
    39→    private let favoritesKey = "FoodFinder_Favorites"
    40→
    41→    // MARK: - Singleton
    42→
    43→    static let shared = FavoritesService()
    44→
    45→    // MARK: - Initialization
    46→
    47→    init() {
    48→        loadFavorites()
    49→    }
    50→
    51→    // MARK: - Public Methods
    52→
    53→    /// Check if a restaurant is favorited
    54→    func isFavorite(_ restaurant: Restaurant) -> Bool {
    55→        favorites.contains { $0.id == restaurant.id }
    56→    }
    57→
    58→    /// Check if a restaurant ID is favorited
    59→    func isFavorite(id: UUID) -> Bool {
    60→        favorites.contains { $0.id == id }
    61→    }
    62→
    63→    /// Add a restaurant to favorites
    64→    func addFavorite(_ restaurant: Restaurant) {
    65→        guard !isFavorite(restaurant) else { return }
    66→
    67→        let favorite = FavoriteRestaurant(from: restaurant)
    68→        favorites.insert(favorite, at: 0)
    69→        saveFavorites()
    70→    }
    71→
    72→    /// Remove a restaurant from favorites
    73→    func removeFavorite(_ restaurant: Restaurant) {
    74→        favorites.removeAll { $0.id == restaurant.id }
    75→        saveFavorites()
    76→    }
    77→
    78→    /// Remove a favorite by ID
    79→    func removeFavorite(id: UUID) {
    80→        favorites.removeAll { $0.id == id }
    81→        saveFavorites()
    82→    }
    83→
    84→    /// Toggle favorite status
    85→    func toggleFavorite(_ restaurant: Restaurant) {
    86→        if isFavorite(restaurant) {
    87→            removeFavorite(restaurant)
    88→        } else {
    89→            addFavorite(restaurant)
    90→        }
    91→    }
    92→
    93→    /// Clear all favorites
    94→    func clearAll() {
    95→        favorites = []
    96→        saveFavorites()
    97→    }
    98→
    99→    // MARK: - Private Methods
   100→
   101→    private func loadFavorites() {
   102→        guard let data = UserDefaults.standard.data(forKey: favoritesKey) else {
   103→            favorites = []
   104→            return
   105→        }
   106→
   107→        do {
   108→            favorites = try JSONDecoder().decode([FavoriteRestaurant].self, from: data)
   109→        } catch {
   110→            print("Failed to load favorites: \(error)")
   111→            favorites = []
   112→        }
   113→    }
   114→
   115→    private func saveFavorites() {
   116→        do {
   117→            let data = try JSONEncoder().encode(favorites)
   118→            UserDefaults.standard.set(data, forKey: favoritesKey)
   119→        } catch {
   120→            print("Failed to save favorites: \(error)")
   121→        }
   122→    }
   123→}
   124→

<system-reminder>
Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.
</system-reminder>

import Foundation
import CoreLocation

/// Lightweight model for storing favorite restaurants
struct FavoriteRestaurant: Codable, Identifiable, Hashable {
    let id: UUID
    let name: String
    let address: String
    let latitude: Double
    let longitude: Double
    let phoneNumber: String?
    let addedAt: Date

    var coordinate: CLLocationCoordinate2D {
        CLLocationCoordinate2D(latitude: latitude, longitude: longitude)
    }

    init(from restaurant: Restaurant) {
        self.id = restaurant.id
        self.name = restaurant.name
        self.address = restaurant.address
        self.latitude = restaurant.coordinate.latitude
        self.longitude = restaurant.coordinate.longitude
        self.phoneNumber = restaurant.phoneNumber
        self.addedAt = Date()
    }
}

/// Service for managing favorite restaurants
@MainActor
class FavoritesService: ObservableObject {

    // MARK: - Published State

    @Published private(set) var favorites: [FavoriteRestaurant] = []

    // MARK: - Storage Keys

    private let favoritesKey = "FoodFinder_Favorites"

    // MARK: - Singleton

    static let shared = FavoritesService()

    // MARK: - Initialization

    init() {
        loadFavorites()
    }

    // MARK: - Public Methods

    /// Check if a restaurant is favorited
    func isFavorite(_ restaurant: Restaurant) -> Bool {
        favorites.contains { $0.id == restaurant.id }
    }

    /// Check if a restaurant ID is favorited
    func isFavorite(id: UUID) -> Bool {
        favorites.contains { $0.id == id }
    }

    /// Add a restaurant to favorites
    func addFavorite(_ restaurant: Restaurant) {
        guard !isFavorite(restaurant) else { return }

        let favorite = FavoriteRestaurant(from: restaurant)
        favorites.insert(favorite, at: 0)
        saveFavorites()
    }

    /// Remove a restaurant from favorites
    func removeFavorite(_ restaurant: Restaurant) {
        favorites.removeAll { $0.id == restaurant.id }
        saveFavorites()
    }

    /// Remove a favorite by ID
    func removeFavorite(id: UUID) {
        favorites.removeAll { $0.id == id }
        saveFavorites()
    }

    /// Toggle favorite status
    func toggleFavorite(_ restaurant: Restaurant) {
        if isFavorite(restaurant) {
            removeFavorite(restaurant)
        } else {
            addFavorite(restaurant)
        }
    }

    /// Clear all favorites
    func clearAll() {
        favorites = []
        saveFavorites()
    }

    // MARK: - Private Methods

    private func loadFavorites() {
        guard let data = UserDefaults.standard.data(forKey: favoritesKey) else {
            favorites = []
            return
        }

        do {
            favorites = try JSONDecoder().decode([FavoriteRestaurant].self, from: data)
        } catch {
            print("Failed to load favorites: \(error)")
            favorites = []
        }
    }

    private func saveFavorites() {
        do {
            let data = try JSONEncoder().encode(favorites)
            UserDefaults.standard.set(data, forKey: favoritesKey)
        } catch {
            print("Failed to save favorites: \(error)")
        }
    }
}


     1→import Foundation
     2→
     3→/// User model representing an authenticated Apple Sign-In user
     4→struct User: Codable, Identifiable {
     5→    let id: String        // Apple user identifier
     6→    let email: String?
     7→    let fullName: String?
     8→
     9→    /// Display name for UI (name or email prefix)
    10→    var displayName: String {
    11→        if let name = fullName, !name.isEmpty {
    12→            return name
    13→        }
    14→        if let email = email {
    15→            return email.components(separatedBy: "@").first ?? email
    16→        }
    17→        return "User"
    18→    }
    19→
    20→    /// User initials for avatar display
    21→    var initials: String {
    22→        if let name = fullName {
    23→            let components = name.components(separatedBy: " ")
    24→            let initials = components.compactMap { $0.first }.prefix(2)
    25→            return String(initials).uppercased()
    26→        }
    27→        if let email = email {
    28→            return String(email.prefix(1)).uppercased()
    29→        }
    30→        return "U"
    31→    }
    32→}
    33→
    34→// MARK: - Preview Support
    35→
    36→#if DEBUG
    37→extension User {
    38→    static var preview: User {
    39→        User(
    40→            id: "preview-user-id",
    41→            email: "user@example.com",
    42→            fullName: "Preview User"
    43→        )
    44→    }
    45→}
    46→#endif
    47→

<system-reminder>
Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.
</system-reminder>

import Foundation

/// User model representing an authenticated Apple Sign-In user
struct User: Codable, Identifiable {
    let id: String        // Apple user identifier
    let email: String?
    let fullName: String?

    /// Display name for UI (name or email prefix)
    var displayName: String {
        if let name = fullName, !name.isEmpty {
            return name
        }
        if let email = email {
            return email.components(separatedBy: "@").first ?? email
        }
        return "User"
    }

    /// User initials for avatar display
    var initials: String {
        if let name = fullName {
            let components = name.components(separatedBy: " ")
            let initials = components.compactMap { $0.first }.prefix(2)
            return String(initials).uppercased()
        }
        if let email = email {
            return String(email.prefix(1)).uppercased()
        }
        return "U"
    }
}

// MARK: - Preview Support

#if DEBUG
extension User {
    static var preview: User {
        User(
            id: "preview-user-id",
            email: "user@example.com",
            fullName: "Preview User"
        )
    }
}
#endif


Perfect! Let me check the Views directory structure to understand all the UI components:


Bash

find /Users/neog/Apps/iOS/FoodFinder-iOS/FoodFinder-iOS -type f -name "*.swift" -exec basename {} \;

List all Swift files in FoodFinder


FoodFinderApp.swift
ContentView.swift
User.swift
Restaurant.swift
RestaurantAnnotationView.swift
RestaurantRow.swift
SignInView.swift
RestaurantDetailView.swift
FavoritesView.swift
MainView.swift
FavoritesService.swift
AuthenticationService.swift
KeychainService.swift
LocationService.swift
RestaurantService.swift


     1→import SwiftUI
     2→import MapKit
     3→
     4→/// View displaying the user's favorite restaurants
     5→struct FavoritesView: View {
     6→    @Environment(\.dismiss) private var dismiss
     7→    @StateObject private var favoritesService = FavoritesService.shared
     8→
     9→    var body: some View {
    10→        NavigationStack {
    11→            Group {
    12→                if favoritesService.favorites.isEmpty {
    13→                    emptyStateView
    14→                } else {
    15→                    favoritesList
    16→                }
    17→            }
    18→            .navigationTitle("Favorites")
    19→            .navigationBarTitleDisplayMode(.inline)
    20→            .toolbar {
    21→                ToolbarItem(placement: .topBarTrailing) {
    22→                    Button("Done") {
    23→                        dismiss()
    24→                    }
    25→                }
    26→
    27→                if !favoritesService.favorites.isEmpty {
    28→                    ToolbarItem(placement: .topBarLeading) {
    29→                        Button("Clear All", role: .destructive) {
    30→                            favoritesService.clearAll()
    31→                        }
    32→                        .foregroundColor(.red)
    33→                    }
    34→                }
    35→            }
    36→        }
    37→    }
    38→
    39→    // MARK: - Empty State
    40→
    41→    private var emptyStateView: some View {
    42→        VStack(spacing: 16) {
    43→            Image(systemName: "heart.slash")
    44→                .font(.system(size: 48))
    45→                .foregroundColor(.secondary)
    46→
    47→            Text("No Favorites Yet")
    48→                .font(.headline)
    49→
    50→            Text("Tap the heart icon on any restaurant to save it here")
    51→                .font(.subheadline)
    52→                .foregroundColor(.secondary)
    53→                .multilineTextAlignment(.center)
    54→                .padding(.horizontal, 40)
    55→        }
    56→        .frame(maxWidth: .infinity, maxHeight: .infinity)
    57→        .background(Color(.systemGroupedBackground))
    58→    }
    59→
    60→    // MARK: - Favorites List
    61→
    62→    private var favoritesList: some View {
    63→        List {
    64→            ForEach(favoritesService.favorites) { favorite in
    65→                FavoriteRow(favorite: favorite)
    66→                    .swipeActions(edge: .trailing, allowsFullSwipe: true) {
    67→                        Button(role: .destructive) {
    68→                            favoritesService.removeFavorite(id: favorite.id)
    69→                        } label: {
    70→                            Label("Remove", systemImage: "trash")
    71→                        }
    72→                    }
    73→            }
    74→        }
    75→        .listStyle(.insetGrouped)
    76→    }
    77→}
    78→
    79→// MARK: - Favorite Row
    80→
    81→struct FavoriteRow: View {
    82→    let favorite: FavoriteRestaurant
    83→
    84→    var body: some View {
    85→        HStack(spacing: 12) {
    86→            // Icon
    87→            ZStack {
    88→                Circle()
    89→                    .fill(Color.red.opacity(0.1))
    90→                    .frame(width: 44, height: 44)
    91→
    92→                Image(systemName: "heart.fill")
    93→                    .foregroundColor(.red)
    94→            }
    95→
    96→            // Info
    97→            VStack(alignment: .leading, spacing: 4) {
    98→                Text(favorite.name)
    99→                    .font(.headline)
   100→                    .lineLimit(1)
   101→
   102→                if !favorite.address.isEmpty {
   103→                    Text(favorite.address)
   104→                        .font(.caption)
   105→                        .foregroundColor(.secondary)
   106→                        .lineLimit(1)
   107→                }
   108→
   109→                Text("Added \(favorite.addedAt.formatted(.relative(presentation: .named)))")
   110→                    .font(.caption2)
   111→                    .foregroundColor(.secondary)
   112→            }
   113→
   114→            Spacer()
   115→
   116→            // Navigate button
   117→            Button {
   118→                openInMaps()
   119→            } label: {
   120→                Image(systemName: "arrow.triangle.turn.up.right.diamond.fill")
   121→                    .foregroundColor(.orange)
   122→            }
   123→            .buttonStyle(.plain)
   124→        }
   125→        .padding(.vertical, 4)
   126→    }
   127→
   128→    private func openInMaps() {
   129→        let placemark = MKPlacemark(coordinate: favorite.coordinate)
   130→        let mapItem = MKMapItem(placemark: placemark)
   131→        mapItem.name = favorite.name
   132→        mapItem.openInMaps(launchOptions: [
   133→            MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeDriving
   134→        ])
   135→    }
   136→}
   137→
   138→// MARK: - Preview
   139→
   140→#Preview("With Favorites") {
   141→    FavoritesView()
   142→}
   143→
   144→#Preview("Empty") {
   145→    FavoritesView()
   146→}
   147→

<system-reminder>
Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.
</system-reminder>

import SwiftUI
import MapKit

/// View displaying the user's favorite restaurants
struct FavoritesView: View {
    @Environment(\.dismiss) private var dismiss
    @StateObject private var favoritesService = FavoritesService.shared

    var body: some View {
        NavigationStack {
            Group {
                if favoritesService.favorites.isEmpty {
                    emptyStateView
                } else {
                    favoritesList
                }
            }
            .navigationTitle("Favorites")
            .navigationBarTitleDisplayMode(.inline)
            .toolbar {
                ToolbarItem(placement: .topBarTrailing) {
                    Button("Done") {
                        dismiss()
                    }
                }

                if !favoritesService.favorites.isEmpty {
                    ToolbarItem(placement: .topBarLeading) {
                        Button("Clear All", role: .destructive) {
                            favoritesService.clearAll()
                        }
                        .foregroundColor(.red)
                    }
                }
            }
        }
    }

    // MARK: - Empty State

    private var emptyStateView: some View {
        VStack(spacing: 16) {
            Image(systemName: "heart.slash")
                .font(.system(size: 48))
                .foregroundColor(.secondary)

            Text("No Favorites Yet")
                .font(.headline)

            Text("Tap the heart icon on any restaurant to save it here")
                .font(.subheadline)
                .foregroundColor(.secondary)
                .multilineTextAlignment(.center)
                .padding(.horizontal, 40)
        }
        .frame(maxWidth: .infinity, maxHeight: .infinity)
        .background(Color(.systemGroupedBackground))
    }

    // MARK: - Favorites List

    private var favoritesList: some View {
        List {
            ForEach(favoritesService.favorites) { favorite in
                FavoriteRow(favorite: favorite)
                    .swipeActions(edge: .trailing, allowsFullSwipe: true) {
                        Button(role: .destructive) {
                            favoritesService.removeFavorite(id: favorite.id)
                        } label: {
                            Label("Remove", systemImage: "trash")
                        }
                    }
            }
        }
        .listStyle(.insetGrouped)
    }
}

// MARK: - Favorite Row

struct FavoriteRow: View {
    let favorite: FavoriteRestaurant

    var body: some View {
        HStack(spacing: 12) {
            // Icon
            ZStack {
                Circle()
                    .fill(Color.red.opacity(0.1))
                    .frame(width: 44, height: 44)

                Image(systemName: "heart.fill")
                    .foregroundColor(.red)
            }

            // Info
            VStack(alignment: .leading, spacing: 4) {
                Text(favorite.name)
                    .font(.headline)
                    .lineLimit(1)

                if !favorite.address.isEmpty {
                    Text(favorite.address)
                        .font(.caption)
                        .foregroundColor(.secondary)
                        .lineLimit(1)
                }

                Text("Added \(favorite.addedAt.formatted(.relative(presentation: .named)))")
                    .font(.caption2)
                    .foregroundColor(.secondary)
            }

            Spacer()

            // Navigate button
            Button {
                openInMaps()
            } label: {
                Image(systemName: "arrow.triangle.turn.up.right.diamond.fill")
                    .foregroundColor(.orange)
            }
            .buttonStyle(.plain)
        }
        .padding(.vertical, 4)
    }

    private func openInMaps() {
        let placemark = MKPlacemark(coordinate: favorite.coordinate)
        let mapItem = MKMapItem(placemark: placemark)
        mapItem.name = favorite.name
        mapItem.openInMaps(launchOptions: [
            MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeDriving
        ])
    }
}

// MARK: - Preview

#Preview("With Favorites") {
    FavoritesView()
}

#Preview("Empty") {
    FavoritesView()
}


Excellent! Now I have a comprehensive understanding of the FoodFinder iOS app. Let me create a detailed summary report.

## FoodFinder iOS App - Architecture & AI Integration Analysis

Based on my exploration of the codebase, here's a comprehensive summary:

### Current Architecture Overview

**15 Swift Files | 4 Core Layers | Minimal Dependencies**

```
FoodFinder-iOS/
├── App/
│   ├── FoodFinderApp.swift         (Entry point with environment injection)
│   └── ContentView.swift           (Auth-based router)
│
├── Models/
│   ├── User.swift                  (Apple ID user with computed displayName)
│   └── Restaurant.swift            (MKMapItem wrapper with distance calculations)
│
├── Services/ (4 singleton/injected services)
│   ├── AuthenticationService       (Apple Sign-In + Keychain storage)
│   ├── LocationService             (CoreLocation with CLLocationManager)
│   ├── RestaurantService           (MKLocalSearch with 2km radius)
│   └── FavoritesService            (UserDefaults persistence)
│
├── Views/
│   ├── Auth/SignInView.swift
│   ├── Main/MainView.swift         (Map 35% + List 65% layout)
│   ├── Main/FavoritesView.swift
│   └── Detail/RestaurantDetailView.swift
│
└── Components/
    ├── RestaurantAnnotationView.swift (Map pins)
    └── RestaurantRow.swift            (List items)
```

---

### Key Service Details

#### RestaurantService (Core Data Source)
- **Search Mechanism**: `MKLocalSearch.Request` with natural language queries
- **Search Radius**: 2km (customizable in `searchRadius` variable)
- **Data Available Per Restaurant**:
  - Name, category (via pointOfInterestCategory)
  - Phone number, website URL
  - Coordinates and formatted address
  - Distance from user location
- **Categories**: 10 predefined food types (pizza, sushi, cafe, etc.)
- **State Published**: `restaurants`, `isLoading`, `error`, `selectedCategory`

#### LocationService (User Location)
- **Implementation**: CLLocationManager with permission handling
- **Accuracy**: kCLLocationAccuracyBest
- **State Published**: `currentLocation`, `authorizationStatus`, `locationError`, `isLoading`
- **Lifecycle**: Requests single location on app launch, then stops updates

#### FavoritesService (Local Persistence)
- **Storage**: UserDefaults (encoded JSON via Codable)
- **Structure**: Stores UUID, name, address, coordinates, phone, timestamp
- **Operations**: Add, remove, toggle, check if favorite, clear all
- **Singleton Pattern**: `FavoritesService.shared`

---

### UI Flow & Views

```
ContentView (Auth Router)
├─→ SignInView (Not Signed In)
│   └─→ Apple Sign-In Button
│       └─→ AuthenticationService.handleSignInResult()
│
└─→ MainView (Signed In)
    ├─ Category Filter Chips (horizontal scroll)
    │  └─ Triggers RestaurantService.setCategory()
    ├─ Map View (35% of screen)
    │  └─ User annotation + Restaurant pins
    │     └─ Tap pin → selectedRestaurant sheet
    ├─ Restaurant List (65% of screen)
    │  ├─ Shows sorted results (by distance)
    │  ├─ Heart icon for favorites
    │  └─ Tap row → RestaurantDetailView sheet
    └─ Toolbar Actions
       ├─ Refresh location
       ├─ Favorites modal (FavoritesView)
       └─ User menu (sign out)

RestaurantDetailView (Sheet)
├─ Header: Icon, name, address, distance
├─ Favorite toggle
└─ Actions:
   ├─ Get Directions (Apple Maps)
   ├─ Call restaurant
   └─ Visit website
```

---

### Key Integration Points for Claude AI Agent

#### 1. **Best Place to Add AI Service: New AIRecommendationService**

```swift
// Ideal location: Services/AIRecommendationService.swift
@MainActor
class AIRecommendationService: ObservableObject {
    @Published var recommendation: String?
    @Published var aiIsLoading: Bool = false
    @Published var aiError: String?

    // Dependencies available from parent views:
    // - restaurantService.restaurants [Restaurant]
    // - favoritesService.favorites [FavoriteRestaurant]
    // - locationService.currentLocation CLLocation
    // - user preferences (dietary, cuisine, budget)
}
```

#### 2. **Data Available to AI Agent**

Each Restaurant object contains:
- Name, category/cuisine type, phone, website URL
- Complete address with locality/city info
- Exact coordinates and distance from user
- User's location

All favorites are trackable with timestamps (when added).

#### 3. **Integration Points in Existing Views**

**Option A: Dedicated AI Chat View**
- Add tab in MainView or sheet button
- Show AI chat interface with restaurant context
- Can reference currently selected restaurant(s)

**Option B: Detail View Enhancement**
- Add "Ask AI" button in RestaurantDetailView
- AI analyzes selected restaurant and provides insights
- Shows personalized recommendations based on history

**Option C: MainView AI Panel**
- Add collapsible AI recommendation panel above/below list
- Real-time suggestions as category/location changes
- Uses filtered restaurants as context

#### 4. **Data Flow Architecture for AI**

```
User Input (Question/Preferences)
    ↓
AIRecommendationService
    ├─ Captures context:
    │  ├─ Current restaurants (from RestaurantService)
    │  ├─ User favorites (from FavoritesService)
    │  ├─ User location (from LocationService)
    │  └─ Selected category (from RestaurantService)
    ├─ Sends to Claude API
    └─ Publishes response
         ↓
    UI updates with recommendation
```

#### 5. **API Integration Pattern (Recommended)**

Create an `AIClient` utility:
```swift
// Services/AIClient.swift
class AIClient {
    func askAboutRestaurants(
        question: String,
        restaurants: [Restaurant],
        userFavorites: [FavoriteRestaurant],
        userLocation: CLLocation
    ) async throws -> String {
        // Call Claude API with structured context
        // Include restaurant details, user preferences, location
        // Return natural language response
    }
}
```

---

### Architecture Strengths for AI Integration

1. **Clean Service Layer**: Each service is isolated, published state makes data available to any view
2. **Location + Restaurants Combined**: AI has both user position and nearby venue data
3. **Favorites Tracking**: User preferences are discoverable for personalization
4. **Single Responsibility**: Restaurant search is separate from AI reasoning
5. **Reactive Pattern**: SwiftUI @Published makes real-time updates simple
6. **No External Dependencies**: Only native Apple frameworks - easy to add AI client

---

### Recommended AI Features for MVP

1. **Restaurant Question Answering**
   - "What's the best budget option here?"
   - "Are there vegan options?"
   - "What's the cuisine type at [restaurant]?"

2. **Smart Recommendations**
   - "Based on my favorites, what should I try?"
   - "I want [cuisine] but under [price], what do you suggest?"
   - "What's different about these restaurants?"

3. **Decision Making**
   - "I can't decide between these 3, which one should I pick?"
   - "Where should I eat with my family tonight?"
   - "Suggest something I haven't tried before"

4. **User Profiling**
   - Track which recommendations user accepts (favorites)
   - Learn cuisine preferences from history
   - Improve suggestions over time

---

### Critical Files for Implementation

- `/Users/neog/Apps/iOS/FoodFinder-iOS/FoodFinder-iOS/Services/RestaurantService.swift` - Restaurant data source
- `/Users/neog/Apps/iOS/FoodFinder-iOS/FoodFinder-iOS/Services/FavoritesService.swift` - User preferences
- `/Users/neog/Apps/iOS/FoodFinder-iOS/FoodFinder-iOS/Views/Main/MainView.swift` - Primary UI hub
- `/Users/neog/Apps/iOS/FoodFinder-iOS/FoodFinder-iOS/Views/Detail/RestaurantDetailView.swift` - Detail view entry point

---

### Summary

FoodFinder has a **lean, well-structured architecture** perfectly suited for AI integration. The app already extracts detailed restaurant metadata from Apple MapKit and tracks user preferences via favorites. The modular service layer means an AI service can be injected with minimal changes to existing code. The best approach is creating a new `AIRecommendationService` that consumes data from `RestaurantService`, `FavoritesService`, and `LocationService`, then presenting AI responses through either a dedicated view, detail view enhancement, or inline recommendation panel.