# aipit2/_httprequest.au3-example architecture

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

- Interactive diagram: https://gitdiagram.com/aipit2/_httprequest.au3-example
- Repository: https://github.com/aipit2/_httprequest.au3-example

## Overview

##### Main Components
- Core Library: At the heart of these samples is the UDF _HttpRequest.au3, which is used by almost every project to handle HTTP communications.
- Sample/Utility Projects:
- “Auto Pick LoL” (automation for League of Legends)
- “Download Tiktok Video”
- “Google Sheet API” examples (integration with Google Sheets)
- “Invoice Download” (includes submodules for various invoice services, image conversion utilities, and additional HTTP-related includes)
- “Regex toolkit” (presumably demonstrating advanced regular expression functionalities)
- “lienminhshop.vn Get Account”
- “tPost” (the most modular task posting project with directories for data, GUI control components, posting logic, and extensions)
- Supporting Files & Shared Resources:
- Data directories (various .data, .json files)
- UDF directories (within “tPost” and others) for utilities such as API, date handling, logging, and more.
- Extensions & External Integrations:
- “tPost/extension 1012” which includes web assets (css, js, manifest) indicating browser extension integration.

##### Relationships and Data Flow
- For each sample project, illustrate a component that “depends on” or “calls” into _HttpRequest:
- For projects like Invoice Download and tPost, further break down internal submodules:
- For Invoice Download, show separate modules for “Include” (which has site-specific scripts) and “Data” (holding various external data files).
- For tPost, highlight its layered structure:
- Data modules (holding JSON, arrays, and site-specific data)
- GUI modules (subdirectories under “Include/Control GUI” with functions for account, site manager, post manager, hotkeys, timers, etc.)
- UDF submodules (for logging, date manipulation, HTTP requests, etc.)
- Browser extension integration (via the “extension 1012” folder)
- That while each sample operates independently, they all share common support libraries (UDF/_HttpRequest and similar utility functions).

##### Architectural Patterns and Design Principles
- Modular Design: Each project has its own self-contained folder, which enforces separation of concerns. Within projects like tPost, modules are further broken down into components (data, GUI, posting modules, UDF library layers), therefore reflecting a highly modular structure.
- Reusability: The _HttpRequest UDF is a reusable module that is shared across various examples.
- Layered Architecture (especially in tPost): With data management, business logic (posting actions), and presentation (GUI pages), the design separates responsibilities clearly.

##### Technologies, Frameworks, and Libraries
- AutoIt is the main programming platform.
- Custom UDF modules for HTTP requests, logging, and other utilities.
- For the “Google Sheet API” sample, additional libraries like jsrsasign.js and key.json are present for API security and authentication.
- Browser extension assets (HTML, CSS, JS, manifest) in tPost indicate integration or user interface enhancements via a browser extension.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Library
    httpUDF["_HttpRequest UDF"]:::core

    %% Sample Projects
    autoPL["Auto Pick LoL"]:::sample
    dlTiktok["Download Tiktok Video"]:::sample
    gSheet["Google Sheet API"]:::sample
    invoice["Invoice Download"]:::invoice
    regex["Regex toolkit"]:::sample
    lienAcc["lienminhshop.vn Get Account"]:::sample
    tpost["tPost"]:::tpost

    %% Relationships: Sample Projects calling _HttpRequest UDF
    autoPL -->|"HTTPCalls"| httpUDF
    dlTiktok -->|"HTTPCalls"| httpUDF
    gSheet -->|"HTTPCalls"| httpUDF
    invoice -->|"HTTPCalls"| httpUDF
    regex -->|"HTTPCalls"| httpUDF
    lienAcc -->|"HTTPCalls"| httpUDF
    tpost -->|"HTTPCalls"| httpUDF

    %% Invoice Download Internal Structure
    subgraph "Invoice Download Internal"
        invData["Data Files"]:::invoice
        invIncl["Include Modules"]:::invoice
    end
    invoice --> invData
    invoice --> invIncl
    invIncl -->|"HTTPCalls"| httpUDF

    %% tPost Internal Structure
    subgraph "tPost Internal"
        tpostData["Data Modules"]:::tpost
        tpostGUI["GUI Components"]:::tpost
        tpostPosting["Posting Logic"]:::tpost
        tpostUDF["UDF Submodules"]:::tpost
        tpostExt["Browser Extension"]:::tpost
    end
    tpostGUI -->|"UserAction"| tpostPosting
    tpostPosting -->|"HTTPCalls"| tpostUDF
    tpostUDF -->|"HTTPCalls"| httpUDF
    tpostData -->|"Supports"| tpostPosting
    tpostExt -->|"EnhancesUI"| tpostGUI

    %% Click Events
    click httpUDF "https://github.com/aipit2/_httprequest.au3-example/blob/main/_HttpRequest.au3"
    click autoPL "https://github.com/aipit2/_httprequest.au3-example/blob/main/Auto Pick LoL/Auto Pick.au3"
    click dlTiktok "https://github.com/aipit2/_httprequest.au3-example/blob/main/Download Tiktok Video.au3"
    click gSheet "https://github.com/aipit2/_httprequest.au3-example/blob/main/Google Sheet API/Google Sheet API Example.au3"
    click invoice "https://github.com/aipit2/_httprequest.au3-example/blob/main/Invoice Download/Invoice Download v2.au3"
    click invIncl "https://github.com/aipit2/_httprequest.au3-example/blob/main/Invoice Download/include/_HttpRequest/_HttpRequest.au3"
    click regex "https://github.com/aipit2/_httprequest.au3-example/blob/main/Regex toolkit/Regex toolkit.au3"
    click lienAcc "https://github.com/aipit2/_httprequest.au3-example/blob/main/lienminhshop.vn Get Account.au3"
    click tpost "https://github.com/aipit2/_httprequest.au3-example/tree/main/tPost"
    click tpostData "https://github.com/aipit2/_httprequest.au3-example/tree/main/tPost/Data"
    click tpostGUI "https://github.com/aipit2/_httprequest.au3-example/tree/main/tPost/Include/Control GUI"
    click tpostUDF "https://github.com/aipit2/_httprequest.au3-example/tree/main/tPost/Include/UDF"
    click tpostExt "https://github.com/aipit2/_httprequest.au3-example/tree/main/tPost/extension 1012"

    %% Styles
    classDef core fill:#f9f,stroke:#333,stroke-width:2px;
    classDef sample fill:#ccf,stroke:#333,stroke-width:2px;
    classDef invoice fill:#cfc,stroke:#333,stroke-width:2px;
    classDef tpost fill:#ffc,stroke:#333,stroke-width:2px;
```
