# pt-plugins/pt-depiler architecture

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

- Interactive diagram: https://gitdiagram.com/pt-plugins/pt-depiler
- Repository: https://github.com/pt-plugins/pt-depiler

## Overview

PT-depiler is a Manifest V3 browser extension for streamlining private-tracker use. Users interact through tracker-page content controls or the options dashboard: search across configured sites, inspect and filter torrent results, then send selected torrents to a configured downloader; the extension also retains download history and user statistics. Separate capabilities cover tracker-specific parsing, user-data views, media-server integration, backup synchronization, and social-site information. The tree and sampled entry points support the main extension boundaries; some feature wiring is inferred only from README capabilities and route names, so uncertain call edges are omitted.

Main entry points: [`src/entries/background/main.ts`](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/background/main.ts) (Background entry), [`src/entries/offscreen/offscreen.ts`](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/offscreen.ts) (Offscreen runtime), [`src/entries/messages.ts`](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/messages.ts) (Extension messaging), [`src/entries/options/App.vue`](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/options/App.vue) (Options dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interfaces"]
  node_content["Tracker controls<br/>[App.vue]"]
  node_options["Options dashboard<br/>[App.vue]"]
  node_routes["Dashboard routes<br/>[router.ts]"]
  node_downloader_ui["Downloader controls<br/>[Index.vue]"]
  node_backup_ui["Backup settings<br/>[Index.vue]"]
end

subgraph group_background["Extension runtime"]
  node_background_main["Background entry<br/>[main.ts]"]
  node_context["Context menus<br/>[contextMenus.ts]"]
  node_omnibox["Address search<br/>[omnibox.ts]"]
  node_messages["Extension messaging<br/>[messages.ts]"]
  node_offscreen["Offscreen runtime<br/>[offscreen.ts]"]
end

subgraph group_tracker["Tracker features"]
  node_site_adapters["Tracker adapters"]
  node_search["Aggregated search<br/>[search.ts]"]
  node_user_info["User information<br/>[userInfo.ts]"]
  node_social["Social information"]
  node_recommendations["Recommendations"]
end

subgraph group_integrations["External integrations"]
  node_downloader["Downloader clients<br/>[index.ts]"]
  node_media["Media servers<br/>[index.ts]"]
  node_backup["Backup providers<br/>[index.ts]"]
end

subgraph group_state["Local data"]
  node_local_state[("Extension state<br/>[storage.ts]")]
  node_indexeddb[("IndexedDB adapter<br/>[indexdb.ts]")]
  node_history["Download history<br/>[site.ts]"]
  node_snapshots["Search snapshots<br/>[search.ts]"]
  node_keep_upload["Keep-upload tasks<br/>[keepUploadTask.ts]"]
end

node_user(("Extension user"))
node_tracker_sites(("PT sites"))
node_download_clients(("Download clients"))
node_backup_services(("Backup services"))
node_storage_api[("Browser storage")]

node_user -->|"uses on sites"| node_content
node_user -->|"opens dashboard"| node_options
node_options -->|"navigates"| node_routes
node_content -->|"sends commands"| node_messages
node_options -->|"requests client data"| node_messages
node_background_main -->|"registers handlers"| node_messages
node_background_main -->|"loads"| node_context
node_background_main -->|"loads"| node_omnibox
node_background_main -->|"loads bridge"| node_offscreen
node_search -->|"uses definitions"| node_site_adapters
node_site_adapters -->|"parses and queries"| node_tracker_sites
node_search -->|"stores snapshots"| node_snapshots
node_user_info -->|"collects tracker data"| node_site_adapters
node_social -->|"supports"| node_recommendations
node_downloader_ui -->|"requests status"| node_messages
node_downloader -->|"controls downloads"| node_download_clients
node_backup_ui -->|"configures and invokes"| node_backup
node_backup -->|"synchronizes data"| node_backup_services
node_media -.->|"integrates clients"| node_download_clients
node_offscreen -->|"uses adapter"| node_indexeddb
node_offscreen -->|"manages history"| node_history
node_offscreen -->|"manages tasks"| node_keep_upload
node_local_state -->|"reads and writes"| node_storage_api
node_background_main -->|"repairs user data"| node_local_state

click node_content "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/content-script/app/App.vue"
click node_options "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/options/App.vue"
click node_routes "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/options/plugins/router.ts"
click node_background_main "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/background/main.ts"
click node_context "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/background/utils/contextMenus.ts"
click node_omnibox "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/background/utils/omnibox.ts"
click node_messages "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/messages.ts"
click node_offscreen "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/offscreen.ts"
click node_site_adapters "https://github.com/pt-plugins/pt-depiler/tree/master/src/packages/site/definitions"
click node_search "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/search.ts"
click node_user_info "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/userInfo.ts"
click node_social "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/socialInformation.ts"
click node_recommendations "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/socialRecommendations.ts"
click node_downloader_ui "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/options/views/Overview/MyClient/Index.vue"
click node_downloader "https://github.com/pt-plugins/pt-depiler/blob/master/src/packages/downloader/index.ts"
click node_media "https://github.com/pt-plugins/pt-depiler/blob/master/src/packages/mediaServer/index.ts"
click node_backup_ui "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/options/views/Settings/SetBackup/Index.vue"
click node_backup "https://github.com/pt-plugins/pt-depiler/blob/master/src/packages/backupServer/index.ts"
click node_local_state "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/storage.ts"
click node_indexeddb "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/adapter/indexdb.ts"
click node_history "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/site.ts"
click node_snapshots "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/search.ts"
click node_keep_upload "https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/keepUploadTask.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_content,node_options,node_routes,node_downloader_ui,node_backup_ui,node_user,node_download_clients toneBlue
class node_background_main,node_context,node_omnibox,node_messages,node_offscreen,node_storage_api toneAmber
class node_site_adapters,node_search,node_user_info,node_social,node_recommendations toneMint
class node_downloader,node_media,node_backup toneRose
class node_local_state,node_indexeddb,node_history,node_snapshots,node_keep_upload,node_tracker_sites,node_backup_services toneIndigo
```

## Components

### User interfaces

- [Tracker controls](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/content-script/app/App.vue): `src/entries/content-script/app/App.vue`
- [Options dashboard](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/options/App.vue): `src/entries/options/App.vue`
- [Dashboard routes](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/options/plugins/router.ts): `src/entries/options/plugins/router.ts`
- [Downloader controls](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/options/views/Overview/MyClient/Index.vue): `src/entries/options/views/Overview/MyClient/Index.vue`
- [Backup settings](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/options/views/Settings/SetBackup/Index.vue): `src/entries/options/views/Settings/SetBackup/Index.vue`

### Extension runtime

- [Background entry](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/background/main.ts): `src/entries/background/main.ts`
- [Context menus](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/background/utils/contextMenus.ts): `src/entries/background/utils/contextMenus.ts`
- [Address search](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/background/utils/omnibox.ts): `src/entries/background/utils/omnibox.ts`
- [Extension messaging](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/messages.ts): `src/entries/messages.ts`
- [Offscreen runtime](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/offscreen.ts): `src/entries/offscreen/offscreen.ts`

### Tracker features

- [Tracker adapters](https://github.com/pt-plugins/pt-depiler/tree/master/src/packages/site/definitions): `src/packages/site/definitions`
- [Aggregated search](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/search.ts): `src/entries/offscreen/utils/search.ts`
- [User information](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/userInfo.ts): `src/entries/offscreen/utils/userInfo.ts`
- [Social information](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/socialInformation.ts): `src/entries/offscreen/utils/socialInformation.ts`
- [Recommendations](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/socialRecommendations.ts): `src/entries/offscreen/utils/socialRecommendations.ts`

### External integrations

- [Downloader clients](https://github.com/pt-plugins/pt-depiler/blob/master/src/packages/downloader/index.ts): `src/packages/downloader/index.ts`
- [Media servers](https://github.com/pt-plugins/pt-depiler/blob/master/src/packages/mediaServer/index.ts): `src/packages/mediaServer/index.ts`
- [Backup providers](https://github.com/pt-plugins/pt-depiler/blob/master/src/packages/backupServer/index.ts): `src/packages/backupServer/index.ts`

### Local data

- [Extension state](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/storage.ts): `src/entries/storage.ts`
- [IndexedDB adapter](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/adapter/indexdb.ts): `src/entries/offscreen/adapter/indexdb.ts`
- [Download history](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/site.ts): `src/entries/offscreen/utils/site.ts`
- [Search snapshots](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/search.ts): `src/entries/offscreen/utils/search.ts`
- [Keep-upload tasks](https://github.com/pt-plugins/pt-depiler/blob/master/src/entries/offscreen/utils/keepUploadTask.ts): `src/entries/offscreen/utils/keepUploadTask.ts`

### Other components

- **Extension user**
- **PT sites**
- **Download clients**
- **Backup services**
- **Browser storage**

## Connections

- Extension user → Tracker controls: uses on sites
- Extension user → Options dashboard: opens dashboard
- Options dashboard → Dashboard routes: navigates
- Tracker controls → Extension messaging: sends commands
- Options dashboard → Extension messaging: requests client data
- Background entry → Extension messaging: registers handlers
- Background entry → Context menus: loads
- Background entry → Address search: loads
- Background entry → Offscreen runtime: loads bridge
- Aggregated search → Tracker adapters: uses definitions
- Tracker adapters → PT sites: parses and queries
- Aggregated search → Search snapshots: stores snapshots
- User information → Tracker adapters: collects tracker data
- Social information → Recommendations: supports
- Downloader controls → Extension messaging: requests status
- Downloader clients → Download clients: controls downloads
- Backup settings → Backup providers: configures and invokes
- Backup providers → Backup services: synchronizes data
- Media servers → Download clients: integrates clients
- Offscreen runtime → IndexedDB adapter: uses adapter
- Offscreen runtime → Download history: manages history
- Offscreen runtime → Keep-upload tasks: manages tasks
- Extension state → Browser storage: reads and writes
- Background entry → Extension state: repairs user data
