# minemap-nl/clipcookbook architecture

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

- Interactive diagram: https://gitdiagram.com/minemap-nl/clipcookbook
- Repository: https://github.com/minemap-nl/clipcookbook

## Overview

ClipCookBook is a self-hosted recipe manager that turns social-media links into structured, editable recipes. The main workflow is submitting a post for extraction, processing its text or media into recipe data, saving it, and browsing or sharing the result. The README also documents deep video analysis, optional Instagram cookies, media galleries, backups, and email. Several routes and subsystems were not sampled; those branches are shown only where the README or SOURCE INDEX supports the relationship.

Main entry points: [`app/api/extract/route.ts`](https://github.com/minemap-nl/clipcookbook/blob/main/app/api/extract/route.ts) (Social extraction), [`lib/prisma.ts`](https://github.com/minemap-nl/clipcookbook/blob/main/lib/prisma.ts) (SQLite recipe store), [`app/api/recept/route.ts`](https://github.com/minemap-nl/clipcookbook/blob/main/app/api/recept/route.ts) (Recipe API), [`app/api/admin/ytdlp-cookies/route.ts`](https://github.com/minemap-nl/clipcookbook/blob/main/app/api/admin/ytdlp-cookies/route.ts) (Cookie administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Recipe capture"]
  node_add["Add recipe<br/>[page.tsx]"]
  node_extract["Social extraction<br/>[route.ts]"]
  node_photoextract["Photo extraction<br/>[route.ts]"]
  node_parser["Recipe parsing<br/>[extractor.ts]"]
  node_deep["Video deep search<br/>[extractor.ts]"]
end

subgraph group_recipes["Recipe management"]
  node_catalog["Recipe catalog<br/>[page.tsx]"]
  node_recipeapi["Recipe API<br/>[route.ts]"]
  node_detail["Recipe editor<br/>[page.tsx]"]
  node_share["Shared recipe view<br/>[page.tsx]"]
  node_database[("SQLite recipe store<br/>[prisma.ts]")]
end

subgraph group_media["Media and integrations"]
  node_cover["Cover photo editor"]
  node_mediagallery["Media gallery<br/>[route.ts]"]
  node_cookies["Instagram cookies<br/>[page.tsx]"]
  node_cookieadmin["Cookie administration<br/>[route.ts]"]
  node_ytoptions["Download options<br/>[ytdlp-options.ts]"]
end

subgraph group_operations["Operations"]
  node_backup["Automated backups<br/>[route.ts]"]
  node_email["Recipe email<br/>[route.ts]"]
  node_smtp["SMTP delivery<br/>[smtp.ts]"]
end

node_cook(("Recipe user"))
node_gemini{{"Gemini AI"}}

node_cook -->|"submits link"| node_add
node_add -.->|"requests extraction"| node_extract
node_extract -->|"parses recipe"| node_parser
node_extract -->|"analyzes video"| node_deep
node_parser -.->|"uses AI"| node_gemini
node_deep -.->|"analyzes media"| node_gemini
node_extract -->|"reads and writes"| node_database
node_photoextract -->|"uses extractor"| node_parser
node_photoextract -->|"writes recipe"| node_database
node_cook -->|"browses recipes"| node_catalog
node_catalog -.->|"loads recipes"| node_recipeapi
node_recipeapi -->|"reads and writes"| node_database
node_detail -.->|"edits recipe"| node_recipeapi
node_share -.->|"loads recipe"| node_recipeapi
node_detail -->|"edits cover"| node_cover
node_cook -->|"views shared recipe"| node_share
node_cook -->|"configures cookies"| node_cookies
node_cookies -.->|"manages cookies"| node_cookieadmin
node_cookieadmin -->|"checks download auth"| node_ytoptions
node_extract -.->|"provides media"| node_mediagallery
node_backup -.->|"backs up data"| node_database
node_email -->|"reads recipes"| node_database
node_email -->|"sends email"| node_smtp
node_cookieadmin -->|"sends alerts"| node_smtp

click node_add "https://github.com/minemap-nl/clipcookbook/blob/main/app/toevoegen/page.tsx"
click node_extract "https://github.com/minemap-nl/clipcookbook/blob/main/app/api/extract/route.ts"
click node_photoextract "https://github.com/minemap-nl/clipcookbook/blob/main/app/api/extract/photo/route.ts"
click node_parser "https://github.com/minemap-nl/clipcookbook/blob/main/lib/extractor.ts"
click node_deep "https://github.com/minemap-nl/clipcookbook/blob/main/lib/extractor.ts"
click node_catalog "https://github.com/minemap-nl/clipcookbook/blob/main/app/page.tsx"
click node_recipeapi "https://github.com/minemap-nl/clipcookbook/blob/main/app/api/recept/route.ts"
click node_detail "https://github.com/minemap-nl/clipcookbook/blob/main/app/recept/%5Bid%5D/page.tsx"
click node_share "https://github.com/minemap-nl/clipcookbook/blob/main/app/share/%5Bid%5D/page.tsx"
click node_database "https://github.com/minemap-nl/clipcookbook/blob/main/lib/prisma.ts"
click node_cover "https://github.com/minemap-nl/clipcookbook/blob/main/components/CoverPhotoSelector.tsx"
click node_mediagallery "https://github.com/minemap-nl/clipcookbook/blob/main/app/api/v/%5Bfilename%5D/route.ts"
click node_cookies "https://github.com/minemap-nl/clipcookbook/blob/main/app/cookies/page.tsx"
click node_cookieadmin "https://github.com/minemap-nl/clipcookbook/blob/main/app/api/admin/ytdlp-cookies/route.ts"
click node_ytoptions "https://github.com/minemap-nl/clipcookbook/blob/main/lib/ytdlp-options.ts"
click node_backup "https://github.com/minemap-nl/clipcookbook/blob/main/app/api/backup/route.ts"
click node_email "https://github.com/minemap-nl/clipcookbook/blob/main/app/api/email/route.ts"
click node_smtp "https://github.com/minemap-nl/clipcookbook/blob/main/lib/smtp.ts"

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_add,node_extract,node_photoextract,node_parser,node_deep,node_cook toneBlue
class node_catalog,node_recipeapi,node_detail,node_share,node_database toneAmber
class node_cover,node_mediagallery,node_cookies,node_cookieadmin,node_ytoptions toneMint
class node_backup,node_email,node_smtp toneRose
class node_gemini toneIndigo
```

## Components

### Recipe capture

- [Add recipe](https://github.com/minemap-nl/clipcookbook/blob/main/app/toevoegen/page.tsx): `app/toevoegen/page.tsx`
- [Social extraction](https://github.com/minemap-nl/clipcookbook/blob/main/app/api/extract/route.ts): `app/api/extract/route.ts`
- [Photo extraction](https://github.com/minemap-nl/clipcookbook/blob/main/app/api/extract/photo/route.ts): `app/api/extract/photo/route.ts`
- [Recipe parsing](https://github.com/minemap-nl/clipcookbook/blob/main/lib/extractor.ts): `lib/extractor.ts`
- [Video deep search](https://github.com/minemap-nl/clipcookbook/blob/main/lib/extractor.ts): `lib/extractor.ts`

### Recipe management

- [Recipe catalog](https://github.com/minemap-nl/clipcookbook/blob/main/app/page.tsx): `app/page.tsx`
- [Recipe API](https://github.com/minemap-nl/clipcookbook/blob/main/app/api/recept/route.ts): `app/api/recept/route.ts`
- [Recipe editor](https://github.com/minemap-nl/clipcookbook/blob/main/app/recept/%5Bid%5D/page.tsx): `app/recept/[id]/page.tsx`
- [Shared recipe view](https://github.com/minemap-nl/clipcookbook/blob/main/app/share/%5Bid%5D/page.tsx): `app/share/[id]/page.tsx`
- [SQLite recipe store](https://github.com/minemap-nl/clipcookbook/blob/main/lib/prisma.ts): `lib/prisma.ts`

### Media and integrations

- [Cover photo editor](https://github.com/minemap-nl/clipcookbook/blob/main/components/CoverPhotoSelector.tsx): `components/CoverPhotoSelector.tsx`
- [Media gallery](https://github.com/minemap-nl/clipcookbook/blob/main/app/api/v/%5Bfilename%5D/route.ts): `app/api/v/[filename]/route.ts`
- [Instagram cookies](https://github.com/minemap-nl/clipcookbook/blob/main/app/cookies/page.tsx): `app/cookies/page.tsx`
- [Cookie administration](https://github.com/minemap-nl/clipcookbook/blob/main/app/api/admin/ytdlp-cookies/route.ts): `app/api/admin/ytdlp-cookies/route.ts`
- [Download options](https://github.com/minemap-nl/clipcookbook/blob/main/lib/ytdlp-options.ts): `lib/ytdlp-options.ts`

### Operations

- [Automated backups](https://github.com/minemap-nl/clipcookbook/blob/main/app/api/backup/route.ts): `app/api/backup/route.ts`
- [Recipe email](https://github.com/minemap-nl/clipcookbook/blob/main/app/api/email/route.ts): `app/api/email/route.ts`
- [SMTP delivery](https://github.com/minemap-nl/clipcookbook/blob/main/lib/smtp.ts): `lib/smtp.ts`

### Other components

- **Recipe user**
- **Gemini AI**

## Connections

- Recipe user → Add recipe: submits link (evidence: `README.md`)
- Add recipe → Social extraction: requests extraction
- Social extraction → Recipe parsing: parses recipe (evidence: `app/api/extract/route.ts`)
- Social extraction → Video deep search: analyzes video (evidence: `app/api/extract/route.ts`)
- Recipe parsing → Gemini AI: uses AI (evidence: `README.md`)
- Video deep search → Gemini AI: analyzes media (evidence: `README.md`)
- Social extraction → SQLite recipe store: reads and writes (evidence: `app/api/extract/route.ts`)
- Photo extraction → Recipe parsing: uses extractor (evidence: `app/api/extract/photo/route.ts`)
- Photo extraction → SQLite recipe store: writes recipe (evidence: `app/api/extract/photo/route.ts`)
- Recipe user → Recipe catalog: browses recipes (evidence: `README.md`)
- Recipe catalog → Recipe API: loads recipes
- Recipe API → SQLite recipe store: reads and writes (evidence: `app/api/recept/route.ts`)
- Recipe editor → Recipe API: edits recipe
- Shared recipe view → Recipe API: loads recipe
- Recipe editor → Cover photo editor: edits cover (evidence: `app/recept/[id]/page.tsx`)
- Recipe user → Shared recipe view: views shared recipe (evidence: `README.md`)
- Recipe user → Instagram cookies: configures cookies (evidence: `README.md`)
- Instagram cookies → Cookie administration: manages cookies
- Cookie administration → Download options: checks download auth (evidence: `app/api/admin/ytdlp-cookies/route.ts`)
- Social extraction → Media gallery: provides media
- Automated backups → SQLite recipe store: backs up data (evidence: `README.md`)
- Recipe email → SQLite recipe store: reads recipes (evidence: `app/api/email/route.ts`)
- Recipe email → SMTP delivery: sends email (evidence: `app/api/email/route.ts`)
- Cookie administration → SMTP delivery: sends alerts
