# shreeharsh-patil/yummy-tummy architecture

> Architecture diagram of the GitHub repository shreeharsh-patil/yummy-tummy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shreeharsh-patil/yummy-tummy
- Repository: https://github.com/shreeharsh-patil/yummy-tummy

## Overview

Yummy Tummy is an authenticated Expo cooking companion. Users discover and search recipes, compare them with pantry ingredients, save recipes, manage shopping and cooking history, cook from recipe details, and participate in a creator community; video tutorials and optional AI generation extend that flow. The Zustand store coordinates app state and service calls, while Firebase backs sign-in and user/community data. The graph includes documented capabilities whose implementation was not sampled; those links cite the README rather than implying source inspection.

Main entry points: [`store/useAppStore.js`](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/store/useAppStore.js) (App state), [`worker/src/index.js`](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/worker/src/index.js) (AI generation Worker), [`services/communityService.js`](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/communityService.js) (Community service), [`services/firebaseClient.js`](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/firebaseClient.js) (Firebase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_layout["App shell<br/>[_layout.jsx]"]
  node_home["Home discovery<br/>[index.jsx]"]
  node_explore["Recipe explore<br/>[explore.jsx]"]
  node_pantry["Pantry<br/>[pantry.jsx]"]
  node_saved["Saved recipes<br/>[saved.jsx]"]
  node_community["Community<br/>[community.jsx]"]
  node_profile["Profile<br/>[profile.jsx]"]
  node_theme["Design system<br/>[ThemeProvider.jsx]"]
end

subgraph group_domain["Cooking features"]
  node_recipe_detail["Recipe details"]
  node_shopping["Shopping list"]
  node_history["Cooking history<br/>[history.jsx]"]
  node_preferences["Preferences<br/>[preferences.jsx]"]
end

subgraph group_services["Client services"]
  node_store["App state<br/>[useAppStore.js]"]
  node_recipe_service["Recipe domain<br/>[recipeService.js]"]
  node_recipe_client["Recipe catalogue"]
  node_firestore_service["User data service"]
  node_community_service["Community service"]
  node_storage_service["Media uploads<br/>[storageService.js]"]
  node_youtube_service["Tutorial lookup<br/>[youtubeService.js]"]
  node_ai_service["AI recipe client"]
end

subgraph group_backend["Cloud and data"]
  node_firebase_client["Firebase client<br/>[firebaseClient.js]"]
  node_firebase_auth{{"Firebase Auth"}}
  node_firestore[("Firestore")]
  node_storage[("Cloud Storage")]
  node_mealdb{{"TheMealDB"}}
  node_videos{{"Invidious video search"}}
  node_worker["AI generation Worker<br/>[index.js]"]
  node_generation["Generation logic"]
  node_gemini["Gemini<br/>[gemini.js]"]
  node_d1[("Shared AI cache<br/>[d1Repository.js]")]
end

node_user(("Signed-in cook"))

node_user -->|"opens app"| node_layout
node_layout -->|"reads state"| node_store
node_layout -->|"provides theme"| node_theme
node_home -->|"reads state"| node_store
node_explore -->|"uses state"| node_store
node_pantry -->|"uses state"| node_store
node_saved -->|"uses state"| node_store
node_community -->|"uses state"| node_store
node_profile -->|"uses state"| node_store
node_store -->|"calls"| node_recipe_service
node_store -->|"coordinates data"| node_firestore_service
node_store -->|"coordinates community"| node_community_service
node_store -->|"requests AI"| node_ai_service
node_recipe_service -->|"uses catalogue"| node_recipe_client
node_recipe_client -->|"fetches recipes"| node_mealdb
node_firestore_service -->|"uses Firebase"| node_firebase_client
node_community_service -->|"uses Firebase"| node_firebase_client
node_storage_service -->|"uses Firebase"| node_firebase_client
node_firebase_client -->|"authenticates"| node_firebase_auth
node_firestore_service -->|"reads and writes"| node_firestore
node_community_service -->|"stores community data"| node_firestore
node_storage_service -->|"uploads photos"| node_storage
node_recipe_detail -->|"uses recipe state"| node_store
node_shopping -->|"uses list state"| node_store
node_history -->|"uses history state"| node_store
node_preferences -->|"uses preferences"| node_store
node_community_service -.->|"supports tutorials"| node_youtube_service
node_youtube_service -->|"searches videos"| node_videos
node_ai_service -.->|"requests generation"| node_worker
node_worker -->|"dispatches generation"| node_generation
node_worker -->|"generates recipes"| node_gemini
node_worker -->|"uses cache"| node_d1
node_worker -->|"verifies user"| node_firebase_auth

click node_layout "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/_layout.jsx"
click node_home "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/index.jsx"
click node_explore "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/explore.jsx"
click node_pantry "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/pantry.jsx"
click node_saved "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/saved.jsx"
click node_community "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/community.jsx"
click node_profile "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/profile.jsx"
click node_recipe_detail "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/components/RecipeDetailModal.jsx"
click node_shopping "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/components/ShoppingListModal.jsx"
click node_history "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/history.jsx"
click node_preferences "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/preferences.jsx"
click node_store "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/store/useAppStore.js"
click node_recipe_service "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/recipeService.js"
click node_recipe_client "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/clientRecipeService.js"
click node_firestore_service "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/firestoreService.js"
click node_community_service "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/communityService.js"
click node_storage_service "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/storageService.js"
click node_youtube_service "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/youtubeService.js"
click node_firebase_client "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/firebaseClient.js"
click node_theme "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/theme/ThemeProvider.jsx"
click node_ai_service "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/aiKitchenChefService.js"
click node_worker "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/worker/src/index.js"
click node_generation "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/shared/server/generationService.js"
click node_gemini "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/worker/src/gemini.js"
click node_d1 "https://github.com/shreeharsh-patil/yummy-tummy/blob/main/worker/src/d1Repository.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_layout,node_home,node_explore,node_pantry,node_saved,node_community,node_profile,node_theme toneBlue
class node_recipe_detail,node_shopping,node_history,node_preferences toneAmber
class node_store,node_recipe_service,node_recipe_client,node_firestore_service,node_community_service,node_storage_service,node_youtube_service,node_ai_service toneMint
class node_firebase_client,node_firebase_auth,node_firestore,node_storage,node_mealdb,node_videos,node_worker,node_generation,node_gemini,node_d1 toneRose
class node_user toneIndigo
```

## Components

### App experience

- [App shell](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/_layout.jsx): `app/_layout.jsx`
- [Home discovery](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/index.jsx): `app/(tabs)/index.jsx`
- [Recipe explore](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/explore.jsx): `app/(tabs)/explore.jsx`
- [Pantry](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/pantry.jsx): `app/(tabs)/pantry.jsx`
- [Saved recipes](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/saved.jsx): `app/(tabs)/saved.jsx`
- [Community](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/community.jsx): `app/(tabs)/community.jsx`
- [Profile](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/(tabs)/profile.jsx): `app/(tabs)/profile.jsx`
- [Design system](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/theme/ThemeProvider.jsx): `theme/ThemeProvider.jsx`

### Cooking features

- [Recipe details](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/components/RecipeDetailModal.jsx): `components/RecipeDetailModal.jsx`
- [Shopping list](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/components/ShoppingListModal.jsx): `components/ShoppingListModal.jsx`
- [Cooking history](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/history.jsx): `app/history.jsx`
- [Preferences](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/app/preferences.jsx): `app/preferences.jsx`

### Client services

- [App state](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/store/useAppStore.js): `store/useAppStore.js`
- [Recipe domain](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/recipeService.js): `services/recipeService.js`
- [Recipe catalogue](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/clientRecipeService.js): `services/clientRecipeService.js`
- [User data service](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/firestoreService.js): `services/firestoreService.js`
- [Community service](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/communityService.js): `services/communityService.js`
- [Media uploads](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/storageService.js): `services/storageService.js`
- [Tutorial lookup](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/youtubeService.js): `services/youtubeService.js`
- [AI recipe client](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/aiKitchenChefService.js): `services/aiKitchenChefService.js`

### Cloud and data

- [Firebase client](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/services/firebaseClient.js): `services/firebaseClient.js`
- **Firebase Auth**
- **Firestore**
- **Cloud Storage**
- **TheMealDB**
- **Invidious video search**
- [AI generation Worker](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/worker/src/index.js): `worker/src/index.js`
- [Generation logic](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/shared/server/generationService.js): `shared/server/generationService.js`
- [Gemini](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/worker/src/gemini.js): `worker/src/gemini.js`
- [Shared AI cache](https://github.com/shreeharsh-patil/yummy-tummy/blob/main/worker/src/d1Repository.js): `worker/src/d1Repository.js`

### Other components

- **Signed-in cook**

## Connections

- Signed-in cook → App shell: opens app (evidence: `README.md`)
- App shell → App state: reads state (evidence: `app/_layout.jsx`)
- App shell → Design system: provides theme (evidence: `app/_layout.jsx`)
- Home discovery → App state: reads state (evidence: `app/(tabs)/index.jsx`)
- Recipe explore → App state: uses state (evidence: `README.md`)
- Pantry → App state: uses state (evidence: `README.md`)
- Saved recipes → App state: uses state (evidence: `README.md`)
- Community → App state: uses state (evidence: `app/(tabs)/community.jsx`)
- Profile → App state: uses state (evidence: `README.md`)
- App state → Recipe domain: calls (evidence: `store/useAppStore.js`)
- App state → User data service: coordinates data (evidence: `README.md`)
- App state → Community service: coordinates community (evidence: `app/(tabs)/community.jsx`)
- App state → AI recipe client: requests AI (evidence: `store/useAppStore.js`)
- Recipe domain → Recipe catalogue: uses catalogue (evidence: `README.md`)
- Recipe catalogue → TheMealDB: fetches recipes (evidence: `services/clientRecipeService.js`)
- User data service → Firebase client: uses Firebase (evidence: `services/firestoreService.js`)
- Community service → Firebase client: uses Firebase (evidence: `services/communityService.js`)
- Media uploads → Firebase client: uses Firebase (evidence: `services/storageService.js`)
- Firebase client → Firebase Auth: authenticates (evidence: `README.md`)
- User data service → Firestore: reads and writes (evidence: `README.md`)
- Community service → Firestore: stores community data (evidence: `README.md`)
- Media uploads → Cloud Storage: uploads photos (evidence: `services/storageService.js`)
- Recipe details → App state: uses recipe state (evidence: `app/_layout.jsx`)
- Shopping list → App state: uses list state (evidence: `app/_layout.jsx`)
- Cooking history → App state: uses history state (evidence: `README.md`)
- Preferences → App state: uses preferences (evidence: `README.md`)
- Community service → Tutorial lookup: supports tutorials
- Tutorial lookup → Invidious video search: searches videos (evidence: `README.md`)
- AI recipe client → AI generation Worker: requests generation
- AI generation Worker → Generation logic: dispatches generation (evidence: `worker/src/index.js`)
- AI generation Worker → Gemini: generates recipes (evidence: `worker/src/index.js`)
- AI generation Worker → Shared AI cache: uses cache (evidence: `worker/src/index.js`)
- AI generation Worker → Firebase Auth: verifies user (evidence: `worker/src/index.js`)
