# sitialiani/lamakin-web-app architecture

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

- Interactive diagram: https://gitdiagram.com/sitialiani/lamakin-web-app
- Repository: https://github.com/sitialiani/lamakin-web-app

## Overview

LamakIn is a health-focused recipe assistant. Users authenticate, set a health profile, submit recipe text or a food photo for AI analysis, then review and save healthier recipe results. The app also offers fridge-ingredient suggestions and a recipe library with a cloud menu calendar, aggregated shopping list, and print-friendly views. The graph follows the sampled router, context, and service calls; calendar and shopping-list details are documented in the README but their implementation was not sampled.

Main entry points: [`src/context/GlobalContext.jsx`](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/context/GlobalContext.jsx) (Session and profile state), [`src/App.jsx`](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/App.jsx) (Route and guard), [`src/services/supabase.js`](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/services/supabase.js) (Cloud client), [`src/pages/Library.jsx`](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Library.jsx) (Saved recipes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flow"]
  node_router["Route and guard<br/>[App.jsx]"]
  node_layout["App layout<br/>[Layout.jsx]"]
  node_navigation["Navigation controls<br/>[Navbar.jsx]"]
  node_accessibility["Accessibility settings"]
end

subgraph group_features["Recipe features"]
  node_analyze["Recipe input<br/>[AnalyzeRecipe.jsx]"]
  node_results["Analysis results<br/>[AnalysisResult.jsx]"]
  node_fridge["Fridge suggestions<br/>[Fridge.jsx]"]
  node_dashboard["Recipe dashboard<br/>[Dashboard.jsx]"]
  node_library["Saved recipes<br/>[Library.jsx]"]
  node_calendar["Menu calendar<br/>[Library.jsx]"]
  node_shopping["Shopping list<br/>[Library.jsx]"]
end

subgraph group_account["Account and preferences"]
  node_auth["Sign in<br/>[Auth.jsx]"]
  node_profile_setup["Health setup<br/>[SetupProfile.jsx]"]
  node_profile["Health profile<br/>[Profile.jsx]"]
  node_global["Session and profile state<br/>[GlobalContext.jsx]"]
  node_translation["Language selection<br/>[useTranslation.js]"]
  node_dictionary["Translation dictionaries<br/>[translations.js]"]
end

subgraph group_services["External services"]
  node_ai_service["Recipe AI<br/>[gemini.js]"]
  node_supabase_client["Cloud client<br/>[supabase.js]"]
end

node_user(("User"))
node_gemini{{"Google Gemini"}}
node_supabase[("Supabase cloud")]

node_user -->|"opens app"| node_router
node_router -->|"provides state"| node_global
node_router -->|"routes to"| node_auth
node_router -->|"routes to"| node_profile_setup
node_router -->|"wraps pages"| node_layout
node_router -->|"routes to"| node_analyze
node_router -->|"routes to"| node_results
node_router -->|"routes to"| node_fridge
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_library
node_router -->|"routes to"| node_profile
node_layout -->|"renders"| node_navigation
node_layout -->|"renders"| node_accessibility
node_auth -->|"uses auth"| node_supabase_client
node_global -->|"reads session"| node_supabase_client
node_global -->|"updates profile"| node_supabase_client
node_supabase_client -.->|"connects to"| node_supabase
node_profile_setup -->|"saves profile"| node_global
node_profile -->|"uses profile"| node_global
node_accessibility -->|"saves settings"| node_global
node_analyze -->|"requests analysis"| node_ai_service
node_ai_service -.->|"generates response"| node_gemini
node_analyze -->|"uses profile state"| node_global
node_results -->|"uses analysis state"| node_global
node_results -->|"persists recipes"| node_supabase_client
node_fridge -->|"requests suggestions"| node_ai_service
node_fridge -->|"uses profile state"| node_global
node_dashboard -->|"loads recipes"| node_supabase_client
node_dashboard -->|"uses profile state"| node_global
node_library -->|"manages recipes"| node_supabase_client
node_library -->|"includes calendar"| node_calendar
node_library -->|"aggregates ingredients"| node_shopping
node_library -->|"uses profile state"| node_global
node_translation -->|"reads language"| node_global
node_translation -->|"selects strings"| node_dictionary
node_navigation -->|"uses session profile"| node_global
node_navigation -->|"translates labels"| node_translation

click node_router "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/App.jsx"
click node_layout "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/components/Layout.jsx"
click node_auth "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Auth.jsx"
click node_profile_setup "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/SetupProfile.jsx"
click node_profile "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Profile.jsx"
click node_global "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/context/GlobalContext.jsx"
click node_translation "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/hooks/useTranslation.js"
click node_dictionary "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/utils/translations.js"
click node_analyze "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/AnalyzeRecipe.jsx"
click node_ai_service "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/services/gemini.js"
click node_results "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/AnalysisResult.jsx"
click node_fridge "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Fridge.jsx"
click node_dashboard "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Dashboard.jsx"
click node_library "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Library.jsx"
click node_calendar "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Library.jsx"
click node_shopping "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Library.jsx"
click node_supabase_client "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/services/supabase.js"
click node_navigation "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/components/Navbar.jsx"
click node_accessibility "https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/components/AccessibilityWidget.jsx"

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_router,node_layout,node_navigation,node_accessibility,node_user toneBlue
class node_analyze,node_results,node_fridge,node_dashboard,node_library,node_calendar,node_shopping,node_supabase toneAmber
class node_auth,node_profile_setup,node_profile,node_global,node_translation,node_dictionary toneMint
class node_ai_service,node_supabase_client toneRose
class node_gemini toneIndigo
```

## Components

### Application flow

- [Route and guard](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/App.jsx): `src/App.jsx`
- [App layout](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/components/Layout.jsx): `src/components/Layout.jsx`
- [Navigation controls](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Accessibility settings](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/components/AccessibilityWidget.jsx): `src/components/AccessibilityWidget.jsx`

### Recipe features

- [Recipe input](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/AnalyzeRecipe.jsx): `src/pages/AnalyzeRecipe.jsx`
- [Analysis results](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/AnalysisResult.jsx): `src/pages/AnalysisResult.jsx`
- [Fridge suggestions](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Fridge.jsx): `src/pages/Fridge.jsx`
- [Recipe dashboard](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Saved recipes](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Library.jsx): `src/pages/Library.jsx`
- [Menu calendar](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Library.jsx): `src/pages/Library.jsx`
- [Shopping list](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Library.jsx): `src/pages/Library.jsx`

### Account and preferences

- [Sign in](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Auth.jsx): `src/pages/Auth.jsx`
- [Health setup](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/SetupProfile.jsx): `src/pages/SetupProfile.jsx`
- [Health profile](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/pages/Profile.jsx): `src/pages/Profile.jsx`
- [Session and profile state](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/context/GlobalContext.jsx): `src/context/GlobalContext.jsx`
- [Language selection](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/hooks/useTranslation.js): `src/hooks/useTranslation.js`
- [Translation dictionaries](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/utils/translations.js): `src/utils/translations.js`

### External services

- [Recipe AI](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/services/gemini.js): `src/services/gemini.js`
- [Cloud client](https://github.com/sitialiani/lamakin-web-app/blob/prototype/src/services/supabase.js): `src/services/supabase.js`

### Other components

- **User**
- **Google Gemini**
- **Supabase cloud**

## Connections

- User → Route and guard: opens app (evidence: `src/App.jsx`)
- Route and guard → Session and profile state: provides state (evidence: `src/App.jsx`)
- Route and guard → Sign in: routes to (evidence: `src/App.jsx`)
- Route and guard → Health setup: routes to (evidence: `src/App.jsx`)
- Route and guard → App layout: wraps pages (evidence: `src/App.jsx`)
- Route and guard → Recipe input: routes to (evidence: `src/App.jsx`)
- Route and guard → Analysis results: routes to (evidence: `src/App.jsx`)
- Route and guard → Fridge suggestions: routes to (evidence: `src/App.jsx`)
- Route and guard → Recipe dashboard: routes to (evidence: `src/App.jsx`)
- Route and guard → Saved recipes: routes to (evidence: `src/App.jsx`)
- Route and guard → Health profile: routes to (evidence: `src/App.jsx`)
- App layout → Navigation controls: renders (evidence: `src/components/Layout.jsx`)
- App layout → Accessibility settings: renders (evidence: `src/components/Layout.jsx`)
- Sign in → Cloud client: uses auth (evidence: `src/pages/Auth.jsx`)
- Session and profile state → Cloud client: reads session (evidence: `src/context/GlobalContext.jsx`)
- Session and profile state → Cloud client: updates profile (evidence: `src/context/GlobalContext.jsx`)
- Cloud client → Supabase cloud: connects to
- Health setup → Session and profile state: saves profile (evidence: `src/pages/SetupProfile.jsx`)
- Health profile → Session and profile state: uses profile (evidence: `src/pages/Profile.jsx`)
- Accessibility settings → Session and profile state: saves settings (evidence: `src/components/AccessibilityWidget.jsx`)
- Recipe input → Recipe AI: requests analysis (evidence: `src/pages/AnalyzeRecipe.jsx`)
- Recipe AI → Google Gemini: generates response
- Recipe input → Session and profile state: uses profile state (evidence: `src/pages/AnalyzeRecipe.jsx`)
- Analysis results → Session and profile state: uses analysis state (evidence: `src/pages/AnalysisResult.jsx`)
- Analysis results → Cloud client: persists recipes (evidence: `src/pages/AnalysisResult.jsx`)
- Fridge suggestions → Recipe AI: requests suggestions (evidence: `src/pages/Fridge.jsx`)
- Fridge suggestions → Session and profile state: uses profile state (evidence: `src/pages/Fridge.jsx`)
- Recipe dashboard → Cloud client: loads recipes (evidence: `src/pages/Dashboard.jsx`)
- Recipe dashboard → Session and profile state: uses profile state (evidence: `src/pages/Dashboard.jsx`)
- Saved recipes → Cloud client: manages recipes (evidence: `src/pages/Library.jsx`)
- Saved recipes → Menu calendar: includes calendar (evidence: `README.md`)
- Saved recipes → Shopping list: aggregates ingredients (evidence: `README.md`)
- Saved recipes → Session and profile state: uses profile state (evidence: `src/pages/Library.jsx`)
- Language selection → Session and profile state: reads language (evidence: `src/hooks/useTranslation.js`)
- Language selection → Translation dictionaries: selects strings (evidence: `src/hooks/useTranslation.js`)
- Navigation controls → Session and profile state: uses session profile (evidence: `src/components/Navbar.jsx`)
- Navigation controls → Language selection: translates labels (evidence: `src/components/Navbar.jsx`)
