# huynhmainhatminh/proxycli architecture

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

- Interactive diagram: https://gitdiagram.com/huynhmainhatminh/proxycli
- Repository: https://github.com/huynhmainhatminh/proxycli

## Overview

Based on our inspection of the file tree and README, ProxyCLI is a Python-based, asynchronous, multithreaded CLI tool that scrapes and verifies premium proxies. Its primary functions are to fetch proxy lists, perform various checks (for HTTPS accessibility, fraud score, and more), and display results in a user-friendly way while outputting categorized reports.

##### Main components
- Entry Point – The main driver (proxy.py) that initializes the application.
- Proxy Data Handling – The “data” folder modules (e.g., get_proxies.py, display_proxies.py, input_api.py) that fetch proxies from various sources. This is supported by configuration files (settings.py, settings.json) and URL lists (urls.txt).
- Proxy Checking Modules – A suite of checker modules in the “data” folder (checker_api.py, checker_fraud_score.py, checker_https.py, checker_proxies.py) which asynchronously validate proxies against specific criteria.
- Output Management – The “output” directory structure which organizes results. It is subdivided into different proxy types and risk levels (e.g., output/hazardReport, output/http_s, output/socks4, output/socks5, output/risk) that store processed results, including blacklist checks and connectivity results.
- Ancillary Modules – Additional support files such as logo.py and extra.py that enhance the UI/UX or extend functionality.

##### Relationships and interactions
- Also, indicate the use of configuration data (settings.json and settings.py) as a separate “Configuration” component that both Data and Checker modules reference.

##### Important architectural patterns and design principles
- Separation of Concerns: Each module (UI, Data Fetcher, Checker, Output Writer) is clearly defined and decoupled, ensuring maintainability.
- Modular Design: The clear directory structure shows discrete responsibilities (the “data” modules for fetching/checking and the “Display” modules for UI).

##### And annotate the technologies/frameworks involved
- Python is the core language.
- Use of asynchronous libraries and multithreading (you may note “asyncio” or similar, even if not explicitly mentioned, as it is implied by the asynchronous behavior).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry Point
    EP["proxy.py (Application Entry Point)"]:::entry

    %% Presentation Layer
    subgraph "Presentation Layer"
        UI1["Display/home.py"]:::ui
        UI2["Display/selecte_home.py"]:::ui
        UI3["Clear/clear_display.py"]:::ui
        AN1["logo.py"]:::ancillary
        AN2["data/extra.py"]:::ancillary
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        subgraph "Proxy Data Handling"
            D1["data/get_proxies.py"]:::data
            D2["data/display_proxies.py"]:::data
            D3["data/input_api.py"]:::data
            D4["data/setting.py"]:::data
            D5["data/settings.json"]:::data
            D6["data/urls.txt"]:::data
        end
        subgraph "Proxy Checkers (Async Modules)"
            C1["data/checker_api.py"]:::checkers
            C2["data/checker_fraud_score.py"]:::checkers
            C3["data/checker_https.py"]:::checkers
            C4["data/checker_proxies.py"]:::checkers
        end
    end

    %% Configuration Node (shared by Data and Checkers)
    CONFIG["Configuration"]:::config

    %% Data Persistence Layer
    subgraph "Data Persistence Layer"
        OUT["Output Management (output/)"]:::output
    end

    %% Connections
    EP -->|"initiates"| UI1
    UI1 -->|"Data_request"| D1
    D1 -->|"ProxyValidation-Asynchronous"| C1
    C1 -->|"Results"| OUT
    OUT -->|"UI_update"| UI1
    CONFIG -->|"UsedBy"| D4
    CONFIG -->|"UsedBy"| C1

    %% LinkStyle for asynchronous calls (dashed line)
    linkStyle 2 stroke-dasharray: 5,5

    %% Click Events
    click EP "https://github.com/huynhmainhatminh/proxycli/blob/main/proxy.py"
    click UI1 "https://github.com/huynhmainhatminh/proxycli/blob/main/Display/home.py"
    click UI2 "https://github.com/huynhmainhatminh/proxycli/blob/main/Display/selecte_home.py"
    click UI3 "https://github.com/huynhmainhatminh/proxycli/blob/main/Clear/clear_display.py"
    click AN1 "https://github.com/huynhmainhatminh/proxycli/blob/main/logo.py"
    click AN2 "https://github.com/huynhmainhatminh/proxycli/blob/main/data/extra.py"
    click D1 "https://github.com/huynhmainhatminh/proxycli/blob/main/data/get_proxies.py"
    click D2 "https://github.com/huynhmainhatminh/proxycli/blob/main/data/display_proxies.py"
    click D3 "https://github.com/huynhmainhatminh/proxycli/blob/main/data/input_api.py"
    click D4 "https://github.com/huynhmainhatminh/proxycli/blob/main/data/setting.py"
    click D5 "https://github.com/huynhmainhatminh/proxycli/blob/main/data/settings.json"
    click D6 "https://github.com/huynhmainhatminh/proxycli/blob/main/data/urls.txt"
    click C1 "https://github.com/huynhmainhatminh/proxycli/blob/main/data/checker_api.py"
    click C2 "https://github.com/huynhmainhatminh/proxycli/blob/main/data/checker_fraud_score.py"
    click C3 "https://github.com/huynhmainhatminh/proxycli/blob/main/data/checker_https.py"
    click C4 "https://github.com/huynhmainhatminh/proxycli/blob/main/data/checker_proxies.py"
    click OUT "https://github.com/huynhmainhatminh/proxycli/tree/main/output/"

    %% Styles
    classDef entry fill:#f9c74f,stroke:#000,stroke-width:1px;
    classDef ui fill:#90be6d,stroke:#000,stroke-width:1px;
    classDef ancillary fill:#a9def9,stroke:#000,stroke-width:1px;
    classDef data fill:#f9844a,stroke:#000,stroke-width:1px;
    classDef checkers fill:#f94144,stroke:#000,stroke-width:1px;
    classDef output fill:#277da1,stroke:#000,stroke-width:1px;
    classDef config fill:#577590,stroke:#000,stroke-width:1px;
```
