# suppliedorange/digital-cheatsheet architecture

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

- Interactive diagram: https://gitdiagram.com/suppliedorange/digital-cheatsheet
- Repository: https://github.com/suppliedorange/digital-cheatsheet

## Overview

##### Main Components

a) Core Application Layer:
- Hotkey Management System
- GUI Components (Search bar, popup windows)
- Keystroke Recording Module

b) AI Integration Layer:
- Gemini API Client
- Screenshot Analysis Module
- Question Processing Engine

c) Input/Output Systems:
- Clipboard Manager
- Screenshot Capture System
- Keyboard Input Handler

d) Data Storage:
- Notes Storage System
- Configuration Storage
- Secret Messages Repository

**[User Input Layer]**

- Keyboard Hotkeys
- Clipboard Content
- Screen Capture

**[Core Processing Layer]**

- Hotkey Manager
- Event Router

- Input Processor
- Keystroke Recorder
- Screenshot Analyzer
- Clipboard Manager

- Response Generator
- Notes Retrieval
- AI Processing

**[External Services]**

- Gemini AI API

**[Output Layer]**

- GUI Display
- Text Output

##### Important Elements to Highlight

a) Bypass Mechanisms:
- Full-screen restriction bypass
- Keystroke recording system
- Clipboard integration

b) AI Integration Points:
- Screenshot analysis pipeline
- Question processing flow
- Model switching mechanism

##### Data Flow Indicators

- User input flow → Core processing
- Core processing → AI services
- AI services → Response generation
- Response → Output display

##### Technical Details

- Python-based architecture
- GUI framework integration
- External library dependencies
- File system interactions

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef userInput fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#f1c40f,stroke:#f39c12,color:black
    classDef output fill:#9b59b6,stroke:#8e44ad,color:white
    classDef security fill:#e74c3c,stroke:#c0392b,color:white

    %% User Input Layer
    subgraph UserInput["User Input Layer"]
        KH["Keyboard Hotkeys"]:::userInput
        CC["Clipboard Content"]:::userInput
        SC["Screen Capture"]:::userInput
    end

    %% Core Processing Layer
    subgraph CoreProcessing["Core Processing Layer"]
        HM["Hotkey Manager"]:::core
        ER["Event Router"]:::core
        IP["Input Processor"]:::core
        KR["Keystroke Recorder"]:::security
        SA["Screenshot Analyzer"]:::core
        CM["Clipboard Manager"]:::core
        RG["Response Generator"]:::core
        NR["Notes Retrieval"]:::core
        AP["AI Processing"]:::core
    end

    %% External Services Layer
    subgraph ExternalServices["External Services"]
        GAI["Gemini AI API"]:::external
    end

    %% Output Layer
    subgraph OutputLayer["Output Layer"]
        GUI["GUI Display"]:::output
        TO["Text Output"]:::output
    end

    %% Dependencies and Documentation
    DEP["Dependencies"]:::core
    TEST["Testing Framework"]:::core
    DOC["Documentation"]:::core

    %% Relationships
    KH --> HM
    CC --> CM
    SC --> SA
    
    HM --> ER
    ER --> IP
    IP --> KR
    IP --> SA
    IP --> CM
    
    SA --> RG
    CM --> RG
    RG --> NR
    RG --> AP
    
    AP --> GAI
    GAI --> RG
    
    RG --> GUI
    RG --> TO

    %% Click events for mapped components
    click DEP "https://github.com/SuppliedOrange/digital-cheatsheet/blob/main/requirements.txt"
    click TEST "https://github.com/SuppliedOrange/digital-cheatsheet/blob/main/test.py"
    click DOC "https://github.com/SuppliedOrange/digital-cheatsheet/blob/main/README.md"

    %% Legend
    subgraph Legend
        UI["User Input"]:::userInput
        CP["Core Processing"]:::core
        ES["External Services"]:::external
        OT["Output"]:::output
        SC["Security Components"]:::security
    end
```
