# billy1030/downloader architecture

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

- Interactive diagram: https://gitdiagram.com/billy1030/downloader
- Repository: https://github.com/billy1030/downloader

## Overview

Omnidrop is a cross-platform social-media downloader with both a Wails desktop UI and a CLI. Its main workflow is to inspect a submitted URL, let the user choose download options, enqueue work, and report progress and completed-file actions. The README documents platform extraction, authentication, settings, engine updates, and media playback. The sampled queue code confirms that the queue invokes the download engine; other backend wiring is not shown, so those relationships are left unverified rather than inferred.

Main entry points: [`app.go`](https://github.com/billy1030/downloader/blob/main/app.go) (Desktop app API), [`cmd/omnidrop-cli/main.go`](https://github.com/billy1030/downloader/blob/main/cmd/omnidrop-cli/main.go) (CLI), [`pkg/queue/manager.go`](https://github.com/billy1030/downloader/blob/main/pkg/queue/manager.go) (Download queue), [`pkg/engine/downloader.go`](https://github.com/billy1030/downloader/blob/main/pkg/engine/downloader.go) (Media download)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_renderer["React renderer<br/>[main.tsx]"]
  node_app_ui["Downloader UI<br/>[App.tsx]"]
  node_themes["Theme definitions<br/>[themes.ts]"]
  node_bridge["Wails bridge<br/>[wailsBridge.ts]"]
  node_bindings["Generated app bindings<br/>[App.js]"]
  node_runtime["Wails runtime<br/>[runtime.js]"]
end

subgraph group_backend["Application services"]
  node_app_api["Desktop app API<br/>[app.go]"]
  node_cli["CLI<br/>[main.go]"]
end

subgraph group_media["Media engine"]
  node_models["Media data models<br/>[models.go]"]
  node_detector["Binary detection<br/>[detector.go]"]
  node_platform["Platform detection<br/>[platform.go]"]
  node_inspector["URL inspection<br/>[inspector.go]"]
  node_formats["Format handling<br/>[formats.go]"]
  node_downloader["Media download<br/>[downloader.go]"]
  node_updater["Engine updater<br/>[updater.go]"]
  node_player["Media playback<br/>[player.go]"]
end

subgraph group_state["Settings and queue"]
  node_config["Settings store<br/>[settings.go]"]
  node_queue["Download queue<br/>[manager.go]"]
  node_task_types["Task and event types<br/>[types.go]"]
  node_reveal["File reveal<br/>[reveal.go]"]
end

node_user(("User"))
node_extractors["Social platforms"]
node_tools["yt-dlp and FFmpeg"]
node_node["Node.js"]

node_user -->|"uses"| node_renderer
node_renderer -->|"renders"| node_app_ui
node_app_ui -->|"calls"| node_bridge
node_app_ui -->|"uses"| node_themes
node_bridge -->|"invokes"| node_bindings
node_bridge -->|"uses"| node_runtime
node_bindings -.->|"dispatches to"| node_app_api
node_app_api -.->|"delegates to"| node_queue
node_app_api -.->|"delegates to"| node_inspector
node_app_api -.->|"reads settings"| node_config
node_cli -->|"detects tools"| node_detector
node_cli -->|"detects platform"| node_platform
node_cli -->|"inspects URL"| node_inspector
node_cli -->|"starts download"| node_downloader
node_cli -->|"reads cookies"| node_config
node_queue -->|"detects platform"| node_platform
node_queue -->|"runs download"| node_downloader
node_queue -.->|"manages tasks"| node_task_types
node_queue -->|"uses options and progress"| node_models
node_inspector -.->|"uses formats"| node_formats
node_downloader -.->|"uses"| node_tools
node_inspector -.->|"extracts metadata"| node_extractors
node_downloader -.->|"downloads from"| node_extractors
node_downloader -.->|"solves challenges with"| node_node
node_app_api -.->|"requests updates"| node_updater
node_app_api -.->|"requests playback"| node_player
node_app_api -.->|"requests file reveal"| node_reveal

click node_renderer "https://github.com/billy1030/downloader/blob/main/frontend/src/main.tsx"
click node_app_ui "https://github.com/billy1030/downloader/blob/main/frontend/src/App.tsx"
click node_themes "https://github.com/billy1030/downloader/blob/main/frontend/src/themes.ts"
click node_bridge "https://github.com/billy1030/downloader/blob/main/frontend/src/wailsBridge.ts"
click node_bindings "https://github.com/billy1030/downloader/blob/main/frontend/wailsjs/go/main/App.js"
click node_runtime "https://github.com/billy1030/downloader/blob/main/frontend/wailsjs/runtime/runtime.js"
click node_app_api "https://github.com/billy1030/downloader/blob/main/app.go"
click node_cli "https://github.com/billy1030/downloader/blob/main/cmd/omnidrop-cli/main.go"
click node_config "https://github.com/billy1030/downloader/blob/main/pkg/config/settings.go"
click node_queue "https://github.com/billy1030/downloader/blob/main/pkg/queue/manager.go"
click node_task_types "https://github.com/billy1030/downloader/blob/main/pkg/queue/types.go"
click node_models "https://github.com/billy1030/downloader/blob/main/pkg/models/models.go"
click node_detector "https://github.com/billy1030/downloader/blob/main/pkg/engine/detector.go"
click node_platform "https://github.com/billy1030/downloader/blob/main/pkg/engine/platform.go"
click node_inspector "https://github.com/billy1030/downloader/blob/main/pkg/engine/inspector.go"
click node_formats "https://github.com/billy1030/downloader/blob/main/pkg/engine/formats.go"
click node_downloader "https://github.com/billy1030/downloader/blob/main/pkg/engine/downloader.go"
click node_updater "https://github.com/billy1030/downloader/blob/main/pkg/engine/updater.go"
click node_player "https://github.com/billy1030/downloader/blob/main/pkg/engine/player.go"
click node_reveal "https://github.com/billy1030/downloader/blob/main/pkg/queue/reveal.go"

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_renderer,node_app_ui,node_themes,node_bridge,node_bindings,node_runtime,node_user toneBlue
class node_app_api,node_cli toneAmber
class node_models,node_detector,node_platform,node_inspector,node_formats,node_downloader,node_updater,node_player toneMint
class node_config,node_queue,node_task_types,node_reveal toneRose
class node_extractors,node_tools,node_node toneIndigo
```

## Components

### Desktop interface

- [React renderer](https://github.com/billy1030/downloader/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Downloader UI](https://github.com/billy1030/downloader/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Theme definitions](https://github.com/billy1030/downloader/blob/main/frontend/src/themes.ts): `frontend/src/themes.ts`
- [Wails bridge](https://github.com/billy1030/downloader/blob/main/frontend/src/wailsBridge.ts): `frontend/src/wailsBridge.ts`
- [Generated app bindings](https://github.com/billy1030/downloader/blob/main/frontend/wailsjs/go/main/App.js): `frontend/wailsjs/go/main/App.js`
- [Wails runtime](https://github.com/billy1030/downloader/blob/main/frontend/wailsjs/runtime/runtime.js): `frontend/wailsjs/runtime/runtime.js`

### Application services

- [Desktop app API](https://github.com/billy1030/downloader/blob/main/app.go): `app.go`
- [CLI](https://github.com/billy1030/downloader/blob/main/cmd/omnidrop-cli/main.go): `cmd/omnidrop-cli/main.go`

### Media engine

- [Media data models](https://github.com/billy1030/downloader/blob/main/pkg/models/models.go): `pkg/models/models.go`
- [Binary detection](https://github.com/billy1030/downloader/blob/main/pkg/engine/detector.go): `pkg/engine/detector.go`
- [Platform detection](https://github.com/billy1030/downloader/blob/main/pkg/engine/platform.go): `pkg/engine/platform.go`
- [URL inspection](https://github.com/billy1030/downloader/blob/main/pkg/engine/inspector.go): `pkg/engine/inspector.go`
- [Format handling](https://github.com/billy1030/downloader/blob/main/pkg/engine/formats.go): `pkg/engine/formats.go`
- [Media download](https://github.com/billy1030/downloader/blob/main/pkg/engine/downloader.go): `pkg/engine/downloader.go`
- [Engine updater](https://github.com/billy1030/downloader/blob/main/pkg/engine/updater.go): `pkg/engine/updater.go`
- [Media playback](https://github.com/billy1030/downloader/blob/main/pkg/engine/player.go): `pkg/engine/player.go`

### Settings and queue

- [Settings store](https://github.com/billy1030/downloader/blob/main/pkg/config/settings.go): `pkg/config/settings.go`
- [Download queue](https://github.com/billy1030/downloader/blob/main/pkg/queue/manager.go): `pkg/queue/manager.go`
- [Task and event types](https://github.com/billy1030/downloader/blob/main/pkg/queue/types.go): `pkg/queue/types.go`
- [File reveal](https://github.com/billy1030/downloader/blob/main/pkg/queue/reveal.go): `pkg/queue/reveal.go`

### Other components

- **User**
- **Social platforms**
- **yt-dlp and FFmpeg**
- **Node.js**

## Connections

- User → React renderer: uses (evidence: `README.md`)
- React renderer → Downloader UI: renders (evidence: `frontend/src/main.tsx`)
- Downloader UI → Wails bridge: calls (evidence: `frontend/src/App.tsx`)
- Downloader UI → Theme definitions: uses (evidence: `frontend/src/App.tsx`)
- Wails bridge → Generated app bindings: invokes (evidence: `frontend/src/wailsBridge.ts`)
- Wails bridge → Wails runtime: uses (evidence: `frontend/src/wailsBridge.ts`)
- Generated app bindings → Desktop app API: dispatches to
- Desktop app API → Download queue: delegates to
- Desktop app API → URL inspection: delegates to
- Desktop app API → Settings store: reads settings
- CLI → Binary detection: detects tools (evidence: `cmd/omnidrop-cli/main.go`)
- CLI → Platform detection: detects platform (evidence: `cmd/omnidrop-cli/main.go`)
- CLI → URL inspection: inspects URL (evidence: `cmd/omnidrop-cli/main.go`)
- CLI → Media download: starts download (evidence: `cmd/omnidrop-cli/main.go`)
- CLI → Settings store: reads cookies (evidence: `cmd/omnidrop-cli/main.go`)
- Download queue → Platform detection: detects platform (evidence: `pkg/queue/manager.go`)
- Download queue → Media download: runs download (evidence: `pkg/queue/manager.go`)
- Download queue → Task and event types: manages tasks
- Download queue → Media data models: uses options and progress (evidence: `pkg/queue/manager.go`)
- URL inspection → Format handling: uses formats
- Media download → yt-dlp and FFmpeg: uses
- URL inspection → Social platforms: extracts metadata
- Media download → Social platforms: downloads from
- Media download → Node.js: solves challenges with
- Desktop app API → Engine updater: requests updates
- Desktop app API → Media playback: requests playback
- Desktop app API → File reveal: requests file reveal
