# andrisjefimovs/gyvermatrix-automation architecture

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

- Interactive diagram: https://gitdiagram.com/andrisjefimovs/gyvermatrix-automation
- Repository: https://github.com/andrisjefimovs/gyvermatrix-automation

## Overview

Project Type: Automation Bot with Image Processing
This is a specialized automation tool that captures, processes, and transmits display data through Telegram.

##### Input Layer
- Browser Interface (Selenium WebDriver)
- Screenshot Capture Module (myScreenshoter.py)

##### Processing Layer
- Image Processing Module (OpenCV)
- Pixel Data Extraction
- Matrix Data Conversion (NumPy)

##### Output Layer
- Telegram Bot Interface (Telethon)
- LED Matrix Display

##### Data Flow Representation
- Browser (Selenium) → Screenshot → Image Processing → Matrix Data → Telegram Bot → LED Matrix

##### Component Details
- Rectangles: Main processing modules
- Rounded rectangles: External services (Telegram)
- Hexagons: Hardware components (LED Matrix)

##### Technical Specifications
Labels for:
- Technologies used (Selenium, OpenCV, NumPy, Telethon)
- Data formats at each stage
- Key transformations (perspective correction, pixel extraction)

Specific Implementation Guidelines:

##### Input Section
- Selenium WebDriver connecting to the browser
- Screenshot capture mechanism
- Configuration parameters

##### Processing Section
- Detail the OpenCV perspective correction
- NumPy array processing
- Pixel data extraction flow

##### Output Section
- Telegram bot API integration
- Message update mechanism
- Final LED matrix output

- Blue: Input components (Browser, Selenium)
- Green: Processing components (OpenCV, NumPy)
- Orange: Output components (Telegram, LED Matrix)
- Gray: Data storage elements

Additional Considerations:
##### Asynchronous operations

- → : Data flow direction
- ⚙️ : Processing modules
- 💾 : Data storage
- 🤖 : Bot interface
- 📱 : External services

This system design should effectively communicate how the browser content is captured, processed, and ultimately displayed on the LED matrix through Telegram bot commands.

## Diagram (Mermaid)

```mermaid
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#007bff', 'primaryTextColor': '#fff', 'primaryBorderColor': '#007bff', 'lineColor': '#333', 'secondaryColor': '#f8f9fa', 'tertiaryColor': '#e9ecef'}}}%%

flowchart TB
    classDef input fill:#007bff,stroke:#0056b3,color:#fff
    classDef processing fill:#28a745,stroke:#1e7e34,color:#fff
    classDef output fill:#fd7e14,stroke:#dc6502,color:#fff
    classDef storage fill:#6c757d,stroke:#545b62,color:#fff
    classDef external fill:#6f42c1,stroke:#59339d,color:#fff

    subgraph Input
        Browser["Browser Interface"]:::input
        Selenium["Selenium WebDriver"]:::input
        Screenshot["Screenshot Capture"]:::input
    end

    subgraph Processing
        OpenCV["OpenCV Processing"]:::processing
        PixelExtract["Pixel Data Extraction"]:::processing
        MatrixConv["Matrix Data Conversion"]:::processing
    end

    subgraph Output
        TelegramBot["Telegram Bot Interface"]:::output
        LEDMatrix["LED Matrix Display"]:::output
    end

    Storage[("bitmap.json")]:::storage

    Browser --> Selenium
    Selenium --> Screenshot
    Screenshot --> OpenCV
    OpenCV --> PixelExtract
    PixelExtract --> MatrixConv
    MatrixConv --> Storage
    Storage --> TelegramBot
    TelegramBot --> LEDMatrix

    %% Click events for component mapping
    click Screenshot "https://github.com/AndrisJefimovs/gyvermatrix-automation/blob/main/myScreenshoter.py"
    click Selenium "https://github.com/AndrisJefimovs/gyvermatrix-automation/blob/main/myScreenshoter.py"
    click TelegramBot "https://github.com/AndrisJefimovs/gyvermatrix-automation/blob/main/bot.py"
    click Storage "https://github.com/AndrisJefimovs/gyvermatrix-automation/blob/main/bitmap.json"

    %% Legend
    subgraph Legend
        L1["Input Components"]:::input
        L2["Processing Components"]:::processing
        L3["Output Components"]:::output
        L4["Storage Components"]:::storage
    end
```
