# devilxd/twitchdropsminer architecture

> Architecture diagram of the GitHub repository devilxd/twitchdropsminer, 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/devilxd/twitchdropsminer
- Repository: https://github.com/devilxd/twitchdropsminer

## Overview

Twitch Drops Miner is a desktop app that advances Twitch drop progress without downloading stream media. The user logs in, selects prioritized games, reloads eligible campaigns and streams, and the miner watches a suitable channel, tracks progress, and claims rewards. Its principal runtime centers on Twitch orchestration, campaign/drop state, channel selection, and the GUI; websocket updates maintain stream status. The README documents the user workflow and capabilities, while sampled excerpts show selected internal calls. Some subsystem wiring is unsampled, so uncertain links are omitted.

Main entry points: [`twitch.py`](https://github.com/devilxd/twitchdropsminer/blob/master/twitch.py) (Twitch orchestrator), [`gui.py`](https://github.com/devilxd/twitchdropsminer/blob/master/gui.py) (Desktop GUI), [`websocket.py`](https://github.com/devilxd/twitchdropsminer/blob/master/websocket.py) (Stream event pool), [`settings.py`](https://github.com/devilxd/twitchdropsminer/blob/master/settings.py) (Miner settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and UI"]
  node_entry["Application entry<br/>[main.py]"]
  node_gui["Desktop GUI<br/>[gui.py]"]
  node_translations["Translations<br/>[translate.py]"]
  node_registry["Autostart integration<br/>[registry.py]"]
end

subgraph group_mining["Mining Domain"]
  node_channel["Channel and stream<br/>[channel.py]"]
  node_inventory["Campaigns and drops<br/>[inventory.py]"]
end

subgraph group_twitch["Twitch Connectivity"]
  node_twitchclient["Twitch orchestrator<br/>[twitch.py]"]
  node_websockets["Stream event pool<br/>[websocket.py]"]
end

subgraph group_state["Local State"]
  node_settings["Miner settings<br/>[settings.py]"]
  node_cache[("Image cache<br/>[cache.py]")]
  node_utilities["Runtime utilities<br/>[utils.py]"]
  node_exceptions["Runtime errors<br/>[exceptions.py]"]
end

node_user(("Miner user"))
node_twitchservice(("Twitch service"))

node_user -->|"logs in"| node_gui
node_gui -->|"starts mining"| node_twitchclient
node_entry -->|"runs client"| node_twitchclient
node_entry -->|"loads settings"| node_settings
node_gui -->|"configures"| node_settings
node_twitchclient -->|"sends watch"| node_channel
node_channel -->|"requests data"| node_twitchclient
node_twitchclient -->|"updates progress"| node_gui
node_twitchclient -.->|"manages drops"| node_inventory
node_inventory -->|"claims rewards"| node_twitchclient
node_twitchclient -.->|"tracks stream status"| node_websockets
node_websockets -.->|"dispatches events"| node_twitchclient
node_twitchclient -->|"fetches metadata"| node_twitchservice
node_websockets -->|"receives events"| node_twitchservice
node_gui -.->|"loads images"| node_cache
node_gui -->|"displays text"| node_translations
node_gui -.->|"controls autostart"| node_registry
node_settings -->|"reads and saves"| node_utilities
node_twitchclient -->|"raises errors"| node_exceptions

click node_entry "https://github.com/devilxd/twitchdropsminer/blob/master/main.py"
click node_gui "https://github.com/devilxd/twitchdropsminer/blob/master/gui.py"
click node_settings "https://github.com/devilxd/twitchdropsminer/blob/master/settings.py"
click node_twitchclient "https://github.com/devilxd/twitchdropsminer/blob/master/twitch.py"
click node_channel "https://github.com/devilxd/twitchdropsminer/blob/master/channel.py"
click node_inventory "https://github.com/devilxd/twitchdropsminer/blob/master/inventory.py"
click node_websockets "https://github.com/devilxd/twitchdropsminer/blob/master/websocket.py"
click node_cache "https://github.com/devilxd/twitchdropsminer/blob/master/cache.py"
click node_translations "https://github.com/devilxd/twitchdropsminer/blob/master/translate.py"
click node_registry "https://github.com/devilxd/twitchdropsminer/blob/master/registry.py"
click node_utilities "https://github.com/devilxd/twitchdropsminer/blob/master/utils.py"
click node_exceptions "https://github.com/devilxd/twitchdropsminer/blob/master/exceptions.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_entry,node_gui,node_translations,node_registry,node_user toneBlue
class node_channel,node_inventory toneAmber
class node_twitchclient,node_websockets toneMint
class node_settings,node_cache,node_utilities,node_exceptions toneRose
class node_twitchservice toneIndigo
```

## Components

### Application and UI

- [Application entry](https://github.com/devilxd/twitchdropsminer/blob/master/main.py): `main.py`
- [Desktop GUI](https://github.com/devilxd/twitchdropsminer/blob/master/gui.py): `gui.py`
- [Translations](https://github.com/devilxd/twitchdropsminer/blob/master/translate.py): `translate.py`
- [Autostart integration](https://github.com/devilxd/twitchdropsminer/blob/master/registry.py): `registry.py`

### Mining Domain

- [Channel and stream](https://github.com/devilxd/twitchdropsminer/blob/master/channel.py): `channel.py`
- [Campaigns and drops](https://github.com/devilxd/twitchdropsminer/blob/master/inventory.py): `inventory.py`

### Twitch Connectivity

- [Twitch orchestrator](https://github.com/devilxd/twitchdropsminer/blob/master/twitch.py): `twitch.py`
- [Stream event pool](https://github.com/devilxd/twitchdropsminer/blob/master/websocket.py): `websocket.py`

### Local State

- [Miner settings](https://github.com/devilxd/twitchdropsminer/blob/master/settings.py): `settings.py`
- [Image cache](https://github.com/devilxd/twitchdropsminer/blob/master/cache.py): `cache.py`
- [Runtime utilities](https://github.com/devilxd/twitchdropsminer/blob/master/utils.py): `utils.py`
- [Runtime errors](https://github.com/devilxd/twitchdropsminer/blob/master/exceptions.py): `exceptions.py`

### Other components

- **Miner user**
- **Twitch service**

## Connections

- Miner user → Desktop GUI: logs in (evidence: `README.md`)
- Desktop GUI → Twitch orchestrator: starts mining (evidence: `README.md`)
- Application entry → Twitch orchestrator: runs client (evidence: `main.py`)
- Application entry → Miner settings: loads settings (evidence: `main.py`)
- Desktop GUI → Miner settings: configures (evidence: `gui.py`)
- Twitch orchestrator → Channel and stream: sends watch (evidence: `twitch.py`)
- Channel and stream → Twitch orchestrator: requests data (evidence: `channel.py`)
- Twitch orchestrator → Desktop GUI: updates progress (evidence: `twitch.py`)
- Twitch orchestrator → Campaigns and drops: manages drops (evidence: `twitch.py`)
- Campaigns and drops → Twitch orchestrator: claims rewards (evidence: `inventory.py`)
- Twitch orchestrator → Stream event pool: tracks stream status (evidence: `twitch.py`)
- Stream event pool → Twitch orchestrator: dispatches events (evidence: `websocket.py`)
- Twitch orchestrator → Twitch service: fetches metadata (evidence: `README.md`)
- Stream event pool → Twitch service: receives events (evidence: `README.md`)
- Desktop GUI → Image cache: loads images (evidence: `gui.py`)
- Desktop GUI → Translations: displays text (evidence: `gui.py`)
- Desktop GUI → Autostart integration: controls autostart (evidence: `gui.py`)
- Miner settings → Runtime utilities: reads and saves (evidence: `settings.py`)
- Twitch orchestrator → Runtime errors: raises errors (evidence: `twitch.py`)
