# software-mansion-labs/goldie architecture

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

- Interactive diagram: https://gitdiagram.com/software-mansion-labs/goldie
- Repository: https://github.com/software-mansion-labs/goldie

## Overview

Goldie turns configured Argent flows into store-ready screenshots and preview videos: it checks the environment, captures simulator or emulator output, frames and renders assets, then verifies them against store specifications. Its browser studio previews and edits the design saved for subsequent CLI renders. The graph includes documented Android, iPad, font, bezel, and layout capabilities; some studio/server wiring and unsampled subsystem details are represented only where documented or left unconnected.

Main entry points: [`src/cli.ts`](https://github.com/software-mansion-labs/goldie/blob/main/src/cli.ts) (Goldie CLI), [`src/render.ts`](https://github.com/software-mansion-labs/goldie/blob/main/src/render.ts) (Asset renderer), [`studio/src/App.tsx`](https://github.com/software-mansion-labs/goldie/blob/main/studio/src/App.tsx) (Studio application), [`src/capture.ts`](https://github.com/software-mansion-labs/goldie/blob/main/src/capture.ts) (Flow capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Capture workflow"]
  node_cli["Goldie CLI<br/>[cli.ts]"]
  node_device["Device management<br/>[device.ts]"]
  node_argent["Argent flow runner<br/>[argent.ts]"]
  node_capture["Flow capture<br/>[capture.ts]"]
  node_repair["Flow repair guidance<br/>[repair.ts]"]
  node_raw["Raw captures"]
end

subgraph group_rendering["Design and rendering"]
  node_layouts["Layouts and templates<br/>[layouts.ts]"]
  node_frames["Device bezels<br/>[frame.ts]"]
  node_fonts["Font registry<br/>[fonts.ts]"]
  node_renderer["Asset renderer<br/>[render.ts]"]
  node_images["Screenshot and video assets"]
  node_manifest["Store manifest<br/>[manifest.ts]"]
end

subgraph group_studio["Browser studio"]
  node_studio_server["Studio server<br/>[studio-server.ts]"]
  node_studio_app["Studio application<br/>[App.tsx]"]
  node_studio_controls["Design controls<br/>[DesignPanel.tsx]"]
  node_studio_strip["Screenshot strip<br/>[Strip.tsx]"]
  node_studio_sidebar["Studio sidebar<br/>[Sidebar.tsx]"]
  node_saved_design["Saved design choices<br/>[manifest.ts]"]
end

subgraph group_support["Configuration and checks"]
  node_config["Config and scenes<br/>[config.ts]"]
  node_doctor["Environment doctor<br/>[doctor.ts]"]
  node_specs["Store specifications<br/>[specs.ts]"]
end

node_user(("User or agent"))
node_simulators["iOS / Android devices"]

node_user -->|"runs commands"| node_cli
node_cli -->|"loads settings"| node_config
node_cli -->|"runs checks"| node_doctor
node_doctor -->|"checks devices"| node_device
node_cli -->|"selects devices"| node_device
node_device -->|"boots and prepares"| node_simulators
node_capture -->|"prepares device"| node_device
node_capture -->|"runs flows"| node_argent
node_argent -.->|"replays on"| node_simulators
node_cli -->|"starts capture"| node_capture
node_capture -->|"writes captures"| node_raw
node_capture -->|"reports flow failures"| node_repair
node_cli -->|"renders assets"| node_renderer
node_renderer -->|"reads captures"| node_raw
node_renderer -->|"uses geometry"| node_layouts
node_renderer -->|"uses bezels"| node_frames
node_renderer -->|"uses registered fonts"| node_fonts
node_renderer -->|"applies constraints"| node_specs
node_renderer -->|"writes screenshots and video"| node_images
node_cli -->|"builds manifest"| node_manifest
node_manifest -->|"collects asset metadata"| node_images
node_cli -->|"opens studio"| node_studio_server
node_studio_server -.->|"serves browser studio"| node_studio_app
node_studio_app -->|"renders design controls"| node_studio_controls
node_studio_app -->|"renders sidebar"| node_studio_sidebar
node_studio_app -->|"renders screenshot strip"| node_studio_strip
node_studio_app -.->|"loads asset manifest"| node_manifest
node_studio_app -->|"loads and saves choices"| node_saved_design
node_studio_controls -.->|"edits design choices"| node_saved_design
node_studio_strip -->|"resolves compositions"| node_layouts
node_saved_design -->|"informs CLI rendering"| node_config

click node_cli "https://github.com/software-mansion-labs/goldie/blob/main/src/cli.ts"
click node_config "https://github.com/software-mansion-labs/goldie/blob/main/src/config.ts"
click node_doctor "https://github.com/software-mansion-labs/goldie/blob/main/src/doctor.ts"
click node_device "https://github.com/software-mansion-labs/goldie/blob/main/src/device.ts"
click node_argent "https://github.com/software-mansion-labs/goldie/blob/main/src/argent.ts"
click node_capture "https://github.com/software-mansion-labs/goldie/blob/main/src/capture.ts"
click node_repair "https://github.com/software-mansion-labs/goldie/blob/main/src/repair.ts"
click node_specs "https://github.com/software-mansion-labs/goldie/blob/main/src/specs.ts"
click node_layouts "https://github.com/software-mansion-labs/goldie/blob/main/src/layouts.ts"
click node_frames "https://github.com/software-mansion-labs/goldie/blob/main/src/frame.ts"
click node_fonts "https://github.com/software-mansion-labs/goldie/blob/main/src/fonts.ts"
click node_renderer "https://github.com/software-mansion-labs/goldie/blob/main/src/render.ts"
click node_manifest "https://github.com/software-mansion-labs/goldie/blob/main/src/manifest.ts"
click node_studio_server "https://github.com/software-mansion-labs/goldie/blob/main/src/studio-server.ts"
click node_studio_app "https://github.com/software-mansion-labs/goldie/blob/main/studio/src/App.tsx"
click node_studio_controls "https://github.com/software-mansion-labs/goldie/blob/main/studio/src/components/DesignPanel.tsx"
click node_studio_strip "https://github.com/software-mansion-labs/goldie/blob/main/studio/src/components/Strip.tsx"
click node_studio_sidebar "https://github.com/software-mansion-labs/goldie/blob/main/studio/src/components/Sidebar.tsx"
click node_saved_design "https://github.com/software-mansion-labs/goldie/blob/main/studio/src/manifest.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_cli,node_device,node_argent,node_capture,node_repair,node_raw,node_user toneBlue
class node_layouts,node_frames,node_fonts,node_renderer,node_images,node_manifest toneAmber
class node_studio_server,node_studio_app,node_studio_controls,node_studio_strip,node_studio_sidebar,node_saved_design toneMint
class node_config,node_doctor,node_specs toneRose
class node_simulators toneIndigo
```

## Components

### Capture workflow

- [Goldie CLI](https://github.com/software-mansion-labs/goldie/blob/main/src/cli.ts): `src/cli.ts`
- [Device management](https://github.com/software-mansion-labs/goldie/blob/main/src/device.ts): `src/device.ts`
- [Argent flow runner](https://github.com/software-mansion-labs/goldie/blob/main/src/argent.ts): `src/argent.ts`
- [Flow capture](https://github.com/software-mansion-labs/goldie/blob/main/src/capture.ts): `src/capture.ts`
- [Flow repair guidance](https://github.com/software-mansion-labs/goldie/blob/main/src/repair.ts): `src/repair.ts`
- **Raw captures**

### Design and rendering

- [Layouts and templates](https://github.com/software-mansion-labs/goldie/blob/main/src/layouts.ts): `src/layouts.ts`
- [Device bezels](https://github.com/software-mansion-labs/goldie/blob/main/src/frame.ts): `src/frame.ts`
- [Font registry](https://github.com/software-mansion-labs/goldie/blob/main/src/fonts.ts): `src/fonts.ts`
- [Asset renderer](https://github.com/software-mansion-labs/goldie/blob/main/src/render.ts): `src/render.ts`
- **Screenshot and video assets**
- [Store manifest](https://github.com/software-mansion-labs/goldie/blob/main/src/manifest.ts): `src/manifest.ts`

### Browser studio

- [Studio server](https://github.com/software-mansion-labs/goldie/blob/main/src/studio-server.ts): `src/studio-server.ts`
- [Studio application](https://github.com/software-mansion-labs/goldie/blob/main/studio/src/App.tsx): `studio/src/App.tsx`
- [Design controls](https://github.com/software-mansion-labs/goldie/blob/main/studio/src/components/DesignPanel.tsx): `studio/src/components/DesignPanel.tsx`
- [Screenshot strip](https://github.com/software-mansion-labs/goldie/blob/main/studio/src/components/Strip.tsx): `studio/src/components/Strip.tsx`
- [Studio sidebar](https://github.com/software-mansion-labs/goldie/blob/main/studio/src/components/Sidebar.tsx): `studio/src/components/Sidebar.tsx`
- [Saved design choices](https://github.com/software-mansion-labs/goldie/blob/main/studio/src/manifest.ts): `studio/src/manifest.ts`

### Configuration and checks

- [Config and scenes](https://github.com/software-mansion-labs/goldie/blob/main/src/config.ts): `src/config.ts`
- [Environment doctor](https://github.com/software-mansion-labs/goldie/blob/main/src/doctor.ts): `src/doctor.ts`
- [Store specifications](https://github.com/software-mansion-labs/goldie/blob/main/src/specs.ts): `src/specs.ts`

### Other components

- **User or agent**
- **iOS / Android devices**

## Connections

- User or agent → Goldie CLI: runs commands (evidence: `README.md`)
- Goldie CLI → Config and scenes: loads settings (evidence: `src/cli.ts`)
- Goldie CLI → Environment doctor: runs checks (evidence: `src/cli.ts`)
- Environment doctor → Device management: checks devices (evidence: `src/doctor.ts`)
- Goldie CLI → Device management: selects devices (evidence: `src/cli.ts`)
- Device management → iOS / Android devices: boots and prepares (evidence: `src/device.ts`)
- Flow capture → Device management: prepares device (evidence: `src/capture.ts`)
- Flow capture → Argent flow runner: runs flows (evidence: `src/capture.ts`)
- Argent flow runner → iOS / Android devices: replays on (evidence: `README.md`)
- Goldie CLI → Flow capture: starts capture (evidence: `src/cli.ts`)
- Flow capture → Raw captures: writes captures (evidence: `src/capture.ts`)
- Flow capture → Flow repair guidance: reports flow failures (evidence: `src/capture.ts`)
- Goldie CLI → Asset renderer: renders assets (evidence: `src/cli.ts`)
- Asset renderer → Raw captures: reads captures (evidence: `src/render.ts`)
- Asset renderer → Layouts and templates: uses geometry (evidence: `src/render.ts`)
- Asset renderer → Device bezels: uses bezels
- Asset renderer → Font registry: uses registered fonts (evidence: `src/render.ts`)
- Asset renderer → Store specifications: applies constraints (evidence: `src/render.ts`)
- Asset renderer → Screenshot and video assets: writes screenshots and video (evidence: `src/render.ts`)
- Goldie CLI → Store manifest: builds manifest (evidence: `src/cli.ts`)
- Store manifest → Screenshot and video assets: collects asset metadata (evidence: `src/manifest.ts`)
- Goldie CLI → Studio server: opens studio (evidence: `src/cli.ts`)
- Studio server → Studio application: serves browser studio (evidence: `README.md`)
- Studio application → Design controls: renders design controls (evidence: `studio/src/App.tsx`)
- Studio application → Studio sidebar: renders sidebar (evidence: `studio/src/App.tsx`)
- Studio application → Screenshot strip: renders screenshot strip (evidence: `studio/src/App.tsx`)
- Studio application → Store manifest: loads asset manifest (evidence: `README.md`)
- Studio application → Saved design choices: loads and saves choices (evidence: `studio/src/App.tsx`)
- Design controls → Saved design choices: edits design choices (evidence: `studio/src/components/DesignPanel.tsx`)
- Screenshot strip → Layouts and templates: resolves compositions (evidence: `studio/src/components/Strip.tsx`)
- Saved design choices → Config and scenes: informs CLI rendering (evidence: `README.md`)
