# dnlaldrn/clippass architecture

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

- Interactive diagram: https://gitdiagram.com/dnlaldrn/clippass
- Repository: https://github.com/dnlaldrn/clippass

## Overview

ClipPass lets creators pay a flat project fee, then an agent selects and licenses stock-media assets with constrained Stellar payments to artists. The graph follows checkout through job execution, quote/payment verification, and license presentation, while retaining the catalog, payout, owner-policy, activity, and verification capabilities. Some server and web modules were not excerpted; their links are included only where the README or SOURCE INDEX supports them.

Main entry points: [`packages/agent/src/run.ts`](https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/run.ts) (Agent execution), [`apps/web/src/App.tsx`](https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/App.tsx) (Web app), [`apps/server/src/merchant.ts`](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/merchant.ts) (Merchant API), [`apps/web/src/api.ts`](https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Creator experience"]
  node_webapp["Web app<br/>[App.tsx]"]
  node_jobform["Job submission<br/>[StartJob.tsx]"]
  node_jobview["Job and receipt views<br/>[JobPage.tsx]"]
  node_libraryui["Library and artist pages<br/>[Library.tsx]"]
  node_activityui["Activity page<br/>[Activity.tsx]"]
  node_verifyui["Verification page<br/>[Verify.tsx]"]
  node_reelpreview["Reel preview<br/>[ReelPreview.tsx]"]
  node_reelscene["Preview rendering<br/>[ReelScene.ts]"]
  node_webapi["API client<br/>[api.ts]"]
end

subgraph group_server["Job and API server"]
  node_velo["Checkout and jobs<br/>[velo.ts]"]
  node_jobstore[("Job store<br/>[jobs.ts]")]
  node_runner["Job runner<br/>[runner.ts]"]
  node_merchant["Merchant API<br/>[merchant.ts]"]
end

subgraph group_agent["Agent purchasing"]
  node_agentrun["Agent execution<br/>[run.ts]"]
  node_planning["Slot planning<br/>[plan.ts]"]
  node_selection["Asset selection<br/>[pick.ts]"]
  node_decision["Payment decision<br/>[decide.ts]"]
  node_paidfetch["Paid request retry<br/>[paidFetch.ts]"]
  node_llmplanner["Optional Ollama planner<br/>[llm.ts]"]
end

subgraph group_payments["Payments and licensing"]
  node_noir[("Noir and Stellar")]
  node_watch["Payment event watch<br/>[noirWatch.ts]"]
  node_verifier["License verifier<br/>[verifier.ts]"]
  node_quotestore[("Quote store<br/>[quotes.ts]")]
  node_claim["Artist payouts<br/>[claim.ts]"]
  node_owner["Card owner controls<br/>[owner.ts]"]
  node_verifyapi["Payment verification API<br/>[verify.ts]"]
end

subgraph group_media["Catalog and insight"]
  node_catalogapi["Catalog API<br/>[catalog.ts]"]
  node_catalogdata["Asset catalog<br/>[catalog.ts]"]
  node_activityapi[("Activity API and log<br/>[activity.ts]")]
  node_artists["Artist directory<br/>[artists.ts]"]
end

node_creator(("Creator"))

node_creator -->|"creates reel"| node_webapp
node_webapp -->|"routes to"| node_jobform
node_jobform -->|"submits job"| node_webapi
node_webapi -->|"calls API"| node_velo
node_velo -->|"creates and reads"| node_jobstore
node_velo -->|"starts after payment"| node_runner
node_runner -->|"runs agent"| node_agentrun
node_agentrun -->|"builds slots"| node_planning
node_agentrun -.->|"optionally retags"| node_llmplanner
node_agentrun -->|"ranks assets"| node_selection
node_agentrun -->|"checks budget"| node_decision
node_agentrun -->|"requests quote"| node_paidfetch
node_paidfetch -->|"retries with proof"| node_merchant
node_merchant -->|"creates and checks"| node_quotestore
node_agentrun -->|"checks and authorizes"| node_noir
node_noir -->|"emits payment event"| node_watch
node_watch -->|"verifies event"| node_verifier
node_verifier -->|"checks quote"| node_quotestore
node_merchant -->|"validates proof"| node_verifier
node_noir -->|"settles artist balances"| node_claim
node_owner -.->|"manages card policy"| node_noir
node_verifyapi -->|"records checks"| node_activityapi
node_catalogapi -->|"serves assets"| node_catalogdata
node_merchant -->|"uses payees"| node_artists
node_webapp -->|"routes to"| node_jobview
node_webapp -->|"routes to"| node_libraryui
node_webapp -->|"routes to"| node_activityui
node_webapp -->|"routes to"| node_verifyui
node_jobview -.->|"loads job data"| node_webapi
node_libraryui -->|"loads catalog"| node_webapi
node_reelpreview -->|"renders frames"| node_reelscene
node_jobview -.->|"shows preview"| node_reelpreview
node_activityui -.->|"reads activity"| node_activityapi
node_verifyui -.->|"checks payment"| node_verifyapi

click node_webapp "https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/App.tsx"
click node_jobform "https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/StartJob.tsx"
click node_jobview "https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/JobPage.tsx"
click node_libraryui "https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/pages/Library.tsx"
click node_activityui "https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/pages/Activity.tsx"
click node_verifyui "https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/pages/Verify.tsx"
click node_reelpreview "https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/ReelPreview.tsx"
click node_reelscene "https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/reel/ReelScene.ts"
click node_webapi "https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/api.ts"
click node_velo "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/velo.ts"
click node_jobstore "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/jobs.ts"
click node_runner "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/runner.ts"
click node_merchant "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/merchant.ts"
click node_agentrun "https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/run.ts"
click node_planning "https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/plan.ts"
click node_selection "https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/pick.ts"
click node_decision "https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/decide.ts"
click node_paidfetch "https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/paidFetch.ts"
click node_llmplanner "https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/llm.ts"
click node_watch "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/noirWatch.ts"
click node_verifier "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/verifier.ts"
click node_quotestore "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/quotes.ts"
click node_claim "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/claim.ts"
click node_owner "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/owner.ts"
click node_verifyapi "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/verify.ts"
click node_catalogapi "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/catalog.ts"
click node_catalogdata "https://github.com/dnlaldrn/clippass/blob/main/packages/shared/src/catalog.ts"
click node_activityapi "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/activity.ts"
click node_artists "https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/artists.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_webapp,node_jobform,node_jobview,node_libraryui,node_activityui,node_verifyui,node_reelpreview,node_reelscene,node_webapi toneBlue
class node_velo,node_jobstore,node_runner,node_merchant toneAmber
class node_agentrun,node_planning,node_selection,node_decision,node_paidfetch,node_llmplanner toneMint
class node_noir,node_watch,node_verifier,node_quotestore,node_claim,node_owner,node_verifyapi toneRose
class node_catalogapi,node_catalogdata,node_activityapi,node_artists,node_creator toneIndigo
```

## Components

### Creator experience

- [Web app](https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Job submission](https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/StartJob.tsx): `apps/web/src/StartJob.tsx`
- [Job and receipt views](https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/JobPage.tsx): `apps/web/src/JobPage.tsx`
- [Library and artist pages](https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/pages/Library.tsx): `apps/web/src/pages/Library.tsx`
- [Activity page](https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/pages/Activity.tsx): `apps/web/src/pages/Activity.tsx`
- [Verification page](https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/pages/Verify.tsx): `apps/web/src/pages/Verify.tsx`
- [Reel preview](https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/ReelPreview.tsx): `apps/web/src/ReelPreview.tsx`
- [Preview rendering](https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/reel/ReelScene.ts): `apps/web/src/reel/ReelScene.ts`
- [API client](https://github.com/dnlaldrn/clippass/blob/main/apps/web/src/api.ts): `apps/web/src/api.ts`

### Job and API server

- [Checkout and jobs](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/velo.ts): `apps/server/src/velo.ts`
- [Job store](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/jobs.ts): `apps/server/src/jobs.ts`
- [Job runner](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/runner.ts): `apps/server/src/runner.ts`
- [Merchant API](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/merchant.ts): `apps/server/src/merchant.ts`

### Agent purchasing

- [Agent execution](https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/run.ts): `packages/agent/src/run.ts`
- [Slot planning](https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/plan.ts): `packages/agent/src/plan.ts`
- [Asset selection](https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/pick.ts): `packages/agent/src/pick.ts`
- [Payment decision](https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/decide.ts): `packages/agent/src/decide.ts`
- [Paid request retry](https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/paidFetch.ts): `packages/agent/src/paidFetch.ts`
- [Optional Ollama planner](https://github.com/dnlaldrn/clippass/blob/main/packages/agent/src/llm.ts): `packages/agent/src/llm.ts`

### Payments and licensing

- **Noir and Stellar**
- [Payment event watch](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/noirWatch.ts): `apps/server/src/noirWatch.ts`
- [License verifier](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/verifier.ts): `apps/server/src/verifier.ts`
- [Quote store](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/quotes.ts): `apps/server/src/quotes.ts`
- [Artist payouts](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/claim.ts): `apps/server/src/claim.ts`
- [Card owner controls](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/owner.ts): `apps/server/src/owner.ts`
- [Payment verification API](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/verify.ts): `apps/server/src/verify.ts`

### Catalog and insight

- [Catalog API](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/catalog.ts): `apps/server/src/catalog.ts`
- [Asset catalog](https://github.com/dnlaldrn/clippass/blob/main/packages/shared/src/catalog.ts): `packages/shared/src/catalog.ts`
- [Activity API and log](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/activity.ts): `apps/server/src/activity.ts`
- [Artist directory](https://github.com/dnlaldrn/clippass/blob/main/apps/server/src/artists.ts): `apps/server/src/artists.ts`

### Other components

- **Creator**

## Connections

- Creator → Web app: creates reel (evidence: `apps/web/src/App.tsx`)
- Web app → Job submission: routes to (evidence: `apps/web/src/App.tsx`)
- Job submission → API client: submits job
- API client → Checkout and jobs: calls API (evidence: `README.md`)
- Checkout and jobs → Job store: creates and reads (evidence: `apps/server/src/velo.ts`)
- Checkout and jobs → Job runner: starts after payment (evidence: `apps/server/src/index.ts`)
- Job runner → Agent execution: runs agent
- Agent execution → Slot planning: builds slots (evidence: `packages/agent/src/run.ts`)
- Agent execution → Optional Ollama planner: optionally retags (evidence: `packages/agent/src/run.ts`)
- Agent execution → Asset selection: ranks assets (evidence: `packages/agent/src/run.ts`)
- Agent execution → Payment decision: checks budget (evidence: `packages/agent/src/run.ts`)
- Agent execution → Paid request retry: requests quote (evidence: `packages/agent/src/run.ts`)
- Paid request retry → Merchant API: retries with proof (evidence: `README.md`)
- Merchant API → Quote store: creates and checks (evidence: `apps/server/src/merchant.ts`)
- Agent execution → Noir and Stellar: checks and authorizes (evidence: `packages/agent/src/run.ts`)
- Noir and Stellar → Payment event watch: emits payment event (evidence: `README.md`)
- Payment event watch → License verifier: verifies event (evidence: `apps/server/src/noirWatch.ts`)
- License verifier → Quote store: checks quote (evidence: `apps/server/src/merchant.ts`)
- Merchant API → License verifier: validates proof (evidence: `README.md`)
- Noir and Stellar → Artist payouts: settles artist balances (evidence: `README.md`)
- Card owner controls → Noir and Stellar: manages card policy (evidence: `README.md`)
- Payment verification API → Activity API and log: records checks (evidence: `apps/server/src/verify.ts`)
- Catalog API → Asset catalog: serves assets (evidence: `apps/server/src/catalog.ts`)
- Merchant API → Artist directory: uses payees (evidence: `apps/server/src/index.ts`)
- Web app → Job and receipt views: routes to (evidence: `apps/web/src/App.tsx`)
- Web app → Library and artist pages: routes to (evidence: `apps/web/src/App.tsx`)
- Web app → Activity page: routes to (evidence: `apps/web/src/App.tsx`)
- Web app → Verification page: routes to (evidence: `apps/web/src/App.tsx`)
- Job and receipt views → API client: loads job data
- Library and artist pages → API client: loads catalog (evidence: `apps/web/src/pages/Library.tsx`)
- Reel preview → Preview rendering: renders frames (evidence: `apps/web/src/ReelPreview.tsx`)
- Job and receipt views → Reel preview: shows preview (evidence: `README.md`)
- Activity page → Activity API and log: reads activity (evidence: `README.md`)
- Verification page → Payment verification API: checks payment (evidence: `README.md`)
