# omikorin/penpot-beautiful-qrcode architecture

> Architecture diagram of the GitHub repository omikorin/penpot-beautiful-qrcode, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omikorin/penpot-beautiful-qrcode
- Repository: https://github.com/omikorin/penpot-beautiful-qrcode

## Overview

##### Component Breakdown

A. Plugin Interface Layer (Top):
- QR Preview Component
- Logo Controls Component
- QR Content Component
- Number Input Component

B. Core Processing Layer (Middle):
- An "Actions Handler" block (from `src/common/actions.ts`)
- A "QR Generator Engine" block (derived from the plugin's main functionality)
- "Types & Interfaces" block (from `src/common/types.ts`)
- "Utilities" block (from `src/common/utils.ts`)

C. Integration Layer (Bottom):
- Penpot Platform Integration block
- Export Functionality block (supporting PNG, SVG, WEBP, JPEG)

##### Connection Flows

- Data flow between UI components and store
- Action dispatches from components to action handler
- QR code generation flow
- Export process flow
- Platform integration points

##### Technical Details

Annotations for:
- TypeScript implementation (shown by tsconfig.json)
- Vite build system (indicated by vite.config.ts)
- Web Components architecture (evident from component structure)
- Static asset handling (public directory contents)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Plugin Interface Layer"
        QRP["QR Preview"]:::ui
        CC["Color Controls"]:::ui
        LC["Logo Controls"]:::ui
        QC["QR Content"]:::ui
        NI["Number Input"]:::ui
    end

    subgraph "Core Processing Layer"
        SM["Store Management"]:::core
        AH["Actions Handler"]:::core
        QGE["QR Generator Engine"]:::core
        TI["Types & Interfaces"]:::core
        UT["Utilities"]:::core
    end

    subgraph "Integration Layer"
        PI["Plugin Integration"]:::integration
        AM["Asset Management"]:::integration
        EF["Export Functionality"]:::integration
        SM["Style Management"]:::integration
    end

    %% Component Connections
    QRP <--> SM
    CC <--> SM
    LC <--> SM
    QC <--> SM
    NI <--> SM

    SM <--> AH
    AH --> QGE
    QGE --> QRP
    TI -.-> SM
    TI -.-> AH
    UT -.-> QGE
    UT -.-> SM

    QGE --> EF
    PI --> SM
    AM --> LC
    AM --> CC

    %% Click Events
    click QRP "https://github.com/Omikorin/penpot-beautiful-qrcode/blob/main/src/components/qr-preview.ts"
    click CC "https://github.com/Omikorin/penpot-beautiful-qrcode/blob/main/src/components/color-controls.ts"
    click LC "https://github.com/Omikorin/penpot-beautiful-qrcode/blob/main/src/components/logo-controls.ts"
    click QC "https://github.com/Omikorin/penpot-beautiful-qrcode/blob/main/src/components/qr-content.ts"
    click NI "https://github.com/Omikorin/penpot-beautiful-qrcode/blob/main/src/components/number-input.ts"
    click SM "https://github.com/Omikorin/penpot-beautiful-qrcode/blob/main/src/common/store.ts"
    click AH "https://github.com/Omikorin/penpot-beautiful-qrcode/blob/main/src/common/actions.ts"
    click TI "https://github.com/Omikorin/penpot-beautiful-qrcode/blob/main/src/common/types.ts"
    click UT "https://github.com/Omikorin/penpot-beautiful-qrcode/blob/main/src/common/utils.ts"
    click PI "https://github.com/Omikorin/penpot-beautiful-qrcode/blob/main/src/plugin.ts"
    click AM "https://github.com/Omikorin/penpot-beautiful-qrcode/tree/main/public/icons"
    click SM "https://github.com/Omikorin/penpot-beautiful-qrcode/blob/main/src/assets/style.css"

    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef integration fill:#e67e22,stroke:#d35400,color:white

    %% Legend
    subgraph Legend
        UI[User Interface]:::ui
        CORE[Core Processing]:::core
        INT[Integration]:::integration
        FLOW["--> Data Flow"]
        DEP["-.-> Dependencies"]
    end
```
