# ezykl/cards-signature architecture

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

- Interactive diagram: https://gitdiagram.com/ezykl/cards-signature
- Repository: https://github.com/ezykl/cards-signature

## Overview

Signature Studio is a static, privacy-friendly web app for building and exporting email signatures. A user enters through the landing page, selects a template or edits a draft, reviews desktop and mobile previews, then copies or downloads the generated HTML. The editor also supports local draft persistence, JSON backup and restore, undo/redo, and validation; the renderer creates email-safe table markup. The excerpts show the editor calling the renderer and saving drafts locally. Other capability links are based on README statements, not inspected implementation.

Main entry points: [`js/studio.js`](https://github.com/ezykl/cards-signature/blob/main/js/studio.js) (Editor controller), [`index.html`](https://github.com/ezykl/cards-signature/blob/main/index.html) (Studio interface), [`js/studio-templates.js`](https://github.com/ezykl/cards-signature/blob/main/js/studio-templates.js) (HTML generator), [`css/studio.css`](https://github.com/ezykl/cards-signature/blob/main/css/studio.css) (Responsive styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_webpage["Studio interface<br/>[index.html]"]
  node_styles["Responsive styles<br/>[studio.css]"]
  node_preview["Live previews<br/>[studio.js]"]
end

subgraph group_editing["Signature editing"]
  node_editor["Editor controller<br/>[studio.js]"]
  node_gallery["Template gallery<br/>[studio.js]"]
  node_state["Draft state<br/>[studio.js]"]
  node_validation["Input validation<br/>[studio.js]"]
end

subgraph group_rendering["Signature rendering"]
  node_presets["Theme presets"]
  node_generator["HTML generator"]
  node_layouts["Signature layouts"]
end

subgraph group_delivery["Drafts and exports"]
  node_localstorage[("Browser draft storage")]
  node_draftbackup["JSON draft backup<br/>[studio.js]"]
  node_clipboard["Clipboard"]
  node_download["HTML download<br/>[studio.js]"]
end

node_user(("User"))
node_emailclient["Email client"]

node_user -->|"opens"| node_webpage
node_webpage -->|"hosts editor"| node_editor
node_webpage -->|"uses styles"| node_styles
node_user -->|"chooses template"| node_gallery
node_gallery -->|"loads preset"| node_state
node_user -->|"edits draft"| node_state
node_editor -->|"manages state"| node_state
node_editor -->|"validates input"| node_validation
node_editor -->|"calls renderer"| node_generator
node_generator -->|"renders layout"| node_layouts
node_editor -->|"applies theme"| node_presets
node_editor -->|"updates preview"| node_preview
node_editor -->|"saves draft"| node_localstorage
node_user -->|"exports or imports"| node_draftbackup
node_editor -->|"copies HTML"| node_clipboard
node_clipboard -->|"pastes signature"| node_emailclient
node_editor -->|"downloads HTML"| node_download

click node_webpage "https://github.com/ezykl/cards-signature/blob/main/index.html"
click node_styles "https://github.com/ezykl/cards-signature/blob/main/css/studio.css"
click node_editor "https://github.com/ezykl/cards-signature/blob/main/js/studio.js"
click node_gallery "https://github.com/ezykl/cards-signature/blob/main/js/studio.js"
click node_state "https://github.com/ezykl/cards-signature/blob/main/js/studio.js"
click node_validation "https://github.com/ezykl/cards-signature/blob/main/js/studio.js"
click node_presets "https://github.com/ezykl/cards-signature/blob/main/js/studio-templates.js"
click node_generator "https://github.com/ezykl/cards-signature/blob/main/js/studio-templates.js"
click node_layouts "https://github.com/ezykl/cards-signature/blob/main/js/studio-templates.js"
click node_preview "https://github.com/ezykl/cards-signature/blob/main/js/studio.js"
click node_draftbackup "https://github.com/ezykl/cards-signature/blob/main/js/studio.js"
click node_download "https://github.com/ezykl/cards-signature/blob/main/js/studio.js"

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_webpage,node_styles,node_preview,node_user,node_emailclient toneBlue
class node_editor,node_gallery,node_state,node_validation toneAmber
class node_presets,node_generator,node_layouts toneMint
class node_localstorage,node_draftbackup,node_clipboard,node_download toneRose
```

## Components

### User experience

- [Studio interface](https://github.com/ezykl/cards-signature/blob/main/index.html): `index.html`
- [Responsive styles](https://github.com/ezykl/cards-signature/blob/main/css/studio.css): `css/studio.css`
- [Live previews](https://github.com/ezykl/cards-signature/blob/main/js/studio.js): `js/studio.js`

### Signature editing

- [Editor controller](https://github.com/ezykl/cards-signature/blob/main/js/studio.js): `js/studio.js`
- [Template gallery](https://github.com/ezykl/cards-signature/blob/main/js/studio.js): `js/studio.js`
- [Draft state](https://github.com/ezykl/cards-signature/blob/main/js/studio.js): `js/studio.js`
- [Input validation](https://github.com/ezykl/cards-signature/blob/main/js/studio.js): `js/studio.js`

### Signature rendering

- [Theme presets](https://github.com/ezykl/cards-signature/blob/main/js/studio-templates.js): `js/studio-templates.js`
- [HTML generator](https://github.com/ezykl/cards-signature/blob/main/js/studio-templates.js): `js/studio-templates.js`
- [Signature layouts](https://github.com/ezykl/cards-signature/blob/main/js/studio-templates.js): `js/studio-templates.js`

### Drafts and exports

- **Browser draft storage**
- [JSON draft backup](https://github.com/ezykl/cards-signature/blob/main/js/studio.js): `js/studio.js`
- **Clipboard**
- [HTML download](https://github.com/ezykl/cards-signature/blob/main/js/studio.js): `js/studio.js`

### Other components

- **User**
- **Email client**

## Connections

- User → Studio interface: opens (evidence: `README.md`)
- Studio interface → Editor controller: hosts editor (evidence: `README.md`)
- Studio interface → Responsive styles: uses styles (evidence: `README.md`)
- User → Template gallery: chooses template (evidence: `README.md`)
- Template gallery → Draft state: loads preset (evidence: `js/studio.js`)
- User → Draft state: edits draft (evidence: `README.md`)
- Editor controller → Draft state: manages state (evidence: `README.md`)
- Editor controller → Input validation: validates input (evidence: `README.md`)
- Editor controller → HTML generator: calls renderer (evidence: `js/studio.js`)
- HTML generator → Signature layouts: renders layout (evidence: `js/studio-templates.js`)
- Editor controller → Theme presets: applies theme (evidence: `js/studio.js`)
- Editor controller → Live previews: updates preview (evidence: `js/studio.js`)
- Editor controller → Browser draft storage: saves draft (evidence: `js/studio.js`)
- User → JSON draft backup: exports or imports (evidence: `README.md`)
- Editor controller → Clipboard: copies HTML (evidence: `README.md`)
- Clipboard → Email client: pastes signature (evidence: `README.md`)
- Editor controller → HTML download: downloads HTML (evidence: `README.md`)
