# moudut13/apexdm architecture

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

- Interactive diagram: https://gitdiagram.com/moudut13/apexdm
- Repository: https://github.com/moudut13/apexdm

## Overview

ApexDM is a Windows desktop download manager. The main workflow is entering a URL in the app, choosing media options, and tracking download progress; YouTube extraction is handled by yt-dlp, while download history is stored in SQLite. The README also describes clipboard-triggered quick downloads, direct-file downloads, and theme selection. Those capabilities are represented, but the relevant main.py sections were not excerpted, so their internal wiring is not asserted. The standalone downloader’s connection to the UI is likewise not established by the available evidence.

Main entry points: [`main.py`](https://github.com/moudut13/apexdm/blob/main/main.py) (ApexDM app), [`youtube_handler.py`](https://github.com/moudut13/apexdm/blob/main/youtube_handler.py) (YouTube handler), [`downloader.py`](https://github.com/moudut13/apexdm/blob/main/downloader.py) (Multi-thread downloader), [`database.py`](https://github.com/moudut13/apexdm/blob/main/database.py) (SQLite history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_app["ApexDM app<br/>[main.py]"]
  node_url_entry["URL entry<br/>[main.py]"]
  node_quick_popup["Quick download popup<br/>[main.py]"]
  node_progress_ui["Progress display<br/>[main.py]"]
end

subgraph group_media["Download handling"]
  node_youtube["YouTube handler<br/>[youtube_handler.py]"]
  node_direct_downloader["Multi-thread downloader<br/>[downloader.py]"]
  node_download_files["Downloaded files"]
end

subgraph group_history["Download history"]
  node_history_ui["History view<br/>[main.py]"]
  node_history_db[("SQLite history<br/>[database.py]")]
end

subgraph group_settings["User preferences"]
  node_theme_settings["Theme settings<br/>[main.py]"]
end

node_user(("Desktop user"))
node_clipboard["System clipboard"]
node_yt_dlp["yt-dlp service"]
node_file_host["File host"]

node_user -->|"uses"| node_app
node_user -->|"enters URL"| node_url_entry
node_url_entry -->|"opens options"| node_quick_popup
node_clipboard -->|"triggers"| node_quick_popup
node_quick_popup -.->|"configures download"| node_youtube
node_app -->|"uses handler"| node_youtube
node_youtube -->|"extracts media"| node_yt_dlp
node_youtube -->|"writes media"| node_download_files
node_youtube -.->|"reports progress"| node_progress_ui
node_app -.->|"supports direct downloads"| node_direct_downloader
node_direct_downloader -->|"requests file"| node_file_host
node_direct_downloader -->|"writes file"| node_download_files
node_app -->|"displays history"| node_history_ui
node_history_ui -->|"reads records"| node_history_db
node_app -.->|"initializes history"| node_history_db
node_user -.->|"selects theme"| node_theme_settings

click node_app "https://github.com/moudut13/apexdm/blob/main/main.py"
click node_url_entry "https://github.com/moudut13/apexdm/blob/main/main.py"
click node_quick_popup "https://github.com/moudut13/apexdm/blob/main/main.py"
click node_progress_ui "https://github.com/moudut13/apexdm/blob/main/main.py"
click node_history_ui "https://github.com/moudut13/apexdm/blob/main/main.py"
click node_theme_settings "https://github.com/moudut13/apexdm/blob/main/main.py"
click node_youtube "https://github.com/moudut13/apexdm/blob/main/youtube_handler.py"
click node_direct_downloader "https://github.com/moudut13/apexdm/blob/main/downloader.py"
click node_history_db "https://github.com/moudut13/apexdm/blob/main/database.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_app,node_url_entry,node_quick_popup,node_progress_ui,node_user toneBlue
class node_youtube,node_direct_downloader,node_download_files toneAmber
class node_history_ui,node_history_db toneMint
class node_theme_settings toneRose
class node_clipboard,node_yt_dlp,node_file_host toneIndigo
```

## Components

### Desktop interface

- [ApexDM app](https://github.com/moudut13/apexdm/blob/main/main.py): `main.py`
- [URL entry](https://github.com/moudut13/apexdm/blob/main/main.py): `main.py`
- [Quick download popup](https://github.com/moudut13/apexdm/blob/main/main.py): `main.py`
- [Progress display](https://github.com/moudut13/apexdm/blob/main/main.py): `main.py`

### Download handling

- [YouTube handler](https://github.com/moudut13/apexdm/blob/main/youtube_handler.py): `youtube_handler.py`
- [Multi-thread downloader](https://github.com/moudut13/apexdm/blob/main/downloader.py): `downloader.py`
- **Downloaded files**

### Download history

- [History view](https://github.com/moudut13/apexdm/blob/main/main.py): `main.py`
- [SQLite history](https://github.com/moudut13/apexdm/blob/main/database.py): `database.py`

### User preferences

- [Theme settings](https://github.com/moudut13/apexdm/blob/main/main.py): `main.py`

### Other components

- **Desktop user**
- **System clipboard**
- **yt-dlp service**
- **File host**

## Connections

- Desktop user → ApexDM app: uses (evidence: `README.md`)
- Desktop user → URL entry: enters URL (evidence: `README.md`)
- URL entry → Quick download popup: opens options (evidence: `README.md`)
- System clipboard → Quick download popup: triggers (evidence: `README.md`)
- Quick download popup → YouTube handler: configures download (evidence: `main.py`)
- ApexDM app → YouTube handler: uses handler (evidence: `main.py`)
- YouTube handler → yt-dlp service: extracts media (evidence: `youtube_handler.py`)
- YouTube handler → Downloaded files: writes media (evidence: `youtube_handler.py`)
- YouTube handler → Progress display: reports progress (evidence: `main.py`)
- ApexDM app → Multi-thread downloader: supports direct downloads (evidence: `README.md`)
- Multi-thread downloader → File host: requests file (evidence: `downloader.py`)
- Multi-thread downloader → Downloaded files: writes file (evidence: `downloader.py`)
- ApexDM app → History view: displays history (evidence: `main.py`)
- History view → SQLite history: reads records (evidence: `main.py`)
- ApexDM app → SQLite history: initializes history (evidence: `main.py`)
- Desktop user → Theme settings: selects theme (evidence: `README.md`)
