# kort0881/telegram-proxy-collector architecture

> Architecture diagram of the GitHub repository kort0881/telegram-proxy-collector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kort0881/telegram-proxy-collector
- Repository: https://github.com/kort0881/telegram-proxy-collector

## Overview

This is a Telegram MTProto and SOCKS5 proxy collector that gathers public and manual candidates, filters and checks them, then publishes regional and protocol-specific lists. A separate analytics workflow summarizes verified results, detects anomalies, and recommends settings; AI analytics can update the README using Groq or local generation. The README also documents a mobile interface for using the lists. Several workflow links are supported by README descriptions; the sampled source excerpts do not show every collection, filtering, probing, or output detail.

Main entry points: [`main.py`](https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py) (Harvest and parse), [`analytics.py`](https://github.com/kort0881/telegram-proxy-collector/blob/main/analytics.py) (Verified history), [`verified`](https://github.com/kort0881/telegram-proxy-collector/tree/main/verified) (Verified proxy lists), [`ai_analytics.py`](https://github.com/kort0881/telegram-proxy-collector/blob/main/ai_analytics.py) (AI report generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection"]
  node_sources["Proxy sources"]
  node_manual["Manual proxies<br/>[main.py]"]
  node_harvest["Harvest and parse<br/>[main.py]"]
  node_seen[("Seen cache<br/>[main.py]")]
end

subgraph group_verification["Verification"]
  node_smart_filter["Smart filtering<br/>[main.py]"]
  node_fake_tls["Fake-TLS analysis<br/>[main.py]"]
  node_tcp_check["TCP verification<br/>[main.py]"]
  node_regional_lists[("Verified proxy lists")]
end

subgraph group_analytics["Analytics"]
  node_verified_history[("Verified history<br/>[analytics.py]")]
  node_metrics_models["Metrics and models<br/>[analytics.py]"]
  node_analytics_reports["Analytics reports"]
  node_ai_report["AI report generation<br/>[ai_analytics.py]"]
  node_readme_report["README report<br/>[README.md]"]
end

subgraph group_consumption["Consumption"]
  node_published_lists["Published lists"]
  node_mobile_ui["Mobile interface<br/>[mobile.html]"]
end

node_operator(("Operator"))
node_groq["Groq API"]
node_telegram_user(("Telegram user"))

node_operator -->|"runs collection"| node_harvest
node_sources -->|"provides candidates"| node_harvest
node_manual -->|"adds candidates"| node_harvest
node_harvest -->|"checks cache"| node_seen
node_harvest -->|"passes candidates"| node_smart_filter
node_smart_filter -->|"passes candidates"| node_fake_tls
node_fake_tls -->|"passes candidates"| node_tcp_check
node_tcp_check -->|"writes verified lists"| node_regional_lists
node_regional_lists -->|"copies lists"| node_published_lists
node_operator -->|"runs analytics"| node_verified_history
node_regional_lists -->|"loads verified data"| node_verified_history
node_verified_history -->|"analyzes history"| node_metrics_models
node_metrics_models -->|"saves reports"| node_analytics_reports
node_verified_history -->|"loads history"| node_ai_report
node_ai_report -->|"requests analysis"| node_groq
node_ai_report -->|"updates report"| node_readme_report
node_telegram_user -->|"opens interface"| node_mobile_ui
node_mobile_ui -->|"offers proxy lists"| node_published_lists

click node_manual "https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py"
click node_harvest "https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py"
click node_seen "https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py"
click node_smart_filter "https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py"
click node_fake_tls "https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py"
click node_tcp_check "https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py"
click node_regional_lists "https://github.com/kort0881/telegram-proxy-collector/tree/main/verified"
click node_verified_history "https://github.com/kort0881/telegram-proxy-collector/blob/main/analytics.py"
click node_metrics_models "https://github.com/kort0881/telegram-proxy-collector/blob/main/analytics.py"
click node_analytics_reports "https://github.com/kort0881/telegram-proxy-collector/tree/main/reports"
click node_ai_report "https://github.com/kort0881/telegram-proxy-collector/blob/main/ai_analytics.py"
click node_readme_report "https://github.com/kort0881/telegram-proxy-collector/blob/main/README.md"
click node_mobile_ui "https://github.com/kort0881/telegram-proxy-collector/blob/main/mobile.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sources,node_manual,node_harvest,node_seen,node_telegram_user toneBlue
class node_smart_filter,node_fake_tls,node_tcp_check,node_regional_lists toneAmber
class node_verified_history,node_metrics_models,node_analytics_reports,node_ai_report,node_readme_report,node_groq toneMint
class node_published_lists,node_mobile_ui toneRose
class node_operator toneIndigo
```

## Components

### Collection

- **Proxy sources**
- [Manual proxies](https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py): `main.py`
- [Harvest and parse](https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py): `main.py`
- [Seen cache](https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py): `main.py`

### Verification

- [Smart filtering](https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py): `main.py`
- [Fake-TLS analysis](https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py): `main.py`
- [TCP verification](https://github.com/kort0881/telegram-proxy-collector/blob/main/main.py): `main.py`
- [Verified proxy lists](https://github.com/kort0881/telegram-proxy-collector/tree/main/verified): `verified`

### Analytics

- [Verified history](https://github.com/kort0881/telegram-proxy-collector/blob/main/analytics.py): `analytics.py`
- [Metrics and models](https://github.com/kort0881/telegram-proxy-collector/blob/main/analytics.py): `analytics.py`
- [Analytics reports](https://github.com/kort0881/telegram-proxy-collector/tree/main/reports): `reports`
- [AI report generation](https://github.com/kort0881/telegram-proxy-collector/blob/main/ai_analytics.py): `ai_analytics.py`
- [README report](https://github.com/kort0881/telegram-proxy-collector/blob/main/README.md): `README.md`

### Consumption

- **Published lists**
- [Mobile interface](https://github.com/kort0881/telegram-proxy-collector/blob/main/mobile.html): `mobile.html`

### Other components

- **Operator**
- **Groq API**
- **Telegram user**

## Connections

- Operator → Harvest and parse: runs collection (evidence: `README.md`)
- Proxy sources → Harvest and parse: provides candidates (evidence: `README.md`)
- Manual proxies → Harvest and parse: adds candidates (evidence: `README.md`)
- Harvest and parse → Seen cache: checks cache (evidence: `main.py`)
- Harvest and parse → Smart filtering: passes candidates (evidence: `README.md`)
- Smart filtering → Fake-TLS analysis: passes candidates (evidence: `README.md`)
- Fake-TLS analysis → TCP verification: passes candidates (evidence: `README.md`)
- TCP verification → Verified proxy lists: writes verified lists (evidence: `README.md`)
- Verified proxy lists → Published lists: copies lists (evidence: `README.md`)
- Operator → Verified history: runs analytics (evidence: `analytics.py`)
- Verified proxy lists → Verified history: loads verified data (evidence: `analytics.py`)
- Verified history → Metrics and models: analyzes history (evidence: `analytics.py`)
- Metrics and models → Analytics reports: saves reports (evidence: `analytics.py`)
- Verified history → AI report generation: loads history (evidence: `ai_analytics.py`)
- AI report generation → Groq API: requests analysis (evidence: `ai_analytics.py`)
- AI report generation → README report: updates report (evidence: `ai_analytics.py`)
- Telegram user → Mobile interface: opens interface (evidence: `README.md`)
- Mobile interface → Published lists: offers proxy lists (evidence: `README.md`)
