# khalid635/dovira architecture

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

- Interactive diagram: https://gitdiagram.com/khalid635/dovira
- Repository: https://github.com/khalid635/dovira

## Overview

DOVIRA is a cross-platform desktop download manager. The main workflow is choosing a URL and download options in the renderer, sending the request through Electron’s bridge to the main process, and having the queue route work to aria2 or yt-dlp while recording download state in SQLite. The README also documents browser-extension capture, page grabbing, scheduling, history, updates, and smart organization features. Some subsystem links are based on README statements because their implementation files were not sampled.

Main entry points: [`src/main/queue.ts`](https://github.com/khalid635/dovira/blob/main/src/main/queue.ts) (Download queue), [`src/main/ipc.ts`](https://github.com/khalid635/dovira/blob/main/src/main/ipc.ts) (IPC handlers), [`src/main/index.ts`](https://github.com/khalid635/dovira/blob/main/src/main/index.ts) (App runtime), [`src/renderer/src/App.tsx`](https://github.com/khalid635/dovira/blob/main/src/renderer/src/App.tsx) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["App shell<br/>[App.tsx]"]
  node_add["Add dialog"]
  node_store["UI state<br/>[store.ts]"]
  node_history["History view<br/>[HistoryPage.tsx]"]
end

subgraph group_runtime["Download runtime"]
  node_preload["IPC bridge<br/>[index.ts]"]
  node_main["App runtime<br/>[index.ts]"]
  node_ipc["IPC handlers<br/>[ipc.ts]"]
  node_queue["Download queue<br/>[queue.ts]"]
  node_aria2["aria2 engine<br/>[aria2.ts]"]
  node_ytdlp["yt-dlp engine<br/>[ytdlp.ts]"]
  node_db[("SQLite history<br/>[db.ts]")]
  node_settings["Settings<br/>[settings.ts]"]
end

subgraph group_features["Product features"]
  node_grabber["Site grabber<br/>[grabber.ts]"]
  node_scheduler["Scheduler<br/>[scheduler.ts]"]
  node_smart["Smart processing"]
  node_assistant["AI assistant<br/>[assistant.ts]"]
  node_updater["App updates<br/>[updater.ts]"]
end

subgraph group_integrations["External integrations"]
  node_extension["Browser extension<br/>[background.ts]"]
  node_localapi["Local API<br/>[localApi.ts]"]
end

node_user(("User"))
node_browser(("Browser"))

node_user -->|"uses"| node_app
node_app -->|"opens"| node_add
node_add -->|"submits through"| node_store
node_store -.->|"invokes bridge"| node_preload
node_preload -.->|"dispatches IPC"| node_ipc
node_main -->|"registers handlers"| node_ipc
node_ipc -->|"controls downloads"| node_queue
node_main -->|"creates"| node_queue
node_queue -->|"runs transfers"| node_aria2
node_queue -->|"runs media jobs"| node_ytdlp
node_queue -->|"persists state"| node_db
node_queue -->|"reads options"| node_settings
node_app -->|"shows history"| node_history
node_ipc -->|"reads history"| node_db
node_ipc -->|"routes scans"| node_grabber
node_main -->|"starts scheduler"| node_scheduler
node_scheduler -->|"enqueues scheduled"| node_queue
node_queue -->|"applies rules"| node_smart
node_queue -->|"builds model prompt"| node_assistant
node_app -.->|"offers assistant"| node_assistant
node_main -->|"initializes updates"| node_updater
node_browser -->|"captures links"| node_extension
node_extension -->|"sends authenticated requests"| node_localapi
node_localapi -->|"adds downloads"| node_queue

click node_app "https://github.com/khalid635/dovira/blob/main/src/renderer/src/App.tsx"
click node_add "https://github.com/khalid635/dovira/blob/main/src/renderer/src/components/AddDownloadDialog.tsx"
click node_store "https://github.com/khalid635/dovira/blob/main/src/renderer/src/store.ts"
click node_preload "https://github.com/khalid635/dovira/blob/main/src/preload/index.ts"
click node_main "https://github.com/khalid635/dovira/blob/main/src/main/index.ts"
click node_ipc "https://github.com/khalid635/dovira/blob/main/src/main/ipc.ts"
click node_queue "https://github.com/khalid635/dovira/blob/main/src/main/queue.ts"
click node_aria2 "https://github.com/khalid635/dovira/blob/main/src/main/engines/aria2.ts"
click node_ytdlp "https://github.com/khalid635/dovira/blob/main/src/main/engines/ytdlp.ts"
click node_db "https://github.com/khalid635/dovira/blob/main/src/main/db.ts"
click node_settings "https://github.com/khalid635/dovira/blob/main/src/main/settings.ts"
click node_history "https://github.com/khalid635/dovira/blob/main/src/renderer/src/components/HistoryPage.tsx"
click node_grabber "https://github.com/khalid635/dovira/blob/main/src/main/grabber.ts"
click node_scheduler "https://github.com/khalid635/dovira/blob/main/src/main/scheduler.ts"
click node_smart "https://github.com/khalid635/dovira/tree/main/src/main/smart"
click node_assistant "https://github.com/khalid635/dovira/blob/main/src/main/smart/assistant.ts"
click node_updater "https://github.com/khalid635/dovira/blob/main/src/main/updater.ts"
click node_extension "https://github.com/khalid635/dovira/blob/main/extension/src/background.ts"
click node_localapi "https://github.com/khalid635/dovira/blob/main/src/main/localApi.ts"

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_add,node_store,node_history,node_user,node_browser toneBlue
class node_preload,node_main,node_ipc,node_queue,node_aria2,node_ytdlp,node_db,node_settings toneAmber
class node_grabber,node_scheduler,node_smart,node_assistant,node_updater toneMint
class node_extension,node_localapi toneRose
```

## Components

### Desktop interface

- [App shell](https://github.com/khalid635/dovira/blob/main/src/renderer/src/App.tsx): `src/renderer/src/App.tsx`
- [Add dialog](https://github.com/khalid635/dovira/blob/main/src/renderer/src/components/AddDownloadDialog.tsx): `src/renderer/src/components/AddDownloadDialog.tsx`
- [UI state](https://github.com/khalid635/dovira/blob/main/src/renderer/src/store.ts): `src/renderer/src/store.ts`
- [History view](https://github.com/khalid635/dovira/blob/main/src/renderer/src/components/HistoryPage.tsx): `src/renderer/src/components/HistoryPage.tsx`

### Download runtime

- [IPC bridge](https://github.com/khalid635/dovira/blob/main/src/preload/index.ts): `src/preload/index.ts`
- [App runtime](https://github.com/khalid635/dovira/blob/main/src/main/index.ts): `src/main/index.ts`
- [IPC handlers](https://github.com/khalid635/dovira/blob/main/src/main/ipc.ts): `src/main/ipc.ts`
- [Download queue](https://github.com/khalid635/dovira/blob/main/src/main/queue.ts): `src/main/queue.ts`
- [aria2 engine](https://github.com/khalid635/dovira/blob/main/src/main/engines/aria2.ts): `src/main/engines/aria2.ts`
- [yt-dlp engine](https://github.com/khalid635/dovira/blob/main/src/main/engines/ytdlp.ts): `src/main/engines/ytdlp.ts`
- [SQLite history](https://github.com/khalid635/dovira/blob/main/src/main/db.ts): `src/main/db.ts`
- [Settings](https://github.com/khalid635/dovira/blob/main/src/main/settings.ts): `src/main/settings.ts`

### Product features

- [Site grabber](https://github.com/khalid635/dovira/blob/main/src/main/grabber.ts): `src/main/grabber.ts`
- [Scheduler](https://github.com/khalid635/dovira/blob/main/src/main/scheduler.ts): `src/main/scheduler.ts`
- [Smart processing](https://github.com/khalid635/dovira/tree/main/src/main/smart): `src/main/smart`
- [AI assistant](https://github.com/khalid635/dovira/blob/main/src/main/smart/assistant.ts): `src/main/smart/assistant.ts`
- [App updates](https://github.com/khalid635/dovira/blob/main/src/main/updater.ts): `src/main/updater.ts`

### External integrations

- [Browser extension](https://github.com/khalid635/dovira/blob/main/extension/src/background.ts): `extension/src/background.ts`
- [Local API](https://github.com/khalid635/dovira/blob/main/src/main/localApi.ts): `src/main/localApi.ts`

### Other components

- **User**
- **Browser**

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → Add dialog: opens (evidence: `src/renderer/src/App.tsx`)
- Add dialog → UI state: submits through (evidence: `src/renderer/src/components/AddDownloadDialog.tsx`)
- UI state → IPC bridge: invokes bridge
- IPC bridge → IPC handlers: dispatches IPC
- App runtime → IPC handlers: registers handlers (evidence: `src/main/index.ts`)
- IPC handlers → Download queue: controls downloads (evidence: `src/main/ipc.ts`)
- App runtime → Download queue: creates (evidence: `src/main/index.ts`)
- Download queue → aria2 engine: runs transfers (evidence: `src/main/queue.ts`)
- Download queue → yt-dlp engine: runs media jobs (evidence: `src/main/queue.ts`)
- Download queue → SQLite history: persists state (evidence: `src/main/queue.ts`)
- Download queue → Settings: reads options (evidence: `src/main/queue.ts`)
- App shell → History view: shows history (evidence: `src/renderer/src/App.tsx`)
- IPC handlers → SQLite history: reads history (evidence: `src/main/ipc.ts`)
- IPC handlers → Site grabber: routes scans (evidence: `src/main/ipc.ts`)
- App runtime → Scheduler: starts scheduler (evidence: `src/main/index.ts`)
- Scheduler → Download queue: enqueues scheduled (evidence: `src/main/scheduler.ts`)
- Download queue → Smart processing: applies rules (evidence: `src/main/queue.ts`)
- Download queue → AI assistant: builds model prompt (evidence: `src/main/queue.ts`)
- App shell → AI assistant: offers assistant (evidence: `README.md`)
- App runtime → App updates: initializes updates (evidence: `src/main/index.ts`)
- Browser → Browser extension: captures links (evidence: `README.md`)
- Browser extension → Local API: sends authenticated requests (evidence: `README.md`)
- Local API → Download queue: adds downloads (evidence: `src/main/localApi.ts`)
