# blueryo/tix_bot architecture

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

- Interactive diagram: https://gitdiagram.com/blueryo/tix_bot
- Repository: https://github.com/blueryo/tix_bot

## Overview

##### Main Components
- Bot Core/Automation Module:
- Key source files: chrome_tixcraft.py and NonBrowser.py which contain the core logic for automating ticket purchasing.
- Configuration and Settings:
- settings.py and settings.json serve as the configuration controller and provide a GUI for setting options.
- External Dependencies & Assets:
- The bot leverages Selenium (as noted in the pip-reg.txt and README instructions) and uses external executables (ChromeDriver or geckodriver) which must be placed under a designated webdriver folder.
- Assets such as ding.wav, ding-dong.wav (audio feedback for events), and maxbot_logo2_single.ppm (brand image) support the user interface and alerts.
- Supporting Files:
- .gitignore and LICENSE are standard repository files ensuring proper versioning and licensing.

##### Relationships and Interactions
- User Input / Configuration:
- The user configures the bot by running settings.py, which reads from or updates settings.json.
- Bot Engine:
- The automation logic in chrome_tixcraft.py (and potentially NonBrowser.py for headless or non-browser interactions) takes the configured parameters to perform automated web actions.
- WebDriver Integration:
- The bot uses Selenium WebDriver (specified by the chromedriver executable) to control the browser. Represent the flow from the bot engine to the WebDriver, and then from the WebDriver to the ticketing websites.
- Ticketing Services:
- Although not implemented as internal components, external ticketing sites (tixcraft, kktix, etc.) are critical endpoints. These can be represented as external systems that the bot interacts with via web automation.

##### Architectural Patterns and Technologies
- The architecture follows a simple modular script design rather than a full microservices setup. It uses event-driven automation (tracking events such as captcha input and page redirects) and relies on external browser automation.
- Role of Selenium and the browser driver integration, which are central to the system’s functionality.
- UI/UX considerations provided by settings.py (opening a configuration GUI) and user notifications (audio alerts).

##### Be Detailed and Comprehensive
- Every file and component that affects system behavior is represented, even if they are small utility assets.
- Both the static aspects (file structure, configuration) and the dynamic interactions (browser automation event flow, user-triggered settings updates).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Interface & Configuration"
        configA("settings.py"):::config
        configB("settings.json"):::config
    end

    subgraph "Automation Core"
        coreA("chrome_tixcraft.py"):::core
        coreB("NonBrowser.py"):::core
    end

    subgraph "External Interactions"
        extA("Selenium WebDriver (ChromeDriver/geckodriver)"):::external
        extB("Ticketing Services (tixcraft, kktix, cityline, urbtix, FamiTicket, ibon)"):::external
    end

    subgraph "Assets & Supporting Files"
        assetA("pip-reg.txt"):::asset
        assetB("ding.wav"):::asset
        assetC("ding-dong.wav"):::asset
        assetD("maxbot_logo2_single.ppm"):::asset
        assetE(".gitignore"):::asset
        assetF("LICENSE"):::asset
    end

    %% Relationships within User Interface & Configuration
    configA -->|"reads"| configB

    %% From Configuration to Automation Core
    configA -->|"configures"| coreA
    configA -->|"configures"| coreB

    %% From Automation Core to External Interactions
    coreA -->|"automates"| extA
    coreB -->|"executes"| extA
    extA -->|"controls"| extB

    %% Click Events
    click configA "https://github.com/blueryo/tix_bot/blob/master//settings.py"
    click configB "https://github.com/blueryo/tix_bot/blob/master//settings.json"
    click coreA "https://github.com/blueryo/tix_bot/blob/master//chrome_tixcraft.py"
    click coreB "https://github.com/blueryo/tix_bot/blob/master//NonBrowser.py"
    click assetA "https://github.com/blueryo/tix_bot/blob/master//pip-reg.txt"
    click assetB "https://github.com/blueryo/tix_bot/blob/master//ding.wav"
    click assetC "https://github.com/blueryo/tix_bot/blob/master//ding-dong.wav"
    click assetD "https://github.com/blueryo/tix_bot/blob/master//maxbot_logo2_single.ppm"
    click assetE "https://github.com/blueryo/tix_bot/blob/master//.gitignore"
    click assetF "https://github.com/blueryo/tix_bot/tree/master//LICENSE"

    %% Styles
    classDef config fill:#c2f0fc,stroke:#003366,stroke-width:2px;
    classDef core fill:#d5e8d4,stroke:#82b366,stroke-width:2px;
    classDef external fill:#f9e79f,stroke:#b7950b,stroke-width:2px;
    classDef asset fill:#fcebb6,stroke:#cda434,stroke-width:2px;
```
