# the-laziest-coder/galxe-aio architecture

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

- Interactive diagram: https://gitdiagram.com/the-laziest-coder/galxe-aio
- Repository: https://github.com/the-laziest-coder/galxe-aio

## Overview

##### Main Components
- Entry Points & Configuration:
- main.py and checker.py serve as the main executables.
- config.toml holds custom settings and various flags (like FAKE_TWITTER, GALXE_CAMPAIGN_IDS).
- The “files/” folder holds data like wallets, proxies, email addresses, social media handles, etc.
- Core Internal Modules (in “internal/”):
- internal/config: Reads and parses configuration settings.
- internal/captcha: Handles captcha generation/solving routines.
- internal/email: Provides multiple strategies (base, imap, mail3) for processing emails.
- internal/galxe: Manages Galxe campaign tasks, including account handling and API interactions.
- internal/onchain: Responsible for blockchain interactions, managing smart contract ABIs (loyalty_points.json, space_station.json), and onchain account operations.
- internal/twitter: Contains Twitter related components including a submodule (client_transaction) to manage complex transaction computations (e.g., cubic_curve, interpolation, rotation) that are likely performing nuanced calculations/transformations for Twitter actions.
- internal/utils: Houses utility functions for asynchronous operations and common helpers.
- internal/vars: Likely manages global variables or constants shared across modules.
- internal/storage: Likely a module that performs data persistence during runtime.
- Data & Logging:
- “storage/” folder acts as a local database (for quizzes.json).
- “results/” folder stores the outcome of runs (stats.csv) indicating processed results.
- “logs/” folder captures error and operational logs.

##### Understand Component Interactions
- The main.py script initiates the overall process:
- It likely loads configuration from config.toml via internal/config.
- Launches various modules such as those for social media interactions (internal/twitter, internal/galxe) and email processing.
- The program relies on external and internal files (e.g., files for wallet info, proxies, etc.) to drive its task automation.
- Each internal module provides a specialized service:
- For example, internal/email’s factory and modules determine which email handling strategy to use.
- internal/onchain handles blockchain-related verifications and interactions.
- Tasks like captcha solving, quiz completion, or referral link handling are performed by their respective modules.
- Dependencies and Utilities:
- Generic utility functions (internal/utils) provide asynchronous web3 integration and other helpers.
- Modules like internal/tls show a dedicated component for secure communication, reinforcing the design’s modularity.

##### Architectural Patterns and Key Technologies
- Modularity and Separation of Concerns: Each functionality (captcha, email, on-chain, Twitter) is encapsulated in its own submodule.
- API Integrations and External Communications: The system clearly integrates with multiple external services/APIs, employing separate modules for each.
- Decoupled Data Storage and Logging: Using separate directories for runtime storage, persistent results, and error logs allows independent management of operational data.
- Use of a centralized “config” module: Centralizes the configuration, ensuring settings are easily modifiable and propagated across components.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry & Configuration Layer
    subgraph "Entry & Configuration Layer"
        Main["main.py"]:::entry
        Checker["checker.py"]:::entry
        ConfigFile["config.toml"]:::config
        FilesFolder["files/"]:::config
    end

    %% Internal Modules
    subgraph "Internal Modules"
        InternalConfig["internal/config"]:::module
        InternalCaptcha["internal/captcha"]:::module
        InternalEmail["internal/email"]:::module
        InternalGalxe["internal/galxe"]:::module
        InternalOnchain["internal/onchain"]:::module
        InternalTwitter["internal/twitter"]:::module
        InternalUtils["internal/utils"]:::module
        InternalVars["internal/vars"]:::module
        InternalStorage["internal/storage"]:::module
    end

    %% External/Data Persistence
    subgraph "External/Data Persistence"
        StorageDB["storage/quizzes.json"]:::data
        Results["results/stats.csv"]:::data
        Logs["logs/errors.txt"]:::data
    end

    %% External Services
    subgraph "External Services"
        TwitterAPI["Twitter API"]:::external
        EmailServer["Email Server"]:::external
        Blockchain["Blockchain Network"]:::external
        GalxeAPI["Galxe API"]:::external
    end

    %% Connections: Entry & Config to Internal Modules
    Main -->|"loadConfig"| InternalConfig
    Checker -->|"loadConfig"| InternalConfig
    InternalConfig -->|"reads"| ConfigFile
    InternalConfig -->|"loadsData"| FilesFolder

    %% Main module interactions with core functionalities
    Main -->|"captchaTasks"| InternalCaptcha
    Main -->|"emailTasks"| InternalEmail
    Main -->|"GalxeTasks"| InternalGalxe
    Main -->|"blockchainTasks"| InternalOnchain
    Main -->|"twitterTasks"| InternalTwitter
    Main -->|"utilityCalls"| InternalUtils
    Main -->|"globalVars"| InternalVars
    Main -->|"dataPersistence"| InternalStorage

    %% External Service integrations
    InternalEmail -->|"uses"| EmailServer
    InternalTwitter -->|"sendsTweets"| TwitterAPI
    InternalOnchain -->|"blockchainCalls"| Blockchain
    InternalGalxe -->|"campaignCalls"| GalxeAPI

    %% Data Persistence connections
    InternalStorage -->|"read/write"| StorageDB
    InternalStorage -->|"writes"| Results
    InternalStorage -->|"logsTo"| Logs

    %% Click Events
    click Main "https://github.com/the-laziest-coder/galxe-aio/blob/main//main.py"
    click Checker "https://github.com/the-laziest-coder/galxe-aio/blob/main//checker.py"
    click ConfigFile "https://github.com/the-laziest-coder/galxe-aio/blob/main//config.toml"
    click FilesFolder "https://github.com/the-laziest-coder/galxe-aio/tree/main//files"
    click InternalConfig "https://github.com/the-laziest-coder/galxe-aio/blob/main//internal/config/config.py"
    click InternalCaptcha "https://github.com/the-laziest-coder/galxe-aio/blob/main//internal/captcha/captcha.py"
    click InternalEmail "https://github.com/the-laziest-coder/galxe-aio/tree/main//internal/email/"
    click InternalGalxe "https://github.com/the-laziest-coder/galxe-aio/tree/main//internal/galxe/"
    click InternalOnchain "https://github.com/the-laziest-coder/galxe-aio/tree/main//internal/onchain/"
    click InternalTwitter "https://github.com/the-laziest-coder/galxe-aio/tree/main//internal/twitter/"
    click InternalUtils "https://github.com/the-laziest-coder/galxe-aio/tree/main//internal/utils/"
    click InternalVars "https://github.com/the-laziest-coder/galxe-aio/blob/main//internal/vars/vars.py"
    click InternalStorage "https://github.com/the-laziest-coder/galxe-aio/blob/main//internal/storage/storage.py"
    click StorageDB "https://github.com/the-laziest-coder/galxe-aio/blob/main//storage/quizzes.json"
    click Results "https://github.com/the-laziest-coder/galxe-aio/blob/main//results/stats.csv"
    click Logs "https://github.com/the-laziest-coder/galxe-aio/blob/main//logs/errors.txt"

    %% Styles
    classDef entry fill:#f9d0a9,stroke:#333,stroke-width:2px;
    classDef config fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef module fill:#c1f0c1,stroke:#333,stroke-width:2px;
    classDef data fill:#fff2cc,stroke:#333,stroke-width:2px;
    classDef external fill:#f4cccc,stroke:#333,stroke-width:2px;
```
