# zhaketabin/dataanalizbotuz architecture

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

- Interactive diagram: https://gitdiagram.com/zhaketabin/dataanalizbotuz
- Repository: https://github.com/zhaketabin/dataanalizbotuz

## Overview

DataAnalizBotUz is a Telegram bot for company data analysis. Its main workflow is client registration and activation, question selection, Excel/CSV submission, analysis, and delivery of results with a PDF report. The single source file also contains multilingual prompts, client and access management, and administrator commands and reporting. The excerpts show SQLite-backed client data and report generation; the analysis implementation and several database operations fall in omitted sections, so those connections are documented but marked unverified where appropriate.

Main entry points: [`bot.py`](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py) (File submission)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_registration["Client onboarding"]
  node_language["Language selection<br/>[bot.py]"]
  node_registration_flow["Client registration<br/>[bot.py]"]
  node_phone_screen["Phone and service checks<br/>[bot.py]"]
end

subgraph group_access["Access and administration"]
  node_client_store[("Client database<br/>[bot.py]")]
  node_activation["Activation controls<br/>[bot.py]"]
  node_admin_reports["Admin reporting<br/>[bot.py]"]
end

subgraph group_analysis["Analysis and reporting"]
  node_question_catalog["Analysis questions<br/>[bot.py]"]
  node_file_handler["File submission<br/>[bot.py]"]
  node_data_analysis["Data analysis<br/>[bot.py]"]
  node_pdf_report["PDF report<br/>[bot.py]"]
end

subgraph group_runtime["Bot runtime"]
  node_bot["Bot application<br/>[bot.py]"]
end

node_client(("Telegram client"))
node_telegram(("Telegram platform"))
node_admin(("Administrator"))
node_groq(("Groq API"))

node_client -->|"sends requests"| node_telegram
node_telegram -->|"routes updates"| node_bot
node_bot -->|"starts registration"| node_language
node_language -->|"selects language"| node_registration_flow
node_registration_flow -->|"collects details"| node_phone_screen
node_phone_screen -->|"checks blocked phone"| node_client_store
node_client -->|"chooses question"| node_question_catalog
node_question_catalog -->|"prompts for file"| node_file_handler
node_client -->|"submits Excel or CSV"| node_file_handler
node_file_handler -->|"checks activation"| node_client_store
node_file_handler -.->|"analyzes file"| node_data_analysis
node_data_analysis -.->|"requests analysis"| node_groq
node_file_handler -->|"generates report"| node_pdf_report
node_pdf_report -->|"sends PDF"| node_client
node_admin -->|"activates clients"| node_activation
node_activation -.->|"updates access"| node_client_store
node_admin -->|"requests client stats"| node_admin_reports
node_admin_reports -.->|"reads client data"| node_client_store

click node_bot "https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py"
click node_language "https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py"
click node_registration_flow "https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py"
click node_phone_screen "https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py"
click node_question_catalog "https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py"
click node_file_handler "https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py"
click node_data_analysis "https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py"
click node_pdf_report "https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py"
click node_client_store "https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py"
click node_activation "https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py"
click node_admin_reports "https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py"

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_language,node_registration_flow,node_phone_screen,node_client toneBlue
class node_client_store,node_activation,node_admin_reports toneAmber
class node_question_catalog,node_file_handler,node_data_analysis,node_pdf_report,node_groq toneMint
class node_bot toneRose
class node_telegram,node_admin toneIndigo
```

## Components

### Client onboarding

- [Language selection](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py): `bot.py`
- [Client registration](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py): `bot.py`
- [Phone and service checks](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py): `bot.py`

### Access and administration

- [Client database](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py): `bot.py`
- [Activation controls](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py): `bot.py`
- [Admin reporting](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py): `bot.py`

### Analysis and reporting

- [Analysis questions](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py): `bot.py`
- [File submission](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py): `bot.py`
- [Data analysis](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py): `bot.py`
- [PDF report](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py): `bot.py`

### Bot runtime

- [Bot application](https://github.com/zhaketabin/dataanalizbotuz/blob/main/bot.py): `bot.py`

### Other components

- **Telegram client**
- **Telegram platform**
- **Administrator**
- **Groq API**

## Connections

- Telegram client → Telegram platform: sends requests (evidence: `README.md`)
- Telegram platform → Bot application: routes updates (evidence: `bot.py`)
- Bot application → Language selection: starts registration (evidence: `bot.py`)
- Language selection → Client registration: selects language (evidence: `README.md`)
- Client registration → Phone and service checks: collects details (evidence: `bot.py`)
- Phone and service checks → Client database: checks blocked phone (evidence: `bot.py`)
- Telegram client → Analysis questions: chooses question (evidence: `README.md`)
- Analysis questions → File submission: prompts for file (evidence: `bot.py`)
- Telegram client → File submission: submits Excel or CSV (evidence: `README.md`)
- File submission → Client database: checks activation (evidence: `bot.py`)
- File submission → Data analysis: analyzes file (evidence: `bot.py`)
- Data analysis → Groq API: requests analysis
- File submission → PDF report: generates report (evidence: `bot.py`)
- PDF report → Telegram client: sends PDF (evidence: `bot.py`)
- Administrator → Activation controls: activates clients (evidence: `README.md`)
- Activation controls → Client database: updates access (evidence: `bot.py`)
- Administrator → Admin reporting: requests client stats (evidence: `README.md`)
- Admin reporting → Client database: reads client data (evidence: `bot.py`)
