# ebi-theodore/qr_generate- architecture

> Architecture diagram of the GitHub repository ebi-theodore/qr_generate-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ebi-theodore/qr_generate-
- Repository: https://github.com/ebi-theodore/qr_generate-

## Overview

#### Purpose and Entry Point
A local desktop application that generates customizable QR codes from text or URLs, previews them in a Tkinter window, and exports PNG images. The executable and source entry point is `project.py`; it is run directly with `python project.py` or packaged as a Windows executable.

#### Application Shell
`project.py` owns the GUI lifecycle and assembles the desktop interface using Tkinter with ttkbootstrap styling. It presents text input, QR customization controls, preview space, and save actions within one process; there is no server, browser client, or remote API boundary.

#### QR Generation Pipeline
User-entered payload and selected options—box size, border, error-correction level, and foreground/background colors—flow from UI controls into QR construction in `project.py`. The generator produces an in-memory QR image suitable for both immediate display and later export.

#### Preview Boundary
The generated image is converted into a GUI-compatible image representation and rendered in the application's preview area in `project.py`. Preview generation is local and interactive, allowing option changes to update the displayed QR code without persistence or network calls.

#### File Export
The save action in `project.py` writes the current generated QR image to a user-selected `.png` location. The filesystem is the primary external boundary: generation remains in memory until the explicit export operation.

#### Runtime and Dependencies
The application runs on Python and depends on Tkinter/ttkbootstrap for the themed native desktop UI and a QR/image library stack for QR encoding and PNG output. Dependency versions/install requirements are declared in `requirements.txt`. Packaging is intended for Windows through PyInstaller, with `project.py` serving as the bundled application target.

#### Testable Logic
Core pure-Python helper logic is colocated with the GUI in `project.py` and validated separately by `test_project.py`. This creates a small functional boundary between deterministic QR-related/input-processing helpers and event-driven desktop UI behavior.

Main entry points: [`project.py`](https://github.com/ebi-theodore/qr_generate-/blob/main/project.py) (Tkinter UI), [`requirements.txt`](https://github.com/ebi-theodore/qr_generate-/blob/main/requirements.txt) (requirements.txt), [`test_project.py`](https://github.com/ebi-theodore/qr_generate-/blob/main/test_project.py) (test_project.py)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop application"]
  node_entry["project.py<br/>application entry<br/>[project.py]"]
  node_ui["Tkinter UI<br/>native desktop UI<br/>[project.py]"]
  node_helpers["QR helper logic<br/>pure Python helpers<br/>[project.py]"]
  node_qr["QR construction<br/>in-memory generator<br/>[project.py]"]
  node_preview["Preview renderer<br/>GUI image adapter<br/>[project.py]"]
  node_export["PNG export<br/>save workflow<br/>[project.py]"]
end

subgraph group_delivery["Packaging and dependencies"]
  node_ui_libs["Tkinter + ttkbootstrap<br/>UI dependencies<br/>[requirements.txt]"]
  node_qr_libs["QR and image libraries<br/>encoding dependencies<br/>[requirements.txt]"]
  node_requirements["requirements.txt<br/>dependency manifest<br/>[requirements.txt]"]
  node_pyinstaller["PyInstaller<br/>Windows packager"]
end

node_filesystem["User-selected PNG<br/>filesystem boundary"]
node_python{{"Python runtime"}}
node_tests["test_project.py<br/>helper tests<br/>[test_project.py]"]

node_python -->|"runs"| node_entry
node_entry -->|"assembles"| node_ui
node_ui -->|"normalizes input"| node_helpers
node_ui -->|"payload and options"| node_qr
node_helpers -->|"supports"| node_qr
node_qr -->|"in-memory image"| node_preview
node_preview -->|"renders"| node_ui
node_ui -->|"save action"| node_export
node_qr -->|"current image"| node_export
node_export -->|"writes PNG"| node_filesystem
node_requirements -->|"declares"| node_ui_libs
node_requirements -->|"declares"| node_qr_libs
node_ui_libs -->|"provides"| node_ui
node_qr_libs -->|"provides"| node_qr
node_pyinstaller -.->|"bundles target"| node_entry
node_tests -.->|"validates"| node_helpers

click node_entry "https://github.com/ebi-theodore/qr_generate-/blob/main/project.py"
click node_ui "https://github.com/ebi-theodore/qr_generate-/blob/main/project.py"
click node_helpers "https://github.com/ebi-theodore/qr_generate-/blob/main/project.py"
click node_qr "https://github.com/ebi-theodore/qr_generate-/blob/main/project.py"
click node_preview "https://github.com/ebi-theodore/qr_generate-/blob/main/project.py"
click node_export "https://github.com/ebi-theodore/qr_generate-/blob/main/project.py"
click node_ui_libs "https://github.com/ebi-theodore/qr_generate-/blob/main/requirements.txt"
click node_qr_libs "https://github.com/ebi-theodore/qr_generate-/blob/main/requirements.txt"
click node_requirements "https://github.com/ebi-theodore/qr_generate-/blob/main/requirements.txt"
click node_tests "https://github.com/ebi-theodore/qr_generate-/blob/main/test_project.py"

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_entry,node_ui,node_helpers,node_qr,node_preview,node_export toneBlue
class node_ui_libs,node_qr_libs,node_requirements,node_pyinstaller toneAmber
class node_filesystem,node_python,node_tests toneNeutral
```

## Components

### Desktop application

- [project.py](https://github.com/ebi-theodore/qr_generate-/blob/main/project.py): application entry · Owns lifecycle, UI assembly, QR workflow, and export. · `project.py`
- [Tkinter UI](https://github.com/ebi-theodore/qr_generate-/blob/main/project.py): native desktop UI · Text input, customization controls, preview, and save action. · `project.py`
- [QR helper logic](https://github.com/ebi-theodore/qr_generate-/blob/main/project.py): pure Python helpers · Deterministic QR-related and input-processing logic. · `project.py`
- [QR construction](https://github.com/ebi-theodore/qr_generate-/blob/main/project.py): in-memory generator · Builds a QR image from payload and selected options. · `project.py`
- [Preview renderer](https://github.com/ebi-theodore/qr_generate-/blob/main/project.py): GUI image adapter · Converts generated images for the Tkinter preview area. · `project.py`
- [PNG export](https://github.com/ebi-theodore/qr_generate-/blob/main/project.py): save workflow · Writes the current QR image after explicit user action. · `project.py`

### Packaging and dependencies

- [Tkinter + ttkbootstrap](https://github.com/ebi-theodore/qr_generate-/blob/main/requirements.txt): UI dependencies · `requirements.txt`
- [QR and image libraries](https://github.com/ebi-theodore/qr_generate-/blob/main/requirements.txt): encoding dependencies · `requirements.txt`
- [requirements.txt](https://github.com/ebi-theodore/qr_generate-/blob/main/requirements.txt): dependency manifest · `requirements.txt`
- **PyInstaller**: Windows packager · Bundles project.py as a Windows executable.

### Other components

- **User-selected PNG**: filesystem boundary
- **Python runtime**: runtime
- [test_project.py](https://github.com/ebi-theodore/qr_generate-/blob/main/test_project.py): helper tests · Validates colocated pure helper logic. · `test_project.py`

## Connections

- Python runtime → project.py: runs
- project.py → Tkinter UI: assembles
- Tkinter UI → QR helper logic: normalizes input
- Tkinter UI → QR construction: payload and options
- QR helper logic → QR construction: supports
- QR construction → Preview renderer: in-memory image
- Preview renderer → Tkinter UI: renders
- Tkinter UI → PNG export: save action
- QR construction → PNG export: current image
- PNG export → User-selected PNG: writes PNG
- requirements.txt → Tkinter + ttkbootstrap: declares
- requirements.txt → QR and image libraries: declares
- Tkinter + ttkbootstrap → Tkinter UI: provides
- QR and image libraries → QR construction: provides
- PyInstaller → project.py: bundles target
- test_project.py → QR helper logic: validates
