# luskizera/iziflow-plugin architecture

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

- Interactive diagram: https://gitdiagram.com/luskizera/iziflow-plugin
- Repository: https://github.com/luskizera/iziflow-plugin

## Overview

IziFlow is a Figma/FigJam plugin that turns Copilot-generated YAML into editable flow diagrams. The user pastes YAML into the plugin, chooses theme and accent options, and requests flow creation; the plugin parses the input, calculates layout, creates diagram elements, and records successful flows in history. The UI also exposes history and preferences. The README documents the Copilot interview and validation, but those happen outside this repository. Several internal calls are supported by the SOURCE INDEX rather than sampled call sites.

Main entry points: [`src-code/code.ts`](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/code.ts) (Plugin controller), [`src-code/lib/frames.ts`](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/frames.ts) (Node frames), [`src-code/lib/connectors.ts`](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/connectors.ts) (Flow connectors), [`src/components/app.tsx`](https://github.com/luskizera/iziflow-plugin/blob/main/src/components/app.tsx) (Plugin UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Plugin interface"]
  node_app["Plugin UI<br/>[app.tsx]"]
  node_theme_provider["UI theme<br/>[theme-provider.tsx]"]
  node_messages["Message dispatch<br/>[utils.ts]"]
end

subgraph group_runtime["Plugin orchestration"]
  node_plugin["Plugin controller<br/>[code.ts]"]
  node_yaml["YAML parser<br/>[yamlParser.ts]"]
  node_flow_types["Flow model<br/>[flow.types.ts]"]
end

subgraph group_diagram["Diagram generation"]
  node_layout["Flow layout<br/>[layout.ts]"]
  node_position["Position calculator"]
  node_frames["Node frames<br/>[frames.ts]"]
  node_connectors["Flow connectors<br/>[connectors.ts]"]
  node_layout_config["Layout settings<br/>[layout.config.ts]"]
  node_styles_config["Diagram styles<br/>[styles.config.ts]"]
  node_icons["Node icons<br/>[icons.ts]"]
  node_node_cache["Node task cache<br/>[nodeCache.ts]"]
end

subgraph group_state["Theme and history"]
  node_theme["Diagram palette<br/>[theme.config.ts]"]
  node_color_generation["Accent palette"]
  node_hex_rgb["Color conversion<br/>[hexToRgb.ts]"]
  node_history[("Flow history<br/>[historyStorage.ts]")]
end

node_user(("User"))
node_copilot(("IziFlow Copilot"))
node_figma{{"Figma / FigJam"}}

node_copilot -.->|"provides YAML"| node_user
node_user -->|"pastes YAML"| node_app
node_app -->|"uses theme"| node_theme_provider
node_app -->|"dispatches requests"| node_messages
node_messages -.->|"sends messages"| node_plugin
node_plugin -->|"parses input"| node_yaml
node_yaml -.->|"produces flow data"| node_flow_types
node_plugin -->|"calculates layout"| node_layout
node_plugin -->|"creates nodes"| node_frames
node_plugin -->|"creates connections"| node_connectors
node_plugin -->|"gets colors"| node_theme
node_plugin -->|"updates history"| node_history
node_plugin -.->|"creates diagram"| node_figma
node_layout -->|"uses flow model"| node_flow_types
node_yaml -->|"uses positioning"| node_position
node_connectors -->|"calculates endpoints"| node_position
node_connectors -->|"reads settings"| node_layout_config
node_connectors -->|"reads styles"| node_styles_config
node_connectors -->|"loads resources"| node_node_cache
node_frames -->|"uses palette"| node_theme
node_frames -->|"reads styles"| node_styles_config
node_frames -->|"uses icons"| node_icons
node_frames -->|"loads resources"| node_node_cache
node_theme -->|"generates accent"| node_color_generation
node_theme -->|"converts colors"| node_hex_rgb
node_user -->|"views diagram"| node_figma
node_app -->|"requests history"| node_history

click node_app "https://github.com/luskizera/iziflow-plugin/blob/main/src/components/app.tsx"
click node_theme_provider "https://github.com/luskizera/iziflow-plugin/blob/main/src/components/providers/theme-provider.tsx"
click node_messages "https://github.com/luskizera/iziflow-plugin/blob/main/src/utils/utils.ts"
click node_plugin "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/code.ts"
click node_yaml "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/yamlParser.ts"
click node_flow_types "https://github.com/luskizera/iziflow-plugin/blob/main/shared/types/flow.types.ts"
click node_layout "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/layout.ts"
click node_position "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/positionCalculator.ts"
click node_frames "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/frames.ts"
click node_connectors "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/connectors.ts"
click node_layout_config "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/config/layout.config.ts"
click node_styles_config "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/config/styles.config.ts"
click node_icons "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/config/icons.ts"
click node_node_cache "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/utils/nodeCache.ts"
click node_theme "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/config/theme.config.ts"
click node_color_generation "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/utils/color-generation.ts"
click node_hex_rgb "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/utils/hexToRgb.ts"
click node_history "https://github.com/luskizera/iziflow-plugin/blob/main/src-code/utils/historyStorage.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_app,node_theme_provider,node_messages,node_user toneBlue
class node_plugin,node_yaml,node_flow_types toneAmber
class node_layout,node_position,node_frames,node_connectors,node_layout_config,node_styles_config,node_icons,node_node_cache toneMint
class node_theme,node_color_generation,node_hex_rgb,node_history toneRose
class node_copilot,node_figma toneIndigo
```

## Components

### Plugin interface

- [Plugin UI](https://github.com/luskizera/iziflow-plugin/blob/main/src/components/app.tsx): `src/components/app.tsx`
- [UI theme](https://github.com/luskizera/iziflow-plugin/blob/main/src/components/providers/theme-provider.tsx): `src/components/providers/theme-provider.tsx`
- [Message dispatch](https://github.com/luskizera/iziflow-plugin/blob/main/src/utils/utils.ts): `src/utils/utils.ts`

### Plugin orchestration

- [Plugin controller](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/code.ts): `src-code/code.ts`
- [YAML parser](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/yamlParser.ts): `src-code/lib/yamlParser.ts`
- [Flow model](https://github.com/luskizera/iziflow-plugin/blob/main/shared/types/flow.types.ts): `shared/types/flow.types.ts`

### Diagram generation

- [Flow layout](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/layout.ts): `src-code/lib/layout.ts`
- [Position calculator](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/positionCalculator.ts): `src-code/lib/positionCalculator.ts`
- [Node frames](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/frames.ts): `src-code/lib/frames.ts`
- [Flow connectors](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/lib/connectors.ts): `src-code/lib/connectors.ts`
- [Layout settings](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/config/layout.config.ts): `src-code/config/layout.config.ts`
- [Diagram styles](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/config/styles.config.ts): `src-code/config/styles.config.ts`
- [Node icons](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/config/icons.ts): `src-code/config/icons.ts`
- [Node task cache](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/utils/nodeCache.ts): `src-code/utils/nodeCache.ts`

### Theme and history

- [Diagram palette](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/config/theme.config.ts): `src-code/config/theme.config.ts`
- [Accent palette](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/utils/color-generation.ts): `src-code/utils/color-generation.ts`
- [Color conversion](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/utils/hexToRgb.ts): `src-code/utils/hexToRgb.ts`
- [Flow history](https://github.com/luskizera/iziflow-plugin/blob/main/src-code/utils/historyStorage.ts): `src-code/utils/historyStorage.ts`

### Other components

- **User**
- **IziFlow Copilot**
- **Figma / FigJam**

## Connections

- IziFlow Copilot → User: provides YAML (evidence: `README.md`)
- User → Plugin UI: pastes YAML (evidence: `README.md`)
- Plugin UI → UI theme: uses theme (evidence: `src/components/app.tsx`)
- Plugin UI → Message dispatch: dispatches requests (evidence: `src/components/app.tsx`)
- Message dispatch → Plugin controller: sends messages
- Plugin controller → YAML parser: parses input (evidence: `src-code/code.ts`)
- YAML parser → Flow model: produces flow data
- Plugin controller → Flow layout: calculates layout (evidence: `src-code/code.ts`)
- Plugin controller → Node frames: creates nodes (evidence: `src-code/code.ts`)
- Plugin controller → Flow connectors: creates connections (evidence: `src-code/code.ts`)
- Plugin controller → Diagram palette: gets colors (evidence: `src-code/code.ts`)
- Plugin controller → Flow history: updates history (evidence: `src-code/code.ts`)
- Plugin controller → Figma / FigJam: creates diagram
- Flow layout → Flow model: uses flow model (evidence: `src-code/lib/layout.ts`)
- YAML parser → Position calculator: uses positioning (evidence: `src-code/lib/yamlParser.ts`)
- Flow connectors → Position calculator: calculates endpoints (evidence: `src-code/lib/connectors.ts`)
- Flow connectors → Layout settings: reads settings (evidence: `src-code/lib/connectors.ts`)
- Flow connectors → Diagram styles: reads styles (evidence: `src-code/lib/connectors.ts`)
- Flow connectors → Node task cache: loads resources (evidence: `src-code/lib/connectors.ts`)
- Node frames → Diagram palette: uses palette (evidence: `src-code/lib/frames.ts`)
- Node frames → Diagram styles: reads styles (evidence: `src-code/lib/frames.ts`)
- Node frames → Node icons: uses icons (evidence: `src-code/lib/frames.ts`)
- Node frames → Node task cache: loads resources (evidence: `src-code/lib/frames.ts`)
- Diagram palette → Accent palette: generates accent (evidence: `src-code/config/theme.config.ts`)
- Diagram palette → Color conversion: converts colors (evidence: `src-code/config/theme.config.ts`)
- User → Figma / FigJam: views diagram (evidence: `README.md`)
- Plugin UI → Flow history: requests history (evidence: `src/components/app.tsx`)
