# drewbawden/simple-recipe-book architecture

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

- Interactive diagram: https://gitdiagram.com/drewbawden/simple-recipe-book
- Repository: https://github.com/drewbawden/simple-recipe-book

## Overview

Simple Recipe Book is a web application for browsing and editing recipes and managing a shopping list, with inventory-related screens also present. The main user flows are recipe-table interactions backed by recipe actions, and shopping-list interactions backed by list actions and persistent data. Recipe entry supports parsing external recipes; list management includes categorization and sorting. The graph includes these distinct product areas and shared UI/state support. Some subsystem wiring is documented only by the source index; uncertain integrations are omitted rather than inferred.

Main entry points: [`components/shopping-list/shopping-list.tsx`](https://github.com/drewbawden/simple-recipe-book/blob/main/components/shopping-list/shopping-list.tsx) (Shopping-list interface), [`components/recipes/recipe-table.tsx`](https://github.com/drewbawden/simple-recipe-book/blob/main/components/recipes/recipe-table.tsx) (Recipe table), [`actions/shopping-lists.ts`](https://github.com/drewbawden/simple-recipe-book/blob/main/actions/shopping-lists.ts) (Shopping-list actions), [`actions/recipes.ts`](https://github.com/drewbawden/simple-recipe-book/blob/main/actions/recipes.ts) (Recipe actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_recipes["Recipe book"]
  node_recipe_page["Recipe page<br/>[page.tsx]"]
  node_recipe_table["Recipe table<br/>[recipe-table.tsx]"]
  node_recipe_editor["Recipe editor<br/>[recipe-input.tsx]"]
  node_recipe_overview["Recipe overview<br/>[overview.tsx]"]
  node_recipe_actions["Recipe actions<br/>[recipes.ts]"]
  node_external_parser["External recipe parsing<br/>[parse-external.ts]"]
  node_recipe_types["Recipe data types<br/>[recipe.ts]"]
end

subgraph group_shopping["Shopping list"]
  node_list_page["List page<br/>[page.tsx]"]
  node_shopping_ui["Shopping-list interface<br/>[shopping-list.tsx]"]
  node_list_item_ui["List item controls<br/>[item-input.tsx]"]
  node_list_edit_ui["List settings<br/>[list-edit.tsx]"]
  node_shopping_actions["Shopping-list actions<br/>[shopping-lists.ts]"]
  node_item_actions["Item and category actions<br/>[items.ts]"]
  node_list_logic["List sorting logic<br/>[shopping-list.ts]"]
  node_list_types["List item types<br/>[list-item.ts]"]
end

subgraph group_inventory["Inventory"]
  node_scanner_page["Scanner page<br/>[page.tsx]"]
  node_barcode_scanner["Barcode scanner UI"]
  node_product_card["Product card<br/>[product-card.tsx]"]
  node_inventory_actions["Inventory actions<br/>[inventory.ts]"]
  node_inventory_types["Inventory types<br/>[inventory.ts]"]
end

subgraph group_platform["Shared services"]
  node_database[("Application database")]
  node_event_bus["Update events<br/>[event.ts]"]
  node_sse_route["SSE events route<br/>[route.ts]"]
  node_picture_route["Recipe picture route<br/>[route.ts]"]
  node_modal_state["Modal query state<br/>[useModalQuery.ts]"]
  node_modal_ui["Modal UI<br/>[modal.tsx]"]
  node_context_menu["Context menus<br/>[context-menu.tsx]"]
end

node_user(("User"))

node_user -->|"opens recipes"| node_recipe_page
node_recipe_page -->|"renders"| node_recipe_table
node_recipe_table -->|"loads and deletes"| node_recipe_actions
node_recipe_table -->|"opens editor"| node_recipe_editor
node_recipe_table -->|"shows overview"| node_recipe_overview
node_recipe_editor -->|"submits recipe"| node_recipe_actions
node_recipe_editor -->|"parses source"| node_external_parser
node_recipe_actions -->|"downloads image"| node_external_parser
node_recipe_actions -->|"reads and writes"| node_database
node_recipe_actions -->|"broadcasts updates"| node_event_bus
node_recipe_page -->|"controls modal query"| node_modal_state
node_recipe_table -->|"renders dialogs"| node_modal_ui
node_recipe_table -->|"uses menus"| node_context_menu
node_user -->|"opens list"| node_list_page
node_list_page -->|"renders"| node_shopping_ui
node_shopping_ui -->|"loads and changes items"| node_shopping_actions
node_shopping_ui -->|"loads recipe overview"| node_recipe_actions
node_shopping_ui -->|"renders item entry"| node_list_item_ui
node_shopping_ui -->|"renders list settings"| node_list_edit_ui
node_list_item_ui -->|"submits item changes"| node_shopping_actions
node_list_edit_ui -->|"loads categories"| node_item_actions
node_shopping_actions -->|"reads and writes"| node_database
node_shopping_actions -->|"increments usage"| node_item_actions
node_shopping_actions -->|"sorts list"| node_list_logic
node_shopping_actions -->|"broadcasts updates"| node_event_bus
node_user -->|"opens scanner"| node_scanner_page
node_scanner_page -->|"renders"| node_barcode_scanner
node_scanner_page -->|"renders"| node_product_card
node_scanner_page -->|"fetches inventory"| node_inventory_actions
node_inventory_actions -->|"reads inventory"| node_database
node_barcode_scanner -.->|"supports scanning flow"| node_product_card
node_sse_route -->|"streams updates"| node_event_bus
node_user -.->|"requests image"| node_picture_route
node_recipe_table -->|"reads and updates"| node_modal_state
node_shopping_ui -->|"reads and updates"| node_modal_state
node_shopping_ui -->|"renders dialogs"| node_modal_ui
node_shopping_ui -->|"uses menus"| node_context_menu

click node_recipe_page "https://github.com/drewbawden/simple-recipe-book/blob/main/app/page.tsx"
click node_recipe_table "https://github.com/drewbawden/simple-recipe-book/blob/main/components/recipes/recipe-table.tsx"
click node_recipe_editor "https://github.com/drewbawden/simple-recipe-book/blob/main/components/recipes/popups/recipe-input.tsx"
click node_recipe_overview "https://github.com/drewbawden/simple-recipe-book/blob/main/components/recipes/popups/overview.tsx"
click node_recipe_actions "https://github.com/drewbawden/simple-recipe-book/blob/main/actions/recipes.ts"
click node_external_parser "https://github.com/drewbawden/simple-recipe-book/blob/main/actions/parse-external.ts"
click node_recipe_types "https://github.com/drewbawden/simple-recipe-book/blob/main/types/recipe.ts"
click node_list_page "https://github.com/drewbawden/simple-recipe-book/blob/main/app/list/page.tsx"
click node_shopping_ui "https://github.com/drewbawden/simple-recipe-book/blob/main/components/shopping-list/shopping-list.tsx"
click node_list_item_ui "https://github.com/drewbawden/simple-recipe-book/blob/main/components/shopping-list/item-input.tsx"
click node_list_edit_ui "https://github.com/drewbawden/simple-recipe-book/blob/main/components/shopping-list/popups/list-edit.tsx"
click node_shopping_actions "https://github.com/drewbawden/simple-recipe-book/blob/main/actions/shopping-lists.ts"
click node_item_actions "https://github.com/drewbawden/simple-recipe-book/blob/main/actions/items.ts"
click node_list_logic "https://github.com/drewbawden/simple-recipe-book/blob/main/lib/shopping-list.ts"
click node_list_types "https://github.com/drewbawden/simple-recipe-book/blob/main/types/list-item.ts"
click node_scanner_page "https://github.com/drewbawden/simple-recipe-book/blob/main/app/scanner/page.tsx"
click node_barcode_scanner "https://github.com/drewbawden/simple-recipe-book/blob/main/components/inventory/barcode-scanner.tsx"
click node_product_card "https://github.com/drewbawden/simple-recipe-book/blob/main/components/inventory/product-card.tsx"
click node_inventory_actions "https://github.com/drewbawden/simple-recipe-book/blob/main/actions/inventory.ts"
click node_inventory_types "https://github.com/drewbawden/simple-recipe-book/blob/main/types/inventory.ts"
click node_event_bus "https://github.com/drewbawden/simple-recipe-book/blob/main/lib/event.ts"
click node_sse_route "https://github.com/drewbawden/simple-recipe-book/blob/main/app/api/sse/events/route.ts"
click node_picture_route "https://github.com/drewbawden/simple-recipe-book/blob/main/app/recipe-pictures/%5B...slug%5D/route.ts"
click node_modal_state "https://github.com/drewbawden/simple-recipe-book/blob/main/hooks/useModalQuery.ts"
click node_modal_ui "https://github.com/drewbawden/simple-recipe-book/blob/main/components/templates/modal.tsx"
click node_context_menu "https://github.com/drewbawden/simple-recipe-book/blob/main/components/templates/context-menu.tsx"

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_recipe_page,node_recipe_table,node_recipe_editor,node_recipe_overview,node_recipe_actions,node_external_parser,node_recipe_types,node_user toneBlue
class node_list_page,node_shopping_ui,node_list_item_ui,node_list_edit_ui,node_shopping_actions,node_item_actions,node_list_logic,node_list_types toneAmber
class node_scanner_page,node_barcode_scanner,node_product_card,node_inventory_actions,node_inventory_types toneMint
class node_database,node_event_bus,node_sse_route,node_picture_route,node_modal_state,node_modal_ui,node_context_menu toneRose
```

## Components

### Recipe book

- [Recipe page](https://github.com/drewbawden/simple-recipe-book/blob/main/app/page.tsx): `app/page.tsx`
- [Recipe table](https://github.com/drewbawden/simple-recipe-book/blob/main/components/recipes/recipe-table.tsx): `components/recipes/recipe-table.tsx`
- [Recipe editor](https://github.com/drewbawden/simple-recipe-book/blob/main/components/recipes/popups/recipe-input.tsx): `components/recipes/popups/recipe-input.tsx`
- [Recipe overview](https://github.com/drewbawden/simple-recipe-book/blob/main/components/recipes/popups/overview.tsx): `components/recipes/popups/overview.tsx`
- [Recipe actions](https://github.com/drewbawden/simple-recipe-book/blob/main/actions/recipes.ts): `actions/recipes.ts`
- [External recipe parsing](https://github.com/drewbawden/simple-recipe-book/blob/main/actions/parse-external.ts): `actions/parse-external.ts`
- [Recipe data types](https://github.com/drewbawden/simple-recipe-book/blob/main/types/recipe.ts): `types/recipe.ts`

### Shopping list

- [List page](https://github.com/drewbawden/simple-recipe-book/blob/main/app/list/page.tsx): `app/list/page.tsx`
- [Shopping-list interface](https://github.com/drewbawden/simple-recipe-book/blob/main/components/shopping-list/shopping-list.tsx): `components/shopping-list/shopping-list.tsx`
- [List item controls](https://github.com/drewbawden/simple-recipe-book/blob/main/components/shopping-list/item-input.tsx): `components/shopping-list/item-input.tsx`
- [List settings](https://github.com/drewbawden/simple-recipe-book/blob/main/components/shopping-list/popups/list-edit.tsx): `components/shopping-list/popups/list-edit.tsx`
- [Shopping-list actions](https://github.com/drewbawden/simple-recipe-book/blob/main/actions/shopping-lists.ts): `actions/shopping-lists.ts`
- [Item and category actions](https://github.com/drewbawden/simple-recipe-book/blob/main/actions/items.ts): `actions/items.ts`
- [List sorting logic](https://github.com/drewbawden/simple-recipe-book/blob/main/lib/shopping-list.ts): `lib/shopping-list.ts`
- [List item types](https://github.com/drewbawden/simple-recipe-book/blob/main/types/list-item.ts): `types/list-item.ts`

### Inventory

- [Scanner page](https://github.com/drewbawden/simple-recipe-book/blob/main/app/scanner/page.tsx): `app/scanner/page.tsx`
- [Barcode scanner UI](https://github.com/drewbawden/simple-recipe-book/blob/main/components/inventory/barcode-scanner.tsx): `components/inventory/barcode-scanner.tsx`
- [Product card](https://github.com/drewbawden/simple-recipe-book/blob/main/components/inventory/product-card.tsx): `components/inventory/product-card.tsx`
- [Inventory actions](https://github.com/drewbawden/simple-recipe-book/blob/main/actions/inventory.ts): `actions/inventory.ts`
- [Inventory types](https://github.com/drewbawden/simple-recipe-book/blob/main/types/inventory.ts): `types/inventory.ts`

### Shared services

- **Application database**
- [Update events](https://github.com/drewbawden/simple-recipe-book/blob/main/lib/event.ts): `lib/event.ts`
- [SSE events route](https://github.com/drewbawden/simple-recipe-book/blob/main/app/api/sse/events/route.ts): `app/api/sse/events/route.ts`
- [Recipe picture route](https://github.com/drewbawden/simple-recipe-book/blob/main/app/recipe-pictures/%5B...slug%5D/route.ts): `app/recipe-pictures/[...slug]/route.ts`
- [Modal query state](https://github.com/drewbawden/simple-recipe-book/blob/main/hooks/useModalQuery.ts): `hooks/useModalQuery.ts`
- [Modal UI](https://github.com/drewbawden/simple-recipe-book/blob/main/components/templates/modal.tsx): `components/templates/modal.tsx`
- [Context menus](https://github.com/drewbawden/simple-recipe-book/blob/main/components/templates/context-menu.tsx): `components/templates/context-menu.tsx`

### Other components

- **User**

## Connections

- User → Recipe page: opens recipes (evidence: `app/page.tsx`)
- Recipe page → Recipe table: renders (evidence: `app/page.tsx`)
- Recipe table → Recipe actions: loads and deletes (evidence: `components/recipes/recipe-table.tsx`)
- Recipe table → Recipe editor: opens editor (evidence: `components/recipes/recipe-table.tsx`)
- Recipe table → Recipe overview: shows overview (evidence: `components/recipes/recipe-table.tsx`)
- Recipe editor → Recipe actions: submits recipe (evidence: `components/recipes/popups/recipe-input.tsx`)
- Recipe editor → External recipe parsing: parses source (evidence: `components/recipes/popups/recipe-input.tsx`)
- Recipe actions → External recipe parsing: downloads image (evidence: `actions/recipes.ts`)
- Recipe actions → Application database: reads and writes (evidence: `actions/recipes.ts`)
- Recipe actions → Update events: broadcasts updates (evidence: `actions/recipes.ts`)
- Recipe page → Modal query state: controls modal query
- Recipe table → Modal UI: renders dialogs (evidence: `components/recipes/recipe-table.tsx`)
- Recipe table → Context menus: uses menus (evidence: `components/recipes/recipe-table.tsx`)
- User → List page: opens list (evidence: `app/list/page.tsx`)
- List page → Shopping-list interface: renders (evidence: `app/list/page.tsx`)
- Shopping-list interface → Shopping-list actions: loads and changes items (evidence: `components/shopping-list/shopping-list.tsx`)
- Shopping-list interface → Recipe actions: loads recipe overview (evidence: `components/shopping-list/shopping-list.tsx`)
- Shopping-list interface → List item controls: renders item entry (evidence: `components/shopping-list/shopping-list.tsx`)
- Shopping-list interface → List settings: renders list settings (evidence: `components/shopping-list/shopping-list.tsx`)
- List item controls → Shopping-list actions: submits item changes (evidence: `components/shopping-list/item-input.tsx`)
- List settings → Item and category actions: loads categories (evidence: `components/shopping-list/popups/list-edit.tsx`)
- Shopping-list actions → Application database: reads and writes (evidence: `actions/shopping-lists.ts`)
- Shopping-list actions → Item and category actions: increments usage (evidence: `actions/shopping-lists.ts`)
- Shopping-list actions → List sorting logic: sorts list (evidence: `actions/shopping-lists.ts`)
- Shopping-list actions → Update events: broadcasts updates (evidence: `actions/shopping-lists.ts`)
- User → Scanner page: opens scanner (evidence: `app/scanner/page.tsx`)
- Scanner page → Barcode scanner UI: renders (evidence: `app/scanner/page.tsx`)
- Scanner page → Product card: renders (evidence: `app/scanner/page.tsx`)
- Scanner page → Inventory actions: fetches inventory (evidence: `app/scanner/page.tsx`)
- Inventory actions → Application database: reads inventory (evidence: `actions/inventory.ts`)
- Barcode scanner UI → Product card: supports scanning flow
- SSE events route → Update events: streams updates (evidence: `app/api/sse/events/route.ts`)
- User → Recipe picture route: requests image
- Recipe table → Modal query state: reads and updates (evidence: `components/recipes/recipe-table.tsx`)
- Shopping-list interface → Modal query state: reads and updates (evidence: `components/shopping-list/shopping-list.tsx`)
- Shopping-list interface → Modal UI: renders dialogs (evidence: `components/shopping-list/shopping-list.tsx`)
- Shopping-list interface → Context menus: uses menus (evidence: `components/shopping-list/shopping-list.tsx`)
