# habi0817/figma-compare architecture

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

- Interactive diagram: https://gitdiagram.com/habi0817/figma-compare
- Repository: https://github.com/habi0817/figma-compare

## Overview

Framecheck is a browser-based, local-image tool for comparing Figma designs with webpage screenshots. The main workflow is to load or capture two images, select and align a component (automatically or manually), optionally inspect dimensions, then review visual differences and export a report. Separate workflows support paired same-size captures and a follow-up Playwright regression template. The graph reflects documented capabilities and sampled implementation; some UI-to-engine connections are documented rather than visible in the excerpts.

Main entry points: [`figma-compare/src/dimension-ui.js`](https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/dimension-ui.js) (Dimension Workflow), [`figma-compare/src/align-ui.js`](https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/align-ui.js) (Alignment Review), [`figma-compare/regression/scripts/capture.mjs`](https://github.com/habi0817/figma-compare/blob/main/figma-compare/regression/scripts/capture.mjs) (Candidate Capture), [`figma-compare/src/workbench.js`](https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/workbench.js) (Image Workbench)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_align["Images and Alignment"]
  node_workbench["Image Workbench<br/>[workbench.js]"]
  node_paired["Paired Capture<br/>[dual-ui.js]"]
  node_auto_ui["Alignment Review<br/>[align-ui.js]"]
  node_align_worker["Image Matching<br/>[align-worker.js]"]
end

subgraph group_measure["Dimension Review"]
  node_dimension_ui["Dimension Workflow<br/>[dimension-ui.js]"]
  node_dimension_core["Dimension Checks<br/>[dimension-core.js]"]
end

subgraph group_compare["Visual Comparison"]
  node_compare_ui["Comparison Interface<br/>[app.js]"]
  node_diff_core["Pixel Difference<br/>[diff-core.js]"]
end

subgraph group_regression["Regression Capture"]
  node_settings["Capture Settings<br/>[visual.settings.js]"]
  node_shared["Page Preparation<br/>[shared.mjs]"]
  node_capture["Candidate Capture<br/>[capture.mjs]"]
end

node_user(("Designer"))

node_user -->|"loads images"| node_workbench
node_user -->|"starts capture"| node_paired
node_paired -->|"sets image pair"| node_workbench
node_workbench -->|"offers alignment"| node_auto_ui
node_auto_ui -->|"starts worker"| node_align_worker
node_auto_ui -->|"opens measurement"| node_dimension_ui
node_user -->|"checks dimensions"| node_dimension_ui
node_dimension_ui -->|"runs matching"| node_align_worker
node_dimension_ui -.->|"checks geometry"| node_dimension_core
node_user -->|"reviews differences"| node_compare_ui
node_compare_ui -->|"calculates differences"| node_diff_core
node_user -->|"requests regression capture"| node_capture
node_capture -->|"prepares page"| node_shared
node_capture -->|"uses settings"| node_settings
node_shared -->|"loads settings"| node_settings

click node_workbench "https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/workbench.js"
click node_paired "https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/dual-ui.js"
click node_auto_ui "https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/align-ui.js"
click node_align_worker "https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/align-worker.js"
click node_dimension_ui "https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/dimension-ui.js"
click node_dimension_core "https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/dimension-core.js"
click node_compare_ui "https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/app.js"
click node_diff_core "https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/diff-core.js"
click node_settings "https://github.com/habi0817/figma-compare/blob/main/figma-compare/regression/visual.settings.js"
click node_shared "https://github.com/habi0817/figma-compare/blob/main/figma-compare/regression/scripts/shared.mjs"
click node_capture "https://github.com/habi0817/figma-compare/blob/main/figma-compare/regression/scripts/capture.mjs"

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_workbench,node_paired,node_auto_ui,node_align_worker toneBlue
class node_dimension_ui,node_dimension_core toneAmber
class node_compare_ui,node_diff_core toneMint
class node_settings,node_shared,node_capture toneRose
class node_user toneIndigo
```

## Components

### Images and Alignment

- [Image Workbench](https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/workbench.js): `figma-compare/src/workbench.js`
- [Paired Capture](https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/dual-ui.js): `figma-compare/src/dual-ui.js`
- [Alignment Review](https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/align-ui.js): `figma-compare/src/align-ui.js`
- [Image Matching](https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/align-worker.js): `figma-compare/src/align-worker.js`

### Dimension Review

- [Dimension Workflow](https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/dimension-ui.js): `figma-compare/src/dimension-ui.js`
- [Dimension Checks](https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/dimension-core.js): `figma-compare/src/dimension-core.js`

### Visual Comparison

- [Comparison Interface](https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/app.js): `figma-compare/src/app.js`
- [Pixel Difference](https://github.com/habi0817/figma-compare/blob/main/figma-compare/src/diff-core.js): `figma-compare/src/diff-core.js`

### Regression Capture

- [Capture Settings](https://github.com/habi0817/figma-compare/blob/main/figma-compare/regression/visual.settings.js): `figma-compare/regression/visual.settings.js`
- [Page Preparation](https://github.com/habi0817/figma-compare/blob/main/figma-compare/regression/scripts/shared.mjs): `figma-compare/regression/scripts/shared.mjs`
- [Candidate Capture](https://github.com/habi0817/figma-compare/blob/main/figma-compare/regression/scripts/capture.mjs): `figma-compare/regression/scripts/capture.mjs`

### Other components

- **Designer**

## Connections

- Designer → Image Workbench: loads images (evidence: `README.md`)
- Designer → Paired Capture: starts capture (evidence: `README.md`)
- Paired Capture → Image Workbench: sets image pair (evidence: `figma-compare/src/dual-ui.js`)
- Image Workbench → Alignment Review: offers alignment (evidence: `README.md`)
- Alignment Review → Image Matching: starts worker (evidence: `figma-compare/src/align-ui.js`)
- Alignment Review → Dimension Workflow: opens measurement (evidence: `figma-compare/src/dimension-ui.js`)
- Designer → Dimension Workflow: checks dimensions (evidence: `README.md`)
- Dimension Workflow → Image Matching: runs matching (evidence: `figma-compare/src/dimension-ui.js`)
- Dimension Workflow → Dimension Checks: checks geometry
- Designer → Comparison Interface: reviews differences (evidence: `README.md`)
- Comparison Interface → Pixel Difference: calculates differences (evidence: `README.md`)
- Designer → Candidate Capture: requests regression capture (evidence: `README.md`)
- Candidate Capture → Page Preparation: prepares page (evidence: `figma-compare/regression/scripts/capture.mjs`)
- Candidate Capture → Capture Settings: uses settings (evidence: `figma-compare/regression/scripts/capture.mjs`)
- Page Preparation → Capture Settings: loads settings (evidence: `figma-compare/regression/scripts/shared.mjs`)
