# safa-kaware/the-pink-apron architecture

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

- Interactive diagram: https://gitdiagram.com/safa-kaware/the-pink-apron
- Repository: https://github.com/safa-kaware/the-pink-apron

## Overview

The Pink Apron is a React recipe-sharing cookbook with personal and community collections, AI-assisted recipe creation and discovery, recipe interactions, and a persistent grocery list. Users browse featured or community recipes, open details, and save, rate, comment on, or add ingredients to their list; signed-in cooks can create recipes manually or with AI assistance. The graph follows relationships shown in the README or source index and excerpts; unsampled feature internals are represented at their known component paths, without guessing their calls.

Main entry points: [`src/App.tsx`](https://github.com/safa-kaware/the-pink-apron/blob/main/src/App.tsx) (App navigation), [`src/lib/firebase.ts`](https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/firebase.ts) (Firebase setup), [`src/components/RecipeDetail.tsx`](https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/RecipeDetail.tsx) (Recipe details), [`src/components/RecipeForm.tsx`](https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/RecipeForm.tsx) (Recipe editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Cookbook experience"]
  node_app["App navigation<br/>[App.tsx]"]
  node_landing["Discover feed<br/>[LandingPage.tsx]"]
  node_navbar["Account navigation<br/>[Navbar.tsx]"]
  node_filter["Category filter<br/>[CategoryFilter.tsx]"]
end

subgraph group_recipes["Recipe workflows"]
  node_recipe_card["Recipe cards<br/>[RecipeCard.tsx]"]
  node_recipe_detail["Recipe details<br/>[RecipeDetail.tsx]"]
  node_recipe_form["Recipe editor<br/>[RecipeForm.tsx]"]
  node_recipe_pool["Featured recipes<br/>[recipePool.ts]"]
end

subgraph group_services["Data and AI services"]
  node_recipe_data["Recipe queries<br/>[useRecipes.ts]"]
  node_firestore[("Firestore")]
  node_firebase["Firebase setup<br/>[firebase.ts]"]
  node_auth["Authentication<br/>[useAuth.tsx]"]
  node_ai_service["Recipe AI<br/>[aiService.ts]"]
  node_gemini["Gemini utilities<br/>[gemini.ts]"]
end

subgraph group_personal["Personal tools"]
  node_grocery_view["Grocery checklist<br/>[GroceryList.tsx]"]
  node_grocery_hook["Grocery state<br/>[useGroceryList.ts]"]
  node_browser_storage[("Browser storage")]
end

node_cook(("Cook"))

node_cook -->|"uses"| node_app
node_app -->|"shows"| node_landing
node_app -->|"shows"| node_navbar
node_app -->|"shows"| node_filter
node_app -->|"shows"| node_recipe_card
node_app -->|"opens"| node_recipe_detail
node_app -->|"opens"| node_recipe_form
node_app -->|"loads recipes"| node_recipe_data
node_app -->|"queries discover"| node_firebase
node_app -->|"uses fallback"| node_recipe_pool
node_navbar -->|"uses"| node_auth
node_landing -->|"generates images"| node_gemini
node_landing -->|"shows recipes"| node_recipe_pool
node_filter -.->|"filters"| node_recipe_card
node_recipe_card -->|"uses"| node_recipe_data
node_recipe_card -->|"uses"| node_gemini
node_recipe_detail -->|"rates and likes"| node_recipe_data
node_recipe_detail -->|"adds ingredients"| node_grocery_hook
node_recipe_detail -->|"deletes recipe"| node_firebase
node_recipe_detail -->|"rescales recipe"| node_ai_service
node_recipe_form -->|"uses"| node_recipe_data
node_recipe_form -->|"saves recipe"| node_firebase
node_recipe_form -->|"extracts and illustrates"| node_gemini
node_recipe_form -.->|"parses recipe"| node_ai_service
node_recipe_data -->|"queries and updates"| node_firebase
node_firebase -->|"connects"| node_firestore
node_auth -->|"uses auth and data"| node_firebase
node_auth -->|"syncs profiles"| node_firestore
node_ai_service -.->|"calls model"| node_gemini
node_gemini -.->|"requests generation"| node_cook
node_grocery_view -->|"uses"| node_grocery_hook
node_grocery_hook -->|"persists list"| node_browser_storage

click node_app "https://github.com/safa-kaware/the-pink-apron/blob/main/src/App.tsx"
click node_landing "https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/LandingPage.tsx"
click node_navbar "https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/Navbar.tsx"
click node_filter "https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/CategoryFilter.tsx"
click node_recipe_card "https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/RecipeCard.tsx"
click node_recipe_detail "https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/RecipeDetail.tsx"
click node_recipe_form "https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/RecipeForm.tsx"
click node_recipe_data "https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/useRecipes.ts"
click node_firebase "https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/firebase.ts"
click node_auth "https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/useAuth.tsx"
click node_ai_service "https://github.com/safa-kaware/the-pink-apron/blob/main/src/services/aiService.ts"
click node_gemini "https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/gemini.ts"
click node_recipe_pool "https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/recipePool.ts"
click node_grocery_view "https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/GroceryList.tsx"
click node_grocery_hook "https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/useGroceryList.ts"

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_app,node_landing,node_navbar,node_filter toneBlue
class node_recipe_card,node_recipe_detail,node_recipe_form,node_recipe_pool toneAmber
class node_recipe_data,node_firestore,node_firebase,node_auth,node_ai_service,node_gemini toneMint
class node_grocery_view,node_grocery_hook,node_browser_storage toneRose
class node_cook toneIndigo
```

## Components

### Cookbook experience

- [App navigation](https://github.com/safa-kaware/the-pink-apron/blob/main/src/App.tsx): `src/App.tsx`
- [Discover feed](https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/LandingPage.tsx): `src/components/LandingPage.tsx`
- [Account navigation](https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Category filter](https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/CategoryFilter.tsx): `src/components/CategoryFilter.tsx`

### Recipe workflows

- [Recipe cards](https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/RecipeCard.tsx): `src/components/RecipeCard.tsx`
- [Recipe details](https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/RecipeDetail.tsx): `src/components/RecipeDetail.tsx`
- [Recipe editor](https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/RecipeForm.tsx): `src/components/RecipeForm.tsx`
- [Featured recipes](https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/recipePool.ts): `src/lib/recipePool.ts`

### Data and AI services

- [Recipe queries](https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/useRecipes.ts): `src/lib/useRecipes.ts`
- **Firestore**
- [Firebase setup](https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- [Authentication](https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/useAuth.tsx): `src/lib/useAuth.tsx`
- [Recipe AI](https://github.com/safa-kaware/the-pink-apron/blob/main/src/services/aiService.ts): `src/services/aiService.ts`
- [Gemini utilities](https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/gemini.ts): `src/lib/gemini.ts`

### Personal tools

- [Grocery checklist](https://github.com/safa-kaware/the-pink-apron/blob/main/src/components/GroceryList.tsx): `src/components/GroceryList.tsx`
- [Grocery state](https://github.com/safa-kaware/the-pink-apron/blob/main/src/lib/useGroceryList.ts): `src/lib/useGroceryList.ts`
- **Browser storage**

### Other components

- **Cook**

## Connections

- Cook → App navigation: uses (evidence: `README.md`)
- App navigation → Discover feed: shows (evidence: `src/App.tsx`)
- App navigation → Account navigation: shows (evidence: `src/App.tsx`)
- App navigation → Category filter: shows (evidence: `src/App.tsx`)
- App navigation → Recipe cards: shows (evidence: `src/App.tsx`)
- App navigation → Recipe details: opens (evidence: `src/App.tsx`)
- App navigation → Recipe editor: opens (evidence: `src/App.tsx`)
- App navigation → Recipe queries: loads recipes (evidence: `src/App.tsx`)
- App navigation → Firebase setup: queries discover (evidence: `src/App.tsx`)
- App navigation → Featured recipes: uses fallback (evidence: `src/App.tsx`)
- Account navigation → Authentication: uses (evidence: `src/components/Navbar.tsx`)
- Discover feed → Gemini utilities: generates images (evidence: `src/components/LandingPage.tsx`)
- Discover feed → Featured recipes: shows recipes (evidence: `src/components/LandingPage.tsx`)
- Category filter → Recipe cards: filters
- Recipe cards → Recipe queries: uses (evidence: `src/components/RecipeCard.tsx`)
- Recipe cards → Gemini utilities: uses (evidence: `src/components/RecipeCard.tsx`)
- Recipe details → Recipe queries: rates and likes (evidence: `src/components/RecipeDetail.tsx`)
- Recipe details → Grocery state: adds ingredients (evidence: `src/components/RecipeDetail.tsx`)
- Recipe details → Firebase setup: deletes recipe (evidence: `src/components/RecipeDetail.tsx`)
- Recipe details → Recipe AI: rescales recipe (evidence: `src/components/RecipeDetail.tsx`)
- Recipe editor → Recipe queries: uses (evidence: `src/components/RecipeForm.tsx`)
- Recipe editor → Firebase setup: saves recipe (evidence: `src/components/RecipeForm.tsx`)
- Recipe editor → Gemini utilities: extracts and illustrates (evidence: `src/components/RecipeForm.tsx`)
- Recipe editor → Recipe AI: parses recipe (evidence: `src/components/RecipeForm.tsx`)
- Recipe queries → Firebase setup: queries and updates (evidence: `src/lib/useRecipes.ts`)
- Firebase setup → Firestore: connects (evidence: `src/lib/firebase.ts`)
- Authentication → Firebase setup: uses auth and data (evidence: `src/lib/useAuth.tsx`)
- Authentication → Firestore: syncs profiles (evidence: `src/lib/useAuth.tsx`)
- Recipe AI → Gemini utilities: calls model
- Gemini utilities → Cook: requests generation
- Grocery checklist → Grocery state: uses (evidence: `src/components/GroceryList.tsx`)
- Grocery state → Browser storage: persists list (evidence: `README.md`)
