# clowdyyy/pc-control architecture

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

- Interactive diagram: https://gitdiagram.com/clowdyyy/pc-control
- Repository: https://github.com/clowdyyy/pc-control

## Overview

PC Control is an administrator-only Telegram bot for monitoring and remotely controlling a Windows PC. The workflow starts at `main.py`, which registers handler routers and polls Telegram; an administrator’s request is dispatched to a feature handler, which reads system state or performs a local action, then replies through Telegram. The README also documents sleep/shutdown and other controls whose detailed handler implementations are present in the tree but were not sampled. Edges follow sampled calls or explicit README claims; unsampled relationships are omitted.

Main entry points: [`handlers/__init__.py`](https://github.com/clowdyyy/pc-control/blob/main/handlers/__init__.py) (Handler registration), [`config.py`](https://github.com/clowdyyy/pc-control/blob/main/config.py) (Bot configuration), [`main.py`](https://github.com/clowdyyy/pc-control/blob/main/main.py) (Polling entry), [`handlers/media.py`](https://github.com/clowdyyy/pc-control/blob/main/handlers/media.py) (Media controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Bot entry"]
  node_config["Bot configuration<br/>[config.py]"]
  node_main["Polling entry<br/>[main.py]"]
  node_routing["Handler registration<br/>[__init__.py]"]
end

subgraph group_monitor["System monitoring"]
  node_status["Status and system info<br/>[system.py]"]
  node_systeminfo["System metrics<br/>[system_info.py]"]
  node_processes["Process management<br/>[processes.py]"]
end

subgraph group_control["Device controls"]
  node_clipboard["Clipboard<br/>[clipboard.py]"]
  node_media["Media controls<br/>[media.py]"]
  node_power["Sleep and shutdown<br/>[power.py]"]
  node_workmode["Work mode<br/>[workmode.py]"]
end

subgraph group_capture["Media capture"]
  node_screenshot["Screen capture<br/>[screenshot.py]"]
  node_webcam["Webcam capture<br/>[webcam.py]"]
end

subgraph group_interaction["User interaction"]
  node_keyboards["Bot keyboards<br/>[keyboards.py]"]
  node_tts["Text to speech<br/>[tts.py]"]
  node_start["Start command<br/>[start.py]"]
end

node_admin(("Administrator"))
node_telegram(("Telegram"))

node_main -->|"loads settings"| node_config
node_main -->|"sends startup keyboard"| node_keyboards
node_main -->|"registers routers"| node_routing
node_main -->|"starts monitor"| node_media
node_main -->|"polls updates"| node_telegram
node_admin -.->|"sends commands"| node_telegram
node_telegram -->|"delivers updates"| node_main
node_routing -->|"registers"| node_start
node_routing -->|"registers"| node_status
node_routing -->|"registers"| node_clipboard
node_routing -->|"registers"| node_media
node_routing -->|"registers"| node_processes
node_routing -->|"registers"| node_power
node_routing -->|"registers"| node_screenshot
node_routing -->|"registers"| node_tts
node_routing -->|"registers"| node_webcam
node_routing -->|"registers"| node_workmode
node_status -->|"checks admin"| node_config
node_status -->|"reads metrics"| node_systeminfo
node_processes -->|"checks admin"| node_config
node_clipboard -->|"checks admin"| node_config
node_media -->|"checks admin"| node_config
node_media -->|"builds controls"| node_keyboards
node_media -->|"updates panel"| node_telegram
node_power -->|"checks admin"| node_config
node_workmode -->|"checks admin"| node_config
node_screenshot -->|"checks admin"| node_config
node_webcam -->|"checks admin"| node_config
node_tts -->|"checks admin"| node_config
node_start -->|"checks admin"| node_config
node_start -->|"builds menu"| node_keyboards
node_admin -.->|"receives results"| node_telegram

click node_config "https://github.com/clowdyyy/pc-control/blob/main/config.py"
click node_main "https://github.com/clowdyyy/pc-control/blob/main/main.py"
click node_routing "https://github.com/clowdyyy/pc-control/blob/main/handlers/__init__.py"
click node_keyboards "https://github.com/clowdyyy/pc-control/blob/main/keyboards.py"
click node_status "https://github.com/clowdyyy/pc-control/blob/main/handlers/system.py"
click node_systeminfo "https://github.com/clowdyyy/pc-control/blob/main/utils/system_info.py"
click node_processes "https://github.com/clowdyyy/pc-control/blob/main/handlers/processes.py"
click node_clipboard "https://github.com/clowdyyy/pc-control/blob/main/handlers/clipboard.py"
click node_media "https://github.com/clowdyyy/pc-control/blob/main/handlers/media.py"
click node_power "https://github.com/clowdyyy/pc-control/blob/main/handlers/power.py"
click node_workmode "https://github.com/clowdyyy/pc-control/blob/main/handlers/workmode.py"
click node_screenshot "https://github.com/clowdyyy/pc-control/blob/main/handlers/screenshot.py"
click node_webcam "https://github.com/clowdyyy/pc-control/blob/main/handlers/webcam.py"
click node_tts "https://github.com/clowdyyy/pc-control/blob/main/handlers/tts.py"
click node_start "https://github.com/clowdyyy/pc-control/blob/main/handlers/start.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_config,node_main,node_routing toneBlue
class node_status,node_systeminfo,node_processes toneAmber
class node_clipboard,node_media,node_power,node_workmode toneMint
class node_screenshot,node_webcam toneRose
class node_keyboards,node_tts,node_start,node_admin,node_telegram toneIndigo
```

## Components

### Bot entry

- [Bot configuration](https://github.com/clowdyyy/pc-control/blob/main/config.py): `config.py`
- [Polling entry](https://github.com/clowdyyy/pc-control/blob/main/main.py): `main.py`
- [Handler registration](https://github.com/clowdyyy/pc-control/blob/main/handlers/__init__.py): `handlers/__init__.py`

### System monitoring

- [Status and system info](https://github.com/clowdyyy/pc-control/blob/main/handlers/system.py): `handlers/system.py`
- [System metrics](https://github.com/clowdyyy/pc-control/blob/main/utils/system_info.py): `utils/system_info.py`
- [Process management](https://github.com/clowdyyy/pc-control/blob/main/handlers/processes.py): `handlers/processes.py`

### Device controls

- [Clipboard](https://github.com/clowdyyy/pc-control/blob/main/handlers/clipboard.py): `handlers/clipboard.py`
- [Media controls](https://github.com/clowdyyy/pc-control/blob/main/handlers/media.py): `handlers/media.py`
- [Sleep and shutdown](https://github.com/clowdyyy/pc-control/blob/main/handlers/power.py): `handlers/power.py`
- [Work mode](https://github.com/clowdyyy/pc-control/blob/main/handlers/workmode.py): `handlers/workmode.py`

### Media capture

- [Screen capture](https://github.com/clowdyyy/pc-control/blob/main/handlers/screenshot.py): `handlers/screenshot.py`
- [Webcam capture](https://github.com/clowdyyy/pc-control/blob/main/handlers/webcam.py): `handlers/webcam.py`

### User interaction

- [Bot keyboards](https://github.com/clowdyyy/pc-control/blob/main/keyboards.py): `keyboards.py`
- [Text to speech](https://github.com/clowdyyy/pc-control/blob/main/handlers/tts.py): `handlers/tts.py`
- [Start command](https://github.com/clowdyyy/pc-control/blob/main/handlers/start.py): `handlers/start.py`

### Other components

- **Administrator**
- **Telegram**

## Connections

- Polling entry → Bot configuration: loads settings (evidence: `main.py`)
- Polling entry → Bot keyboards: sends startup keyboard (evidence: `main.py`)
- Polling entry → Handler registration: registers routers (evidence: `main.py`)
- Polling entry → Media controls: starts monitor (evidence: `main.py`)
- Polling entry → Telegram: polls updates (evidence: `main.py`)
- Administrator → Telegram: sends commands (evidence: `README.md`)
- Telegram → Polling entry: delivers updates (evidence: `main.py`)
- Handler registration → Start command: registers (evidence: `handlers/__init__.py`)
- Handler registration → Status and system info: registers (evidence: `handlers/__init__.py`)
- Handler registration → Clipboard: registers (evidence: `handlers/__init__.py`)
- Handler registration → Media controls: registers (evidence: `handlers/__init__.py`)
- Handler registration → Process management: registers (evidence: `handlers/__init__.py`)
- Handler registration → Sleep and shutdown: registers (evidence: `handlers/__init__.py`)
- Handler registration → Screen capture: registers (evidence: `handlers/__init__.py`)
- Handler registration → Text to speech: registers (evidence: `handlers/__init__.py`)
- Handler registration → Webcam capture: registers (evidence: `handlers/__init__.py`)
- Handler registration → Work mode: registers (evidence: `handlers/__init__.py`)
- Status and system info → Bot configuration: checks admin (evidence: `handlers/system.py`)
- Status and system info → System metrics: reads metrics (evidence: `handlers/system.py`)
- Process management → Bot configuration: checks admin (evidence: `handlers/processes.py`)
- Clipboard → Bot configuration: checks admin (evidence: `handlers/clipboard.py`)
- Media controls → Bot configuration: checks admin (evidence: `handlers/media.py`)
- Media controls → Bot keyboards: builds controls (evidence: `handlers/media.py`)
- Media controls → Telegram: updates panel (evidence: `handlers/media.py`)
- Sleep and shutdown → Bot configuration: checks admin (evidence: `handlers/power.py`)
- Work mode → Bot configuration: checks admin (evidence: `handlers/workmode.py`)
- Screen capture → Bot configuration: checks admin (evidence: `handlers/screenshot.py`)
- Webcam capture → Bot configuration: checks admin (evidence: `handlers/webcam.py`)
- Text to speech → Bot configuration: checks admin (evidence: `handlers/tts.py`)
- Start command → Bot configuration: checks admin (evidence: `handlers/start.py`)
- Start command → Bot keyboards: builds menu (evidence: `handlers/start.py`)
- Administrator → Telegram: receives results (evidence: `README.md`)
