# imzyb/misub architecture

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

- Interactive diagram: https://gitdiagram.com/imzyb/misub
- Repository: https://github.com/imzyb/misub

## Overview

MiSub is a subscription-management panel: an administrator manages upstream subscriptions and manual proxy nodes, combines them into profiles, optionally processes nodes with an operator chain, then publishes client-ready subscription links. The Vue interface communicates with Pages Functions; backend subscription processing parses and transforms nodes before producing client formats. The README also documents public pages, external management APIs, scheduled refresh, notifications, and backup. Several backend routes and UI branches are present in the tree but were not sampled, so their internal call paths are not asserted here.

Main entry points: [`src/components/features/Dashboard/Dashboard.vue`](https://github.com/imzyb/misub/blob/main/src/components/features/Dashboard/Dashboard.vue) (Dashboard workspace), [`functions/services/subscription-service.js`](https://github.com/imzyb/misub/blob/main/functions/services/subscription-service.js) (Subscription processing), [`functions/modules/subscription/template-pipeline.js`](https://github.com/imzyb/misub/blob/main/functions/modules/subscription/template-pipeline.js) (Template rendering), [`functions/modules/subscription-handler.js`](https://github.com/imzyb/misub/blob/main/functions/modules/subscription-handler.js) (Subscription handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Admin interface"]
  node_dashboard["Dashboard workspace<br/>[Dashboard.vue]"]
  node_data_store["Client data store<br/>[useDataStore.js]"]
  node_http_client["HTTP client<br/>[http.js]"]
  node_profiles_ui["Profile management<br/>[ProfilePanel.vue]"]
  node_subscriptions_ui["Subscription management"]
  node_manual_nodes_ui["Manual node management"]
  node_operator_ui["Operator chain editor<br/>[OperatorChain.vue]"]
  node_preview_ui["Node preview"]
  node_settings_ui["Settings"]
end

subgraph group_management["Subscription management"]
  node_node_parser["Node parsing<br/>[node-parser.js]"]
  node_operator_runner["Operator execution<br/>[operator-runner.js]"]
end

subgraph group_delivery["Subscription delivery"]
  node_subscription_handler["Subscription handler"]
  node_subscription_service["Subscription processing"]
  node_template_pipeline["Template rendering"]
  node_template_parser["INI template parser"]
  node_template_processor["Template optimization"]
  node_template_renderers["Client format renderers"]
end

subgraph group_platform["API and operations"]
  node_api_router["API routing<br/>[api-router.js]"]
end

subgraph group_persistence["Storage"]
  node_storage_adapter["Storage adapter<br/>[storage-adapter.js]"]
  node_kv_store[("Cloudflare KV")]
  node_d1_store[("Cloudflare D1")]
end

node_admin(("Administrator"))
node_external_clients(("Proxy clients"))
node_public_users(("Public page visitors"))
node_external_services(("External services"))

node_admin -->|"manages sources"| node_dashboard
node_dashboard -->|"manages profiles"| node_profiles_ui
node_dashboard -->|"manages subscriptions"| node_subscriptions_ui
node_dashboard -.->|"manages nodes"| node_manual_nodes_ui
node_dashboard -->|"configures processing"| node_operator_ui
node_dashboard -->|"uses"| node_data_store
node_profiles_ui -.->|"updates profiles"| node_data_store
node_subscriptions_ui -.->|"updates subscriptions"| node_data_store
node_data_store -->|"sends API requests"| node_http_client
node_http_client -.->|"calls Pages API"| node_api_router
node_admin -->|"previews nodes"| node_preview_ui
node_preview_ui -->|"requests preview"| node_http_client
node_admin -->|"configures services"| node_settings_ui
node_api_router -.->|"routes requests"| node_subscription_handler
node_subscription_handler -.->|"processes subscriptions"| node_subscription_service
node_subscription_service -->|"parses nodes"| node_node_parser
node_subscription_service -->|"runs operators"| node_operator_runner
node_subscription_service -.->|"generates output"| node_template_pipeline
node_template_pipeline -->|"parses templates"| node_template_parser
node_template_pipeline -->|"optimizes model"| node_template_processor
node_template_pipeline -->|"renders formats"| node_template_renderers
node_external_clients -->|"requests links"| node_subscription_handler
node_subscription_handler -->|"returns subscriptions"| node_external_clients
node_public_users -.->|"views public page"| node_dashboard
node_storage_adapter -->|"reads and writes"| node_kv_store
node_storage_adapter -->|"reads and writes"| node_d1_store
node_settings_ui -.->|"configures storage"| node_storage_adapter
node_external_services -.->|"uses external API"| node_api_router
node_external_services -.->|"triggers scheduled work"| node_api_router

click node_dashboard "https://github.com/imzyb/misub/blob/main/src/components/features/Dashboard/Dashboard.vue"
click node_data_store "https://github.com/imzyb/misub/blob/main/src/stores/useDataStore.js"
click node_http_client "https://github.com/imzyb/misub/blob/main/src/lib/http.js"
click node_profiles_ui "https://github.com/imzyb/misub/blob/main/src/components/profiles/ProfilePanel.vue"
click node_subscriptions_ui "https://github.com/imzyb/misub/blob/main/src/components/subscriptions/SubscriptionPanel.vue"
click node_manual_nodes_ui "https://github.com/imzyb/misub/blob/main/src/components/nodes/ManualNodePanel.vue"
click node_operator_ui "https://github.com/imzyb/misub/blob/main/src/components/features/Operators/OperatorChain.vue"
click node_preview_ui "https://github.com/imzyb/misub/blob/main/src/components/modals/NodePreview/NodePreviewModal.vue"
click node_settings_ui "https://github.com/imzyb/misub/blob/main/src/components/settings/SettingsContent.vue"
click node_api_router "https://github.com/imzyb/misub/blob/main/functions/modules/api-router.js"
click node_subscription_handler "https://github.com/imzyb/misub/blob/main/functions/modules/subscription-handler.js"
click node_subscription_service "https://github.com/imzyb/misub/blob/main/functions/services/subscription-service.js"
click node_node_parser "https://github.com/imzyb/misub/blob/main/functions/modules/utils/node-parser.js"
click node_operator_runner "https://github.com/imzyb/misub/blob/main/functions/utils/operator-runner.js"
click node_template_pipeline "https://github.com/imzyb/misub/blob/main/functions/modules/subscription/template-pipeline.js"
click node_template_parser "https://github.com/imzyb/misub/blob/main/functions/modules/subscription/template-parsers/ini-template-parser.js"
click node_template_processor "https://github.com/imzyb/misub/blob/main/functions/modules/subscription/template-processor.js"
click node_template_renderers "https://github.com/imzyb/misub/tree/main/functions/modules/subscription/template-renderers"
click node_storage_adapter "https://github.com/imzyb/misub/blob/main/functions/storage-adapter.js"

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_dashboard,node_data_store,node_http_client,node_profiles_ui,node_subscriptions_ui,node_manual_nodes_ui,node_operator_ui,node_preview_ui,node_settings_ui,node_external_clients toneBlue
class node_node_parser,node_operator_runner toneAmber
class node_subscription_handler,node_subscription_service,node_template_pipeline,node_template_parser,node_template_processor,node_template_renderers toneMint
class node_api_router toneRose
class node_storage_adapter,node_kv_store,node_d1_store,node_admin,node_public_users,node_external_services toneIndigo
```

## Components

### Admin interface

- [Dashboard workspace](https://github.com/imzyb/misub/blob/main/src/components/features/Dashboard/Dashboard.vue): `src/components/features/Dashboard/Dashboard.vue`
- [Client data store](https://github.com/imzyb/misub/blob/main/src/stores/useDataStore.js): `src/stores/useDataStore.js`
- [HTTP client](https://github.com/imzyb/misub/blob/main/src/lib/http.js): `src/lib/http.js`
- [Profile management](https://github.com/imzyb/misub/blob/main/src/components/profiles/ProfilePanel.vue): `src/components/profiles/ProfilePanel.vue`
- [Subscription management](https://github.com/imzyb/misub/blob/main/src/components/subscriptions/SubscriptionPanel.vue): `src/components/subscriptions/SubscriptionPanel.vue`
- [Manual node management](https://github.com/imzyb/misub/blob/main/src/components/nodes/ManualNodePanel.vue): `src/components/nodes/ManualNodePanel.vue`
- [Operator chain editor](https://github.com/imzyb/misub/blob/main/src/components/features/Operators/OperatorChain.vue): `src/components/features/Operators/OperatorChain.vue`
- [Node preview](https://github.com/imzyb/misub/blob/main/src/components/modals/NodePreview/NodePreviewModal.vue): `src/components/modals/NodePreview/NodePreviewModal.vue`
- [Settings](https://github.com/imzyb/misub/blob/main/src/components/settings/SettingsContent.vue): `src/components/settings/SettingsContent.vue`

### Subscription management

- [Node parsing](https://github.com/imzyb/misub/blob/main/functions/modules/utils/node-parser.js): `functions/modules/utils/node-parser.js`
- [Operator execution](https://github.com/imzyb/misub/blob/main/functions/utils/operator-runner.js): `functions/utils/operator-runner.js`

### Subscription delivery

- [Subscription handler](https://github.com/imzyb/misub/blob/main/functions/modules/subscription-handler.js): `functions/modules/subscription-handler.js`
- [Subscription processing](https://github.com/imzyb/misub/blob/main/functions/services/subscription-service.js): `functions/services/subscription-service.js`
- [Template rendering](https://github.com/imzyb/misub/blob/main/functions/modules/subscription/template-pipeline.js): `functions/modules/subscription/template-pipeline.js`
- [INI template parser](https://github.com/imzyb/misub/blob/main/functions/modules/subscription/template-parsers/ini-template-parser.js): `functions/modules/subscription/template-parsers/ini-template-parser.js`
- [Template optimization](https://github.com/imzyb/misub/blob/main/functions/modules/subscription/template-processor.js): `functions/modules/subscription/template-processor.js`
- [Client format renderers](https://github.com/imzyb/misub/tree/main/functions/modules/subscription/template-renderers): `functions/modules/subscription/template-renderers`

### API and operations

- [API routing](https://github.com/imzyb/misub/blob/main/functions/modules/api-router.js): `functions/modules/api-router.js`

### Storage

- [Storage adapter](https://github.com/imzyb/misub/blob/main/functions/storage-adapter.js): `functions/storage-adapter.js`
- **Cloudflare KV**
- **Cloudflare D1**

### Other components

- **Administrator**
- **Proxy clients**
- **Public page visitors**
- **External services**

## Connections

- Administrator → Dashboard workspace: manages sources (evidence: `README.md`)
- Dashboard workspace → Profile management: manages profiles (evidence: `src/components/features/Dashboard/Dashboard.vue`)
- Dashboard workspace → Subscription management: manages subscriptions (evidence: `src/components/features/Dashboard/Dashboard.vue`)
- Dashboard workspace → Manual node management: manages nodes (evidence: `src/components/features/Dashboard/Dashboard.vue`)
- Dashboard workspace → Operator chain editor: configures processing (evidence: `README.md`)
- Dashboard workspace → Client data store: uses (evidence: `src/components/features/Dashboard/Dashboard.vue`)
- Profile management → Client data store: updates profiles
- Subscription management → Client data store: updates subscriptions
- Client data store → HTTP client: sends API requests (evidence: `src/stores/useDataStore.js`)
- HTTP client → API routing: calls Pages API
- Administrator → Node preview: previews nodes (evidence: `README.md`)
- Node preview → HTTP client: requests preview (evidence: `src/components/modals/NodePreview/NodePreviewModal.vue`)
- Administrator → Settings: configures services (evidence: `README.md`)
- API routing → Subscription handler: routes requests
- Subscription handler → Subscription processing: processes subscriptions
- Subscription processing → Node parsing: parses nodes (evidence: `functions/services/subscription-service.js`)
- Subscription processing → Operator execution: runs operators (evidence: `functions/services/subscription-service.js`)
- Subscription processing → Template rendering: generates output
- Template rendering → INI template parser: parses templates (evidence: `functions/modules/subscription/template-pipeline.js`)
- Template rendering → Template optimization: optimizes model (evidence: `functions/modules/subscription/template-pipeline.js`)
- Template rendering → Client format renderers: renders formats (evidence: `functions/modules/subscription/template-pipeline.js`)
- Proxy clients → Subscription handler: requests links (evidence: `README.md`)
- Subscription handler → Proxy clients: returns subscriptions (evidence: `README.md`)
- Public page visitors → Dashboard workspace: views public page
- Storage adapter → Cloudflare KV: reads and writes (evidence: `functions/storage-adapter.js`)
- Storage adapter → Cloudflare D1: reads and writes (evidence: `functions/storage-adapter.js`)
- Settings → Storage adapter: configures storage
- External services → API routing: uses external API (evidence: `README.md`)
- External services → API routing: triggers scheduled work (evidence: `README.md`)
