# meimberg-io/io.meimberg.recipes architecture

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

- Interactive diagram: https://gitdiagram.com/meimberg-io/io.meimberg.recipes
- Repository: https://github.com/meimberg-io/io.meimberg.recipes

## Overview

#### Purpose and Runtime
This is a Next.js 15 App Router application that presents a Notion-backed recipe collection as a restaurant-style menu. It runs as a React 18/TypeScript server-rendered application with client-side interactive components, styled through global CSS/Tailwind. Container deployment is supported by `Dockerfile`, `docker-compose.yml`, and `docker-compose.prod.yml`.

#### Application Entry and Route Structure
The root shell and landing page are `src/app/layout.tsx` and `src/app/page.tsx`. Recipe discovery is organized around category and recipe-detail routes:
- `src/app/[category]/page.tsx` renders category-specific menu views.
- `src/app/recipes/[slug]/page.tsx` renders an individual recipe.
- `src/app/robots.ts` provides crawler directives.
- `src/app/api/sitemap.xml/route.ts` generates the sitemap endpoint.

#### Notion Data Boundary
Notion is the authoritative external content system. The integration layer isolates Notion API access and translates Notion records into application recipe types:
- `src/lib/notion.ts`
- `src/lib/notion-recipe.ts`
- `src/types/recipe.ts`

Page routes and API handlers should consume this normalized recipe model rather than directly coupling UI code to Notion response shapes. Credentials are supplied via environment variables, modeled by `env.example`.

#### Recipe Query and Delivery APIs
The app exposes server-side endpoints for recipe consumers and operational integration:
- `src/app/api/recipes/route.ts` lists recipes.
- `src/app/api/recipes/[id]/route.ts` retrieves a recipe by identifier.
- `src/app/api/revalidate/route.ts` supports cache/content invalidation.
- `src/app/api/test-notion/route.ts` validates Notion connectivity.

These handlers form the primary server boundary between browser/UI consumers and Notion-backed data retrieval.

#### Presentation Pipeline
Recipe data flows from route-level server components into reusable menu components:
- `src/components/RecipeGrid.tsx`
- `src/components/RecipeCard.tsx`
- `src/components/RecipeModal.tsx`
- `src/components/NotionContent.tsx`

`NotionContent.tsx` and `RichText.tsx` render structured rich content; recipe cards/grids provide collection navigation; the modal supports focused recipe presentation. Client variants such as `src/components/RecipeGridClient.tsx` and `src/components/CategoryTabsClient.tsx` own browser-side interaction boundaries.

#### Navigation, Taxonomy, and Shared Layout
Recipe classification and navigation are centralized rather than embedded in pages:
- `src/config/categories.ts`
- `src/config/navigation.ts`
- `src/components/CategoryTabs.tsx`
- `src/components/Header.tsx`
- `src/components/Footer.tsx`

Category routes use this taxonomy to select/filter content consistently. Header/footer and tabs provide the shared menu shell across routes.

#### External Media, Analytics, and Operations
Remote image delivery is mediated by `src/app/api/image-proxy/route.ts`, creating a controlled boundary for externally hosted recipe imagery. Analytics are client-side through `src/components/util/MatomoTracker.tsx`; Matomo is an external service dependency when configured. Deployment automation is defined in `.github/workflows/deploy.yml`, with operational guidance in `docs/DEPLOYMENT.md`.

Main entry points: [`src/lib/notion.ts`](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/lib/notion.ts) (Notion gateway), [`src/types/recipe.ts`](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/types/recipe.ts) (Recipe model), [`src/components/RecipeGrid.tsx`](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/components/RecipeGrid.tsx) (Recipe menu components), [`src/app/[category]/page.tsx`](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/%5Bcategory%5D/page.tsx) (Category page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["App Routes"]
  node_root_shell["Root shell<br/>Next.js layout<br/>[layout.tsx]"]
  node_menu_pages["Menu discovery pages<br/>App Router pages<br/>[page.tsx]"]
  node_recipe_page["Recipe detail page<br/>App Router page<br/>[page.tsx]"]
  node_category_page["Category page<br/>App Router page<br/>[page.tsx]"]
  node_recipe_api["Recipe APIs<br/>route handlers<br/>[route.ts]"]
  node_operations_api["Operational APIs<br/>route handlers<br/>[route.ts]"]
  node_sitemap["Crawler metadata<br/>robots and sitemap<br/>[robots.ts]"]
  node_image_proxy["Image proxy<br/>route handler<br/>[route.ts]"]
end

subgraph group_data["Recipe Data"]
  node_notion_gateway["Notion gateway<br/>integration layer<br/>[notion.ts]"]
  node_recipe_mapper["Recipe mapper<br/>normalizer<br/>[notion-recipe.ts]"]
  node_recipe_model["Recipe model<br/>TypeScript types<br/>[recipe.ts]"]
end

subgraph group_ui["Menu UI"]
  node_taxonomy["Taxonomy and navigation<br/>shared configuration<br/>[categories.ts]"]
  node_menu_components["Recipe menu components<br/>React components<br/>[RecipeGrid.tsx]"]
  node_interactive_ui["Interactive menu UI<br/>client components"]
  node_shared_chrome["Shared menu chrome<br/>React components<br/>[Header.tsx]"]
  node_analytics["Matomo tracker<br/>client integration<br/>[MatomoTracker.tsx]"]
end

subgraph group_platform["External Services"]
  node_notion[("Notion<br/>external CMS")]
  node_matomo(("Matomo<br/>analytics service"))
  node_remote_images(("Remote image hosts<br/>external media"))
  node_deployment{{"Container deployment<br/>operations"}}
end

node_root_shell -->|"renders"| node_shared_chrome
node_root_shell -->|"loads"| node_analytics
node_menu_pages -->|"renders"| node_menu_components
node_category_page -->|"selects category from"| node_taxonomy
node_category_page -->|"renders"| node_menu_components
node_recipe_page -->|"renders detail with"| node_menu_components
node_shared_chrome -->|"uses"| node_taxonomy
node_menu_components -->|"delegates interactions to"| node_interactive_ui
node_menu_pages -->|"consumes"| node_recipe_model
node_category_page -->|"consumes"| node_recipe_model
node_recipe_page -->|"consumes"| node_recipe_model
node_recipe_api -->|"returns"| node_recipe_model
node_recipe_api -->|"queries"| node_notion_gateway
node_operations_api -->|"validates and revalidates"| node_notion_gateway
node_sitemap -->|"derives recipe URLs from"| node_notion_gateway
node_notion_gateway -->|"calls API"| node_notion
node_notion_gateway -->|"maps records through"| node_recipe_mapper
node_recipe_mapper -->|"produces"| node_recipe_model
node_image_proxy -->|"fetches"| node_remote_images
node_analytics -->|"sends events to"| node_matomo
node_deployment -.->|"runs application"| node_root_shell

click node_root_shell "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/layout.tsx"
click node_menu_pages "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/page.tsx"
click node_recipe_page "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/recipes/%5Bslug%5D/page.tsx"
click node_category_page "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/%5Bcategory%5D/page.tsx"
click node_recipe_api "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/api/recipes/route.ts"
click node_operations_api "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/api/revalidate/route.ts"
click node_sitemap "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/robots.ts"
click node_image_proxy "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/api/image-proxy/route.ts"
click node_notion_gateway "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/lib/notion.ts"
click node_recipe_mapper "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/lib/notion-recipe.ts"
click node_recipe_model "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/types/recipe.ts"
click node_taxonomy "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/config/categories.ts"
click node_menu_components "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/components/RecipeGrid.tsx"
click node_interactive_ui "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/components/RecipeGridClient.tsx"
click node_shared_chrome "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/components/Header.tsx"
click node_analytics "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/components/util/MatomoTracker.tsx"
click node_deployment "https://github.com/meimberg-io/io.meimberg.recipes/blob/main/Dockerfile"

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_root_shell,node_menu_pages,node_recipe_page,node_category_page,node_recipe_api,node_operations_api,node_sitemap,node_image_proxy toneBlue
class node_notion_gateway,node_recipe_mapper,node_recipe_model toneAmber
class node_taxonomy,node_menu_components,node_interactive_ui,node_shared_chrome,node_analytics toneMint
class node_notion,node_matomo,node_remote_images,node_deployment toneRose
```

## Components

### App Routes

Next.js App Router entry points and server endpoints.

- [Root shell](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/layout.tsx): Next.js layout · `src/app/layout.tsx`
- [Menu discovery pages](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/page.tsx): App Router pages · Landing and category menu views. · `src/app/page.tsx`
- [Recipe detail page](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/recipes/%5Bslug%5D/page.tsx): App Router page · `src/app/recipes/[slug]/page.tsx`
- [Category page](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/%5Bcategory%5D/page.tsx): App Router page · `src/app/[category]/page.tsx`
- [Recipe APIs](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/api/recipes/route.ts): route handlers · List and identifier-based recipe delivery. · `src/app/api/recipes/route.ts`
- [Operational APIs](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/api/revalidate/route.ts): route handlers · Revalidation and Notion connectivity endpoints. · `src/app/api/revalidate/route.ts`
- [Crawler metadata](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/robots.ts): robots and sitemap · Robots directives and generated sitemap. · `src/app/robots.ts`
- [Image proxy](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/app/api/image-proxy/route.ts): route handler · Controlled delivery of remote recipe images. · `src/app/api/image-proxy/route.ts`

### Recipe Data

Normalized Notion content access boundary.

- [Notion gateway](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/lib/notion.ts): integration layer · Fetches Notion content and maps API records. · `src/lib/notion.ts`
- [Recipe mapper](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/lib/notion-recipe.ts): normalizer · Translates Notion records into recipe models. · `src/lib/notion-recipe.ts`
- [Recipe model](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/types/recipe.ts): TypeScript types · `src/types/recipe.ts`

### Menu UI

Shared server and client presentation components.

- [Taxonomy and navigation](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/config/categories.ts): shared configuration · Central category classification and menu navigation. · `src/config/categories.ts`
- [Recipe menu components](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/components/RecipeGrid.tsx): React components · Grid, cards, modal, and rich Notion content rendering. · `src/components/RecipeGrid.tsx`
- [Interactive menu UI](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/components/RecipeGridClient.tsx): client components · Browser-side grid and category tab interactions. · `src/components/RecipeGridClient.tsx`
- [Shared menu chrome](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/components/Header.tsx): React components · Header, footer, and category navigation tabs. · `src/components/Header.tsx`
- [Matomo tracker](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/src/components/util/MatomoTracker.tsx): client integration · `src/components/util/MatomoTracker.tsx`

### External Services

- **Notion**: external CMS · Authoritative recipe content system.
- **Matomo**: analytics service
- **Remote image hosts**: external media
- [Container deployment](https://github.com/meimberg-io/io.meimberg.recipes/blob/main/Dockerfile): operations · Docker deployment with CI automation. · `Dockerfile`

## Connections

- Root shell → Shared menu chrome: renders
- Root shell → Matomo tracker: loads
- Menu discovery pages → Recipe menu components: renders
- Category page → Taxonomy and navigation: selects category from
- Category page → Recipe menu components: renders
- Recipe detail page → Recipe menu components: renders detail with
- Shared menu chrome → Taxonomy and navigation: uses
- Recipe menu components → Interactive menu UI: delegates interactions to
- Menu discovery pages → Recipe model: consumes
- Category page → Recipe model: consumes
- Recipe detail page → Recipe model: consumes
- Recipe APIs → Recipe model: returns
- Recipe APIs → Notion gateway: queries
- Operational APIs → Notion gateway: validates and revalidates
- Crawler metadata → Notion gateway: derives recipe URLs from
- Notion gateway → Notion: calls API
- Notion gateway → Recipe mapper: maps records through
- Recipe mapper → Recipe model: produces
- Image proxy → Remote image hosts: fetches
- Matomo tracker → Matomo: sends events to
- Container deployment → Root shell: runs application
