# ameya5006/palmchef architecture

> Architecture diagram of the GitHub repository ameya5006/palmchef, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ameya5006/palmchef
- Repository: https://github.com/ameya5006/palmchef

## Overview

PalmChef is a hands-free cooking assistant: users bring in recipes, follow cooking steps, and control narration and timers with gestures. The tree and README identify recipe import, PDF extraction, gesture, speech, timer, authentication, and offline capabilities; sampled source confirms the app routing, PDF utilities, auth API, persistence, and service-worker behavior. Wiring among unsampled recipe and assistant components is not asserted here.

Main entry points: [`src/pages/Assistant.tsx`](https://github.com/ameya5006/palmchef/blob/main/src/pages/Assistant.tsx) (Cooking Assistant), [`src/main.tsx`](https://github.com/ameya5006/palmchef/blob/main/src/main.tsx) (Browser App), [`src/routes.tsx`](https://github.com/ameya5006/palmchef/blob/main/src/routes.tsx) (Page Routes), [`src/pages/Auth.tsx`](https://github.com/ameya5006/palmchef/blob/main/src/pages/Auth.tsx) (Sign In)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_browser["Browser App<br/>[main.tsx]"]
  node_routes["Page Routes<br/>[routes.tsx]"]
  node_home["Home Page<br/>[Home.tsx]"]
end

subgraph group_recipes["Recipe Preparation"]
  node_recipes_page["Recipes Page<br/>[Recipes.tsx]"]
  node_recipe_form["Recipe Form<br/>[AddRecipeForm.tsx]"]
  node_pdf["PDF Extraction<br/>[pdfParser.ts]"]
  node_recipe_store["Recipe State<br/>[recipes.ts]"]
end

subgraph group_cooking["Guided Cooking"]
  node_assistant["Cooking Assistant<br/>[Assistant.tsx]"]
  node_gestures["Gesture Input<br/>[GestureCanvas.tsx]"]
  node_gesture_hud["Gesture Status<br/>[GestureHUD.tsx]"]
  node_gesture_util["Gesture Logic<br/>[gestures.ts]"]
  node_tts["Speech Controls<br/>[TTSControls.tsx]"]
  node_tts_util["Speech Utility<br/>[tts.ts]"]
  node_timer["Timer Display<br/>[TimerDisplay.tsx]"]
  node_session["Cooking Session<br/>[session.ts]"]
end

subgraph group_identity["Accounts and State"]
  node_auth_page["Sign In<br/>[Auth.tsx]"]
  node_api["Backend API<br/>[index.js]"]
  node_user_model["User Model<br/>[user.js]"]
  node_mongo[("User Database<br/>[db.js]")]
  node_user_store["User State<br/>[user.ts]"]
  node_settings["Preferences<br/>[settings.ts]"]
  node_local[("Browser Storage<br/>[storage.ts]")]
end

subgraph group_platform["Offline Platform"]
  node_service_worker["Offline Cache<br/>[sw.js]"]
end

node_cook(("Cook"))
node_gemini{{"Gemini AI"}}

node_cook -->|"uses"| node_browser
node_browser -->|"renders"| node_routes
node_routes -->|"routes"| node_home
node_routes -->|"routes"| node_recipes_page
node_routes -->|"routes"| node_assistant
node_routes -->|"routes"| node_auth_page
node_recipes_page -->|"offers import"| node_recipe_form
node_recipe_form -->|"extracts PDF"| node_pdf
node_assistant -->|"provides controls"| node_gestures
node_gestures -->|"interprets input"| node_gesture_util
node_assistant -->|"shows status"| node_gesture_hud
node_assistant -->|"offers narration"| node_tts
node_tts -->|"speaks steps"| node_tts_util
node_assistant -->|"shows timers"| node_timer
node_assistant -->|"tracks session"| node_session
node_auth_page -->|"authenticates"| node_api
node_api -->|"queries"| node_user_model
node_user_model -->|"persists users"| node_mongo
node_api -.->|"parses recipe"| node_gemini
node_browser -->|"reads state"| node_user_store
node_browser -->|"reads preferences"| node_settings
node_auth_page -->|"sets user"| node_user_store
node_auth_page -->|"stores credentials"| node_local
node_browser -->|"registers offline"| node_service_worker

click node_browser "https://github.com/ameya5006/palmchef/blob/main/src/main.tsx"
click node_routes "https://github.com/ameya5006/palmchef/blob/main/src/routes.tsx"
click node_home "https://github.com/ameya5006/palmchef/blob/main/src/pages/Home.tsx"
click node_recipes_page "https://github.com/ameya5006/palmchef/blob/main/src/pages/Recipes.tsx"
click node_recipe_form "https://github.com/ameya5006/palmchef/blob/main/src/components/AddRecipeForm.tsx"
click node_pdf "https://github.com/ameya5006/palmchef/blob/main/src/utils/pdfParser.ts"
click node_recipe_store "https://github.com/ameya5006/palmchef/blob/main/src/store/recipes.ts"
click node_assistant "https://github.com/ameya5006/palmchef/blob/main/src/pages/Assistant.tsx"
click node_gestures "https://github.com/ameya5006/palmchef/blob/main/src/components/GestureCanvas.tsx"
click node_gesture_hud "https://github.com/ameya5006/palmchef/blob/main/src/components/GestureHUD.tsx"
click node_gesture_util "https://github.com/ameya5006/palmchef/blob/main/src/utils/gestures.ts"
click node_tts "https://github.com/ameya5006/palmchef/blob/main/src/components/TTSControls.tsx"
click node_tts_util "https://github.com/ameya5006/palmchef/blob/main/src/utils/tts.ts"
click node_timer "https://github.com/ameya5006/palmchef/blob/main/src/components/TimerDisplay.tsx"
click node_session "https://github.com/ameya5006/palmchef/blob/main/src/store/session.ts"
click node_auth_page "https://github.com/ameya5006/palmchef/blob/main/src/pages/Auth.tsx"
click node_api "https://github.com/ameya5006/palmchef/blob/main/server/index.js"
click node_user_model "https://github.com/ameya5006/palmchef/blob/main/server/models/user.js"
click node_mongo "https://github.com/ameya5006/palmchef/blob/main/server/db.js"
click node_user_store "https://github.com/ameya5006/palmchef/blob/main/src/store/user.ts"
click node_settings "https://github.com/ameya5006/palmchef/blob/main/src/store/settings.ts"
click node_local "https://github.com/ameya5006/palmchef/blob/main/src/utils/storage.ts"
click node_service_worker "https://github.com/ameya5006/palmchef/blob/main/public/sw.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_browser,node_routes,node_home toneBlue
class node_recipes_page,node_recipe_form,node_pdf,node_recipe_store toneAmber
class node_assistant,node_gestures,node_gesture_hud,node_gesture_util,node_tts,node_tts_util,node_timer,node_session toneMint
class node_auth_page,node_api,node_user_model,node_mongo,node_user_store,node_settings,node_local toneRose
class node_service_worker,node_cook,node_gemini toneIndigo
```

## Components

### Application

- [Browser App](https://github.com/ameya5006/palmchef/blob/main/src/main.tsx): `src/main.tsx`
- [Page Routes](https://github.com/ameya5006/palmchef/blob/main/src/routes.tsx): `src/routes.tsx`
- [Home Page](https://github.com/ameya5006/palmchef/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`

### Recipe Preparation

- [Recipes Page](https://github.com/ameya5006/palmchef/blob/main/src/pages/Recipes.tsx): `src/pages/Recipes.tsx`
- [Recipe Form](https://github.com/ameya5006/palmchef/blob/main/src/components/AddRecipeForm.tsx): `src/components/AddRecipeForm.tsx`
- [PDF Extraction](https://github.com/ameya5006/palmchef/blob/main/src/utils/pdfParser.ts): `src/utils/pdfParser.ts`
- [Recipe State](https://github.com/ameya5006/palmchef/blob/main/src/store/recipes.ts): `src/store/recipes.ts`

### Guided Cooking

- [Cooking Assistant](https://github.com/ameya5006/palmchef/blob/main/src/pages/Assistant.tsx): `src/pages/Assistant.tsx`
- [Gesture Input](https://github.com/ameya5006/palmchef/blob/main/src/components/GestureCanvas.tsx): `src/components/GestureCanvas.tsx`
- [Gesture Status](https://github.com/ameya5006/palmchef/blob/main/src/components/GestureHUD.tsx): `src/components/GestureHUD.tsx`
- [Gesture Logic](https://github.com/ameya5006/palmchef/blob/main/src/utils/gestures.ts): `src/utils/gestures.ts`
- [Speech Controls](https://github.com/ameya5006/palmchef/blob/main/src/components/TTSControls.tsx): `src/components/TTSControls.tsx`
- [Speech Utility](https://github.com/ameya5006/palmchef/blob/main/src/utils/tts.ts): `src/utils/tts.ts`
- [Timer Display](https://github.com/ameya5006/palmchef/blob/main/src/components/TimerDisplay.tsx): `src/components/TimerDisplay.tsx`
- [Cooking Session](https://github.com/ameya5006/palmchef/blob/main/src/store/session.ts): `src/store/session.ts`

### Accounts and State

- [Sign In](https://github.com/ameya5006/palmchef/blob/main/src/pages/Auth.tsx): `src/pages/Auth.tsx`
- [Backend API](https://github.com/ameya5006/palmchef/blob/main/server/index.js): `server/index.js`
- [User Model](https://github.com/ameya5006/palmchef/blob/main/server/models/user.js): `server/models/user.js`
- [User Database](https://github.com/ameya5006/palmchef/blob/main/server/db.js): `server/db.js`
- [User State](https://github.com/ameya5006/palmchef/blob/main/src/store/user.ts): `src/store/user.ts`
- [Preferences](https://github.com/ameya5006/palmchef/blob/main/src/store/settings.ts): `src/store/settings.ts`
- [Browser Storage](https://github.com/ameya5006/palmchef/blob/main/src/utils/storage.ts): `src/utils/storage.ts`

### Offline Platform

- [Offline Cache](https://github.com/ameya5006/palmchef/blob/main/public/sw.js): `public/sw.js`

### Other components

- **Cook**
- **Gemini AI**

## Connections

- Cook → Browser App: uses
- Browser App → Page Routes: renders
- Page Routes → Home Page: routes
- Page Routes → Recipes Page: routes
- Page Routes → Cooking Assistant: routes
- Page Routes → Sign In: routes
- Recipes Page → Recipe Form: offers import
- Recipe Form → PDF Extraction: extracts PDF
- Cooking Assistant → Gesture Input: provides controls
- Gesture Input → Gesture Logic: interprets input
- Cooking Assistant → Gesture Status: shows status
- Cooking Assistant → Speech Controls: offers narration
- Speech Controls → Speech Utility: speaks steps
- Cooking Assistant → Timer Display: shows timers
- Cooking Assistant → Cooking Session: tracks session
- Sign In → Backend API: authenticates
- Backend API → User Model: queries
- User Model → User Database: persists users
- Backend API → Gemini AI: parses recipe
- Browser App → User State: reads state
- Browser App → Preferences: reads preferences
- Sign In → User State: sets user
- Sign In → Browser Storage: stores credentials
- Browser App → Offline Cache: registers offline
