# aditya-kumar-2358/salt-and-story architecture

> Architecture diagram of the GitHub repository aditya-kumar-2358/salt-and-story, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aditya-kumar-2358/salt-and-story
- Repository: https://github.com/aditya-kumar-2358/salt-and-story

## Overview

Salt & Story is a family recipe-preservation app: a user captures a memo or transcript, the backend transcribes audio and structures the words into a recipe, then the user edits, cooks from, and assembles recipes into a printable cookbook. The graph retains account controls, favorites, classics, narration, and photos as distinct capabilities. The README documents the service integrations; some internal links rely on imports or documented architecture because the relevant call sites were not excerpted.

Main entry points: [`backend/app/main.py`](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/main.py) (FastAPI service), [`frontend/src/api.ts`](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/api.ts) (API client), [`frontend/src/router.tsx`](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/router.tsx) (App routes), [`backend/app/pipeline.py`](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/pipeline.py) (Recipe processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_router["App routes<br/>[router.tsx]"]
  node_capture["Memo capture<br/>[AddMemo.tsx]"]
  node_api["API client<br/>[api.ts]"]
  node_authui["Sign-in state<br/>[auth.tsx]"]
end

subgraph group_recipe["Recipe lifecycle"]
  node_library["Recipe library<br/>[Library.tsx]"]
  node_recipeview["Recipe view<br/>[RecipePage.tsx]"]
  node_cookmode["Cook mode<br/>[CookMode.tsx]"]
  node_classics["Family classics<br/>[classics.ts]"]
  node_polling["Recipe status polling<br/>[hooks.ts]"]
end

subgraph group_services["AI and media"]
  node_backend["FastAPI service<br/>[main.py]"]
  node_pipeline["Recipe processing<br/>[pipeline.py]"]
  node_transcription["Speech transcription<br/>[eleven.py]"]
  node_structuring["Recipe structuring<br/>[llm.py]"]
  node_voice["Narration service<br/>[eleven.py]"]
end

subgraph group_account["Accounts and storage"]
  node_auth["Account controls<br/>[auth.py]"]
  node_settings["Runtime settings<br/>[config.py]"]
  node_models[("Recipe and user records<br/>[models.py]")]
  node_photos["Recipe photos<br/>[photos.py]"]
end

subgraph group_publishing["Cookbook publishing"]
  node_book["Book builder<br/>[BookPage.tsx]"]
  node_pdf["Cookbook PDF<br/>[pdf.py]"]
end

node_visitor(("Family user"))

node_visitor -->|"opens"| node_router
node_router -->|"routes to"| node_capture
node_router -->|"routes to"| node_library
node_router -->|"routes to"| node_recipeview
node_router -->|"routes to"| node_book
node_visitor -->|"records or enters"| node_capture
node_capture -->|"submits memo"| node_api
node_library -->|"loads recipes"| node_api
node_recipeview -->|"reads and edits"| node_api
node_recipeview -->|"offers"| node_cookmode
node_capture -->|"offers samples"| node_classics
node_api -->|"requests"| node_backend
node_backend -->|"dispatches processing"| node_pipeline
node_pipeline -->|"transcribes audio"| node_transcription
node_pipeline -->|"structures transcript"| node_structuring
node_pipeline -->|"updates recipe"| node_models
node_structuring -.->|"optionally narrates"| node_voice
node_backend -->|"handles accounts"| node_auth
node_authui -->|"signs in via"| node_api
node_backend -->|"uses persistence"| node_models
node_backend -->|"handles photos"| node_photos
node_settings -->|"configures storage"| node_models
node_book -->|"selects recipes"| node_api
node_book -->|"requests export"| node_pdf
node_backend -->|"renders cookbook"| node_pdf
node_library -.->|"tracks progress"| node_polling

click node_router "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/router.tsx"
click node_capture "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/pages/AddMemo.tsx"
click node_api "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/api.ts"
click node_authui "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/auth.tsx"
click node_library "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/pages/Library.tsx"
click node_recipeview "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/pages/RecipePage.tsx"
click node_cookmode "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/components/CookMode.tsx"
click node_classics "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/classics.ts"
click node_polling "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/hooks.ts"
click node_backend "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/main.py"
click node_pipeline "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/pipeline.py"
click node_transcription "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/eleven.py"
click node_structuring "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/llm.py"
click node_voice "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/eleven.py"
click node_auth "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/auth.py"
click node_settings "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/config.py"
click node_models "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/models.py"
click node_photos "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/photos.py"
click node_book "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/pages/BookPage.tsx"
click node_pdf "https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/pdf.py"

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_capture,node_api,node_authui,node_visitor toneBlue
class node_library,node_recipeview,node_cookmode,node_classics,node_polling toneAmber
class node_backend,node_pipeline,node_transcription,node_structuring,node_voice toneMint
class node_auth,node_settings,node_models,node_photos toneRose
class node_book,node_pdf toneIndigo
```

## Components

### Web experience

- [App routes](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/router.tsx): `frontend/src/router.tsx`
- [Memo capture](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/pages/AddMemo.tsx): `frontend/src/pages/AddMemo.tsx`
- [API client](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/api.ts): `frontend/src/api.ts`
- [Sign-in state](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/auth.tsx): `frontend/src/auth.tsx`

### Recipe lifecycle

- [Recipe library](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/pages/Library.tsx): `frontend/src/pages/Library.tsx`
- [Recipe view](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/pages/RecipePage.tsx): `frontend/src/pages/RecipePage.tsx`
- [Cook mode](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/components/CookMode.tsx): `frontend/src/components/CookMode.tsx`
- [Family classics](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/classics.ts): `frontend/src/classics.ts`
- [Recipe status polling](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/hooks.ts): `frontend/src/hooks.ts`

### AI and media

- [FastAPI service](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/main.py): `backend/app/main.py`
- [Recipe processing](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/pipeline.py): `backend/app/pipeline.py`
- [Speech transcription](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/eleven.py): `backend/app/eleven.py`
- [Recipe structuring](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/llm.py): `backend/app/llm.py`
- [Narration service](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/eleven.py): `backend/app/eleven.py`

### Accounts and storage

- [Account controls](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/auth.py): `backend/app/auth.py`
- [Runtime settings](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/config.py): `backend/app/config.py`
- [Recipe and user records](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/models.py): `backend/app/models.py`
- [Recipe photos](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/photos.py): `backend/app/photos.py`

### Cookbook publishing

- [Book builder](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/frontend/src/pages/BookPage.tsx): `frontend/src/pages/BookPage.tsx`
- [Cookbook PDF](https://github.com/aditya-kumar-2358/salt-and-story/blob/main/backend/app/pdf.py): `backend/app/pdf.py`

### Other components

- **Family user**

## Connections

- Family user → App routes: opens (evidence: `frontend/src/router.tsx`)
- App routes → Memo capture: routes to (evidence: `frontend/src/router.tsx`)
- App routes → Recipe library: routes to (evidence: `frontend/src/router.tsx`)
- App routes → Recipe view: routes to (evidence: `frontend/src/router.tsx`)
- App routes → Book builder: routes to (evidence: `frontend/src/router.tsx`)
- Family user → Memo capture: records or enters (evidence: `README.md`)
- Memo capture → API client: submits memo (evidence: `frontend/src/pages/AddMemo.tsx`)
- Recipe library → API client: loads recipes (evidence: `frontend/src/pages/Library.tsx`)
- Recipe view → API client: reads and edits (evidence: `frontend/src/pages/RecipePage.tsx`)
- Recipe view → Cook mode: offers (evidence: `frontend/src/pages/RecipePage.tsx`)
- Memo capture → Family classics: offers samples (evidence: `frontend/src/pages/AddMemo.tsx`)
- API client → FastAPI service: requests (evidence: `README.md`)
- FastAPI service → Recipe processing: dispatches processing (evidence: `backend/app/main.py`)
- Recipe processing → Speech transcription: transcribes audio (evidence: `backend/app/pipeline.py`)
- Recipe processing → Recipe structuring: structures transcript (evidence: `backend/app/pipeline.py`)
- Recipe processing → Recipe and user records: updates recipe (evidence: `backend/app/pipeline.py`)
- Recipe structuring → Narration service: optionally narrates
- FastAPI service → Account controls: handles accounts (evidence: `backend/app/main.py`)
- Sign-in state → API client: signs in via (evidence: `frontend/src/auth.tsx`)
- FastAPI service → Recipe and user records: uses persistence (evidence: `backend/app/main.py`)
- FastAPI service → Recipe photos: handles photos (evidence: `backend/app/main.py`)
- Runtime settings → Recipe and user records: configures storage (evidence: `backend/app/models.py`)
- Book builder → API client: selects recipes (evidence: `frontend/src/pages/BookPage.tsx`)
- Book builder → Cookbook PDF: requests export (evidence: `README.md`)
- FastAPI service → Cookbook PDF: renders cookbook (evidence: `backend/app/main.py`)
- Recipe library → Recipe status polling: tracks progress (evidence: `frontend/src/pages/Library.tsx`)
