# hohohocch/better-snipping-tool architecture

> Architecture diagram of the GitHub repository hohohocch/better-snipping-tool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hohohocch/better-snipping-tool
- Repository: https://github.com/hohohocch/better-snipping-tool

## Overview

##### Project type and purpose
- From the README and file tree, this is a standalone desktop snipping tool written in Python.
- Its goal is to provide a richer feature set than Microsoft’s Snip & Sketch: rectangular snips, copy to clipboard, save-to-file, and a freeze-mode capture.

##### File structure
- Top level:
- snipping.py – the main application script
- settings.yml – user-configurable options (e.g., default save path, file format)
- logs.txt – runtime logging output
- screenshots/ – directory where captures are saved
- README.md, LICENSE – documentation and licensing
- No separate “frontend”/“backend” folders; this is a single binary/script that houses UI, capture logic, clipboard and file I/O, and configuration.

##### README for additional insights
- Confirms the core features (rectangular snip, clipboard copy, file saving, freeze mode)
- No external services or databases—everything runs locally
- Likely uses a GUI toolkit (e.g., Tkinter, PyQt, or similar) and system-level screen-capture APIs.

##### Detail without overthinking
- Keep it simple, but don’t omit any piece of the capture → output pipeline.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Core Application Process"
        UI["UI Layer"]:::internal
        Capture["Capture Engine"]:::internal
        Clipboard["Clipboard Manager"]:::internal
        FileMgr["File Manager"]:::internal
        Config["Configuration Loader"]:::config
        Logger["Logger"]:::log
    end

    OS["OS Screen Capture API"]:::external
    SysClip["System Clipboard"]:::external
    FS["File System (screenshots/)"]:::external

    UI -->|"snipRequest()"| Capture
    Capture -->|"imageData"| Clipboard
    Capture -->|"imageData"| FileMgr
    FileMgr -->|"saveFile()"| FS
    Clipboard -->|"copyToClipboard()"| SysClip
    FileMgr -->|"loadSettings()"| Config
    UI -->|"loadSettings()"| Config
    UI -->|"logEvent()"| Logger
    Capture -->|"logEvent()"| Logger
    Clipboard -->|"logEvent()"| Logger
    FileMgr -->|"logEvent()"| Logger
    Config -->|"logEvent()"| Logger

    click UI "https://github.com/hohohocch/better-snipping-tool/blob/main/snipping.py"
    click Capture "https://github.com/hohohocch/better-snipping-tool/blob/main/snipping.py"
    click Clipboard "https://github.com/hohohocch/better-snipping-tool/blob/main/snipping.py"
    click FileMgr "https://github.com/hohohocch/better-snipping-tool/blob/main/snipping.py"
    click FileMgr "https://github.com/hohohocch/better-snipping-tool/tree/main/screenshots/"
    click Config "https://github.com/hohohocch/better-snipping-tool/blob/main/settings.yml"
    click Logger "https://github.com/hohohocch/better-snipping-tool/blob/main/snipping.py"
    click Logger "https://github.com/hohohocch/better-snipping-tool/blob/main/logs.txt"

    classDef internal fill:#8fd3f4,stroke:#333,stroke-width:1px;
    classDef external fill:#f4a261,stroke:#333,stroke-width:1px;
    classDef config fill:#a8dadc,stroke:#333,stroke-width:1px;
    classDef log fill:#e9c46a,stroke:#333,stroke-width:1px;
```
