# jyoti-ranjan-rout/internet-complaint-bot architecture

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

- Interactive diagram: https://gitdiagram.com/jyoti-ranjan-rout/internet-complaint-bot
- Repository: https://github.com/jyoti-ranjan-rout/internet-complaint-bot

## Overview

Internet Complaint Bot is a small Python app that measures network speeds and, after three consecutive below-threshold results, drafts and emails an ISP complaint. `main.py` orchestrates the workflow; `internet.py` drives the browser-based speed test. The README documents environment-based credentials and the Gemini/Gmail integrations. A Twitter-login method exists in `internet.py`, but it is not part of the documented complaint workflow and is not invoked by the runner. The graph reflects the excerpts and README; other source behavior was not inspected.

Main entry points: [`main.py`](https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/main.py) (Workflow Runner), [`internet.py`](https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/internet.py) (Browser Speed Test), [`.env`](https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/.env) (Environment Credentials)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_monitoring["Speed Monitoring"]
  node_speedtest["Browser Speed Test<br/>[internet.py]"]
  node_verification["Threshold Verification<br/>[main.py]"]
  node_reports["Speed Reports<br/>[main.py]"]
end

subgraph group_complaint["Complaint Workflow"]
  node_runner["Workflow Runner<br/>[main.py]"]
  node_email_generation["Complaint Generation<br/>[main.py]"]
  node_email_delivery["Email Delivery<br/>[main.py]"]
end

subgraph group_integrations["External Services"]
  node_speed_service["Speedtest Website"]
  node_gemini["Gemini API"]
  node_gmail["Gmail SMTP"]
  node_credentials["Environment Credentials<br/>[.env]"]
end

node_user(("Operator"))

node_user -->|"starts"| node_runner
node_runner -->|"runs tests"| node_speedtest
node_speedtest -->|"measures speeds"| node_speed_service
node_runner -->|"checks thresholds"| node_verification
node_verification -->|"records results"| node_reports
node_verification -->|"triggers after three"| node_email_generation
node_email_generation -->|"requests draft"| node_gemini
node_gemini -->|"returns draft"| node_email_delivery
node_email_delivery -->|"sends complaint"| node_gmail
node_runner -->|"loads settings"| node_credentials
node_speedtest -->|"loads settings"| node_credentials

click node_runner "https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/main.py"
click node_speedtest "https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/internet.py"
click node_verification "https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/main.py"
click node_reports "https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/main.py"
click node_email_generation "https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/main.py"
click node_email_delivery "https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/main.py"
click node_credentials "https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/.env"

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_speedtest,node_verification,node_reports toneBlue
class node_runner,node_email_generation,node_email_delivery toneAmber
class node_speed_service,node_gemini,node_gmail,node_credentials toneMint
class node_user toneIndigo
```

## Components

### Speed Monitoring

- [Browser Speed Test](https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/internet.py): `internet.py`
- [Threshold Verification](https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/main.py): `main.py`
- [Speed Reports](https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/main.py): `main.py`

### Complaint Workflow

- [Workflow Runner](https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/main.py): `main.py`
- [Complaint Generation](https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/main.py): `main.py`
- [Email Delivery](https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/main.py): `main.py`

### External Services

- **Speedtest Website**
- **Gemini API**
- **Gmail SMTP**
- [Environment Credentials](https://github.com/jyoti-ranjan-rout/internet-complaint-bot/blob/main/.env): `.env`

### Other components

- **Operator**

## Connections

- Operator → Workflow Runner: starts (evidence: `README.md`)
- Workflow Runner → Browser Speed Test: runs tests (evidence: `main.py`)
- Browser Speed Test → Speedtest Website: measures speeds (evidence: `internet.py`)
- Workflow Runner → Threshold Verification: checks thresholds (evidence: `main.py`)
- Threshold Verification → Speed Reports: records results (evidence: `main.py`)
- Threshold Verification → Complaint Generation: triggers after three (evidence: `main.py`)
- Complaint Generation → Gemini API: requests draft (evidence: `main.py`)
- Gemini API → Email Delivery: returns draft (evidence: `main.py`)
- Email Delivery → Gmail SMTP: sends complaint (evidence: `main.py`)
- Workflow Runner → Environment Credentials: loads settings (evidence: `main.py`)
- Browser Speed Test → Environment Credentials: loads settings (evidence: `internet.py`)
