# viewgithub2023/multi-proxy-config-fetcher architecture

> Architecture diagram of the GitHub repository viewgithub2023/multi-proxy-config-fetcher, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/viewgithub2023/multi-proxy-config-fetcher
- Repository: https://github.com/viewgithub2023/multi-proxy-config-fetcher

## Overview

**[Data Sources] → [Core Processing] → [Output Layer]**

##### Detailed Component Breakdown

a) Data Sources Layer (Top):

b) Core Processing Layer (Middle):
Create three main processing blocks:
##### Config Fetcher Module
- To `fetch_configs.py`
- HTTP request handling
- Base64 decoding process

##### Validation Module
- To `config_validator.py`
- Protocol-specific validation
- Age verification
- Duplicate removal

##### Statistics Generator
- To `generate_charts.py`
- Channel performance tracking
- Success rate calculation

c) Output Layer (Bottom):
- Config Storage (`proxy_configs.txt`)
- Statistics Storage (`channel_stats.json`)
- Performance Charts (`channel_stats_chart.svg`)

##### Data Flow Representation

**Telegram Channels → Config Fetcher**
- ↓
- Validation Module
- ↓
- [Config Storage | Statistics]
- ↓
- Statistics Generator
- ↓
- Performance Charts

##### Additional Elements

Important components:
- GitHub Actions workflow (automation symbol)
- Configuration management (`config.py`)
- Protocol support matrix
- Validation rules

##### Technical Details

- Supported protocols list
- Update frequency (1 hour)
- Validation criteria
- Channel performance metrics

##### Automation Flow

GitHub Actions workflow:
**[GitHub Actions] → [Scheduler] → [Fetch Process] → [Update Configs] → [Generate Stats]**

##### Configuration dependencies

- The automated nature of the system
- Multiple protocol support
- Validation and verification processes
- Statistics and monitoring capabilities
- Configuration management
- GitHub Actions integration

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef source fill:#a8d1f0
    classDef process fill:#90EE90
    classDef storage fill:#FFE5B4
    classDef output fill:#FFA07A
    classDef automation fill:#DDA0DD

    %% Data Sources Layer
    subgraph DataSources["Data Sources Layer"]
        TG[("Telegram API")]:::source
        subgraph Protocols["Supported Protocols"]
            WG["WireGuard"]:::source
            H2["Hysteria2"]:::source
            VL["VLESS"]:::source
            VM["VMess"]:::source
            SS["Shadowsocks"]:::source
            TR["Trojan"]:::source
        end
        TGC1["Channel 1"]:::source
        TGC2["Channel 2"]:::source
        TGC3["Channel 3"]:::source
    end

    %% Core Processing Layer
    subgraph CoreProcessing["Core Processing Layer"]
        CF["Config Fetcher Module"]:::process
        VM1["Validation Module"]:::process
        SG["Statistics Generator"]:::process
        
        subgraph ValidationRules["Validation Rules"]
            VR1["Protocol Validation"]:::process
            VR2["Age Verification"]:::process
            VR3["Duplicate Check"]:::process
        end
    end

    %% Output Layer
    subgraph OutputLayer["Output Layer"]
        CS["Config Storage"]:::storage
        SS1["Statistics Storage"]:::storage
        PC["Performance Charts"]:::output
    end

    %% Automation
    subgraph Automation["Automation"]
        GHA["GitHub Actions"]:::automation
        SCH["Scheduler"]:::automation
        CM["Configuration Management"]:::automation
    end

    %% Relationships
    TG --> TGC1 & TGC2 & TGC3
    TGC1 & TGC2 & TGC3 --> CF
    CF --> VM1
    VM1 --> VR1 & VR2 & VR3
    VR1 & VR2 & VR3 --> CS
    CS --> SG
    SG --> SS1
    SG --> PC
    GHA --> SCH
    SCH --> CF
    CM --> CF
    CM --> VM1

    %% Click Events
    click CF "https://github.com/viewgithub2023/multi-proxy-config-fetcher/blob/main/src/fetch_configs.py"
    click VM1 "https://github.com/viewgithub2023/multi-proxy-config-fetcher/blob/main/src/config_validator.py"
    click SG "https://github.com/viewgithub2023/multi-proxy-config-fetcher/blob/main/src/generate_charts.py"
    click CS "https://github.com/viewgithub2023/multi-proxy-config-fetcher/blob/main/configs/proxy_configs.txt"
    click SS1 "https://github.com/viewgithub2023/multi-proxy-config-fetcher/blob/main/configs/channel_stats.json"
    click GHA "https://github.com/viewgithub2023/multi-proxy-config-fetcher/blob/main/.github/workflows/update-configs.yml"
    click CM "https://github.com/viewgithub2023/multi-proxy-config-fetcher/blob/main/src/config.py"

    %% Legend
    subgraph Legend
        L1["Data Sources"]:::source
        L2["Processing"]:::process
        L3["Storage"]:::storage
        L4["Output"]:::output
        L5["Automation"]:::automation
    end
```
