# gbbnq/tonuino-label-maker-pyqt6 architecture

> Architecture diagram of the GitHub repository gbbnq/tonuino-label-maker-pyqt6, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gbbnq/tonuino-label-maker-pyqt6
- Repository: https://github.com/gbbnq/tonuino-label-maker-pyqt6

## Overview

##### Main Components

A. User Interface Layer:
- Main Window (src/app/main_window.py)
- Header Widget (src/app/header_widget.py)
- Preview Widget (src/app/preview_widget.py)
- Edit Options Widget (src/app/edit_options_widget.py)
- Footer Widget (src/app/footer_widget.py)

B. Core Processing Layer:
- PDF Generator (src/app/pdf_generator.py)
- Resource Manager (src/app/get_resources.py)

C. Data Layer:
- Templates Storage (src/resources/templates.json)
- User's Local File System (for images)

- [UI Layer]
- ↕
- [Processing Layer]
- ↕
- [Data Layer]

##### Specific Elements

A. UI Layer (Top):
- [Main Window]
- [Header Widget]
- [Preview Widget]
- [Edit Options Widget]
- [Footer Widget]

B. Processing Layer (Middle):
- [PDF Generator]──[Resource Manager]

C. Data Layer (Bottom):
- [Templates JSON]  [Local File System]

##### Flow Representation

Following interactions:
- User input flows from UI components to the processing layer
- Resource Manager reads from templates.json and local file system
- PDF Generator receives data from UI and Resource Manager
- PDF Generator outputs to local file system

##### Additional Details

Annotations for:
- PyQt6 framework usage
- File format support (PDF output)
- Template configuration capabilities
- Image import functionality

##### Technical Notes

- Application entry point (src/main.py)
- Build/deployment files (build.bat, install.bat)
- Configuration files (requirements.txt)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style definitions
    classDef ui fill:#a8d1f0,stroke:#2980b9,stroke-width:2px
    classDef processing fill:#b8e994,stroke:#27ae60,stroke-width:2px
    classDef data fill:#f8c291,stroke:#e67e22,stroke-width:2px
    classDef external fill:#bdc3c7,stroke:#7f8c8d,stroke-width:2px

    %% UI Layer
    subgraph UILayer["User Interface Layer"]
        MainWindow["Main Window"]
        HeaderWidget["Header Widget"]
        PreviewWidget["Preview Widget"]
        EditOptionsWidget["Edit Options Widget"]
        FooterWidget["Footer Widget"]

        MainWindow --> HeaderWidget
        MainWindow --> PreviewWidget
        MainWindow --> EditOptionsWidget
        MainWindow --> FooterWidget
    end

    %% Processing Layer
    subgraph ProcessingLayer["Processing Layer"]
        PDFGen["PDF Generator"]
        ResourceMgr["Resource Manager"]

        ResourceMgr --> PDFGen
    end

    %% Data Layer
    subgraph DataLayer["Data Layer"]
        Templates[("Templates JSON")]
        FileSystem[("Local File System")]
    end

    %% Inter-layer connections
    UILayer --> ProcessingLayer
    ResourceMgr -.-> Templates
    ResourceMgr -.-> FileSystem
    PDFGen -.-> FileSystem

    %% Style applications
    class MainWindow,HeaderWidget,PreviewWidget,EditOptionsWidget,FooterWidget ui
    class PDFGen,ResourceMgr processing
    class Templates data
    class FileSystem external

    %% Click events
    click MainWindow "https://github.com/gbbnq/tonuino-label-maker-pyqt6/blob/main/src/app/main_window.py"
    click HeaderWidget "https://github.com/gbbnq/tonuino-label-maker-pyqt6/blob/main/src/app/header_widget.py"
    click PreviewWidget "https://github.com/gbbnq/tonuino-label-maker-pyqt6/blob/main/src/app/preview_widget.py"
    click EditOptionsWidget "https://github.com/gbbnq/tonuino-label-maker-pyqt6/blob/main/src/app/edit_options_widget.py"
    click FooterWidget "https://github.com/gbbnq/tonuino-label-maker-pyqt6/blob/main/src/app/footer_widget.py"
    click PDFGen "https://github.com/gbbnq/tonuino-label-maker-pyqt6/blob/main/src/app/pdf_generator.py"
    click ResourceMgr "https://github.com/gbbnq/tonuino-label-maker-pyqt6/blob/main/src/app/get_resources.py"
    click Templates "https://github.com/gbbnq/tonuino-label-maker-pyqt6/blob/main/src/resources/templates.json"

    %% Legend
    subgraph Legend["Legend"]
        UI["UI Component"]:::ui
        Proc["Processing Component"]:::processing
        Data["Data Storage"]:::data
        Ext["External System"]:::external
    end
```
