# putyy/res-downloader architecture

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

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

## Overview

res-downloader is a cross-platform desktop resource sniffer and downloader. Users start its proxy, visit a resource in another app or browser, then review detected media in the home view and preview, download, decode, copy, or delete it. README documents broad media/platform support and proxy capture; sampled frontend code confirms resource actions and Wails bindings. Backend proxy, detection, persistence, and configuration internals are only partly sampled, so unverified implementation links are omitted or dashed.

Main entry points: [`frontend/src/views/index.vue`](https://github.com/putyy/res-downloader/blob/master/frontend/src/views/index.vue) (Resource home), [`frontend/src/stores/index.ts`](https://github.com/putyy/res-downloader/blob/master/frontend/src/stores/index.ts) (App state), [`core/resource.go`](https://github.com/putyy/res-downloader/blob/master/core/resource.go) (Resource detection), [`core/http.go`](https://github.com/putyy/res-downloader/blob/master/core/http.go) (HTTP interception)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop app"]
  node_main["Desktop runtime<br/>[main.go]"]
  node_binding["Wails bindings<br/>[bind.go]"]
  node_app_shell["App shell<br/>[App.vue]"]
end

subgraph group_capture["Proxy capture"]
  node_proxy["Capture proxy<br/>[proxy.go]"]
  node_http["HTTP interception<br/>[http.go]"]
  node_middleware["Request middleware<br/>[middleware.go]"]
  node_resource["Resource detection<br/>[resource.go]"]
  node_plugins["Platform plugins"]
  node_rules["Capture rules<br/>[rule.go]"]
  node_system_proxy["System proxy<br/>[system.go]"]
end

subgraph group_resources["Resource workflow"]
  node_home["Resource home<br/>[index.vue]"]
  node_actions["Resource actions<br/>[Action.vue]"]
  node_preview["Media preview<br/>[Preview.vue]"]
  node_downloader["Download manager<br/>[downloader.go]"]
  node_media_api["Resource API<br/>[app.ts]"]
  node_storage[("Resource storage<br/>[storage.go]")]
end

subgraph group_settings["Configuration"]
  node_settings_view["Settings screen<br/>[setting.vue]"]
  node_store["App state<br/>[index.ts]"]
  node_config["Configuration<br/>[config.go]"]
end

node_user(("User"))
node_external_sites(("Resource sites"))

node_user -->|"operates"| node_home
node_external_sites -->|"sends traffic"| node_proxy
node_main -.->|"starts"| node_binding
node_user -->|"starts capture"| node_proxy
node_proxy -.->|"intercepts"| node_http
node_http -.->|"processes"| node_middleware
node_http -.->|"detects media"| node_resource
node_resource -.->|"classifies via"| node_plugins
node_resource -.->|"filters by"| node_rules
node_resource -.->|"stores"| node_storage
node_home -.->|"requests actions"| node_media_api
node_actions -->|"emits action"| node_home
node_home -.->|"opens preview"| node_preview
node_preview -->|"fetches media"| node_external_sites
node_home -.->|"downloads via API"| node_downloader
node_settings_view -->|"updates settings"| node_store
node_store -.->|"loads and sets"| node_config
node_store -->|"reads app config"| node_binding
node_user -.->|"configures"| node_settings_view
node_store -.->|"toggles proxy"| node_system_proxy
node_app_shell -->|"initializes"| node_store

click node_main "https://github.com/putyy/res-downloader/blob/master/main.go"
click node_binding "https://github.com/putyy/res-downloader/blob/master/core/bind.go"
click node_home "https://github.com/putyy/res-downloader/blob/master/frontend/src/views/index.vue"
click node_actions "https://github.com/putyy/res-downloader/blob/master/frontend/src/components/Action.vue"
click node_preview "https://github.com/putyy/res-downloader/blob/master/frontend/src/components/Preview.vue"
click node_downloader "https://github.com/putyy/res-downloader/blob/master/core/downloader.go"
click node_media_api "https://github.com/putyy/res-downloader/blob/master/frontend/src/api/app.ts"
click node_proxy "https://github.com/putyy/res-downloader/blob/master/core/proxy.go"
click node_http "https://github.com/putyy/res-downloader/blob/master/core/http.go"
click node_middleware "https://github.com/putyy/res-downloader/blob/master/core/middleware.go"
click node_resource "https://github.com/putyy/res-downloader/blob/master/core/resource.go"
click node_plugins "https://github.com/putyy/res-downloader/tree/master/core/plugins"
click node_rules "https://github.com/putyy/res-downloader/blob/master/core/rule.go"
click node_storage "https://github.com/putyy/res-downloader/blob/master/core/storage.go"
click node_settings_view "https://github.com/putyy/res-downloader/blob/master/frontend/src/views/setting.vue"
click node_store "https://github.com/putyy/res-downloader/blob/master/frontend/src/stores/index.ts"
click node_config "https://github.com/putyy/res-downloader/blob/master/core/config.go"
click node_system_proxy "https://github.com/putyy/res-downloader/blob/master/core/system.go"
click node_app_shell "https://github.com/putyy/res-downloader/blob/master/frontend/src/App.vue"

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_main,node_binding,node_app_shell,node_user toneBlue
class node_proxy,node_http,node_middleware,node_resource,node_plugins,node_rules,node_system_proxy toneAmber
class node_home,node_actions,node_preview,node_downloader,node_media_api,node_storage toneMint
class node_settings_view,node_store,node_config toneRose
class node_external_sites toneIndigo
```

## Components

### Desktop app

- [Desktop runtime](https://github.com/putyy/res-downloader/blob/master/main.go): `main.go`
- [Wails bindings](https://github.com/putyy/res-downloader/blob/master/core/bind.go): `core/bind.go`
- [App shell](https://github.com/putyy/res-downloader/blob/master/frontend/src/App.vue): `frontend/src/App.vue`

### Proxy capture

- [Capture proxy](https://github.com/putyy/res-downloader/blob/master/core/proxy.go): `core/proxy.go`
- [HTTP interception](https://github.com/putyy/res-downloader/blob/master/core/http.go): `core/http.go`
- [Request middleware](https://github.com/putyy/res-downloader/blob/master/core/middleware.go): `core/middleware.go`
- [Resource detection](https://github.com/putyy/res-downloader/blob/master/core/resource.go): `core/resource.go`
- [Platform plugins](https://github.com/putyy/res-downloader/tree/master/core/plugins): `core/plugins`
- [Capture rules](https://github.com/putyy/res-downloader/blob/master/core/rule.go): `core/rule.go`
- [System proxy](https://github.com/putyy/res-downloader/blob/master/core/system.go): `core/system.go`

### Resource workflow

- [Resource home](https://github.com/putyy/res-downloader/blob/master/frontend/src/views/index.vue): `frontend/src/views/index.vue`
- [Resource actions](https://github.com/putyy/res-downloader/blob/master/frontend/src/components/Action.vue): `frontend/src/components/Action.vue`
- [Media preview](https://github.com/putyy/res-downloader/blob/master/frontend/src/components/Preview.vue): `frontend/src/components/Preview.vue`
- [Download manager](https://github.com/putyy/res-downloader/blob/master/core/downloader.go): `core/downloader.go`
- [Resource API](https://github.com/putyy/res-downloader/blob/master/frontend/src/api/app.ts): `frontend/src/api/app.ts`
- [Resource storage](https://github.com/putyy/res-downloader/blob/master/core/storage.go): `core/storage.go`

### Configuration

- [Settings screen](https://github.com/putyy/res-downloader/blob/master/frontend/src/views/setting.vue): `frontend/src/views/setting.vue`
- [App state](https://github.com/putyy/res-downloader/blob/master/frontend/src/stores/index.ts): `frontend/src/stores/index.ts`
- [Configuration](https://github.com/putyy/res-downloader/blob/master/core/config.go): `core/config.go`

### Other components

- **User**
- **Resource sites**

## Connections

- User → Resource home: operates
- Resource sites → Capture proxy: sends traffic
- Desktop runtime → Wails bindings: starts
- User → Capture proxy: starts capture
- Capture proxy → HTTP interception: intercepts
- HTTP interception → Request middleware: processes
- HTTP interception → Resource detection: detects media
- Resource detection → Platform plugins: classifies via
- Resource detection → Capture rules: filters by
- Resource detection → Resource storage: stores
- Resource home → Resource API: requests actions
- Resource actions → Resource home: emits action (evidence: `frontend/src/components/Action.vue`)
- Resource home → Media preview: opens preview
- Media preview → Resource sites: fetches media (evidence: `frontend/src/components/Preview.vue`)
- Resource home → Download manager: downloads via API
- Settings screen → App state: updates settings (evidence: `frontend/src/views/setting.vue`)
- App state → Configuration: loads and sets
- App state → Wails bindings: reads app config (evidence: `frontend/src/stores/index.ts`)
- User → Settings screen: configures
- App state → System proxy: toggles proxy
- App shell → App state: initializes (evidence: `frontend/src/App.vue`)
