# jackotom/hongguo-drama architecture

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

- Interactive diagram: https://gitdiagram.com/jackotom/hongguo-drama
- Repository: https://github.com/jackotom/hongguo-drama

## Overview

Hongguo Drama is a desktop drama discovery, playback, download, and export app, with a server/NAS runtime also present. The main user flow is browse or search for a series, open it in the player, and optionally queue downloads or export merged episodes. The graph preserves documented discovery, account, history, danmaku, and catalog capabilities. Evidence is limited to the README and indexed source references/excerpts; unsampled components are included where the tree or index establishes them, but uncertain connections are omitted.

Main entry points: [`src/App.jsx`](https://github.com/jackotom/hongguo-drama/blob/main/src/App.jsx) (App shell), [`src/components/Player.jsx`](https://github.com/jackotom/hongguo-drama/blob/main/src/components/Player.jsx) (Player), [`src/native/hongguo.js`](https://github.com/jackotom/hongguo-drama/blob/main/src/native/hongguo.js) (Source resolver), [`server/index.cjs`](https://github.com/jackotom/hongguo-drama/blob/main/server/index.cjs) (NAS service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["App shell<br/>[App.jsx]"]
  node_browse["Browse<br/>[Browse.jsx]"]
  node_feed["Drama feed<br/>[DramaFeed.jsx]"]
  node_calendar["Release calendar"]
  node_search["Search panel<br/>[SearchPanel.jsx]"]
  node_player["Player<br/>[Player.jsx]"]
  node_downloadui["Download manager"]
  node_historyui["Watch history<br/>[WatchHistory.jsx]"]
  node_accountui["Account management"]
end

subgraph group_content["Discovery and identity"]
  node_catalog["Catalog sources<br/>[catalog.js]"]
  node_appcatalog["App catalog"]
  node_appsearch["App search"]
  node_hongguosearch["Hongguo search<br/>[hongguo-search.js]"]
  node_publicdetails["Series details<br/>[public-details.js]"]
  node_account["Account session<br/>[account-session.js]"]
end

subgraph group_playback["Playback and downloads"]
  node_source["Source resolver<br/>[hongguo.js]"]
  node_reelshort["ReelShort source<br/>[reelshort.js]"]
  node_hema["Hema source<br/>[hema.js]"]
  node_customsource["Custom sources<br/>[custom-source.js]"]
  node_danmaku["Danmaku<br/>[danmaku.js]"]
  node_history["History backend<br/>[watch-history.js]"]
end

subgraph group_platform["Desktop runtime"]
  node_store[("App settings<br/>[store.js]")]
  node_main["Electron main<br/>[main.js]"]
end

subgraph group_nas["NAS server"]
  node_nasindex["NAS service<br/>[index.cjs]"]
  node_nasstorage[("Task storage<br/>[storage.cjs]")]
  node_nasmedia["Media service<br/>[media.cjs]"]
  node_nasearch["Search service<br/>[search.cjs]"]
end

node_user(("Viewer"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_browse
node_app -->|"renders"| node_player
node_app -->|"renders"| node_feed
node_app -->|"renders"| node_calendar
node_app -->|"renders"| node_historyui
node_app -->|"renders"| node_downloadui
node_app -->|"renders"| node_accountui
node_browse -.->|"loads catalog"| node_catalog
node_search -.->|"searches"| node_appsearch
node_search -.->|"searches"| node_hongguosearch
node_browse -.->|"opens details"| node_publicdetails
node_player -.->|"resolves media"| node_source
node_accountui -.->|"manages session"| node_account
node_player -.->|"shows comments"| node_danmaku
node_player -.->|"updates history"| node_history
node_main -->|"uses"| node_store
node_source -->|"delegates source"| node_reelshort
node_source -->|"delegates source"| node_hema
node_source -->|"delegates source"| node_customsource
node_nasindex -->|"uses storage"| node_nasstorage
node_nasindex -->|"uses media"| node_nasmedia
node_nasindex -->|"uses search"| node_nasearch
node_nasearch -->|"calls"| node_appsearch
node_nasearch -->|"calls"| node_hongguosearch

click node_app "https://github.com/jackotom/hongguo-drama/blob/main/src/App.jsx"
click node_browse "https://github.com/jackotom/hongguo-drama/blob/main/src/components/Browse.jsx"
click node_feed "https://github.com/jackotom/hongguo-drama/blob/main/src/components/DramaFeed.jsx"
click node_calendar "https://github.com/jackotom/hongguo-drama/blob/main/src/components/ReleaseCalendar.jsx"
click node_search "https://github.com/jackotom/hongguo-drama/blob/main/src/components/SearchPanel.jsx"
click node_player "https://github.com/jackotom/hongguo-drama/blob/main/src/components/Player.jsx"
click node_downloadui "https://github.com/jackotom/hongguo-drama/blob/main/src/components/DownloadManager.jsx"
click node_historyui "https://github.com/jackotom/hongguo-drama/blob/main/src/components/WatchHistory.jsx"
click node_accountui "https://github.com/jackotom/hongguo-drama/blob/main/src/components/AccountManagement.jsx"
click node_catalog "https://github.com/jackotom/hongguo-drama/blob/main/src/native/catalog.js"
click node_appcatalog "https://github.com/jackotom/hongguo-drama/blob/main/src/native/hongguo-app-catalog.js"
click node_appsearch "https://github.com/jackotom/hongguo-drama/blob/main/src/native/hongguo-app-search.js"
click node_hongguosearch "https://github.com/jackotom/hongguo-drama/blob/main/src/native/hongguo-search.js"
click node_publicdetails "https://github.com/jackotom/hongguo-drama/blob/main/src/native/public-details.js"
click node_account "https://github.com/jackotom/hongguo-drama/blob/main/src/native/account-session.js"
click node_source "https://github.com/jackotom/hongguo-drama/blob/main/src/native/hongguo.js"
click node_reelshort "https://github.com/jackotom/hongguo-drama/blob/main/src/native/reelshort.js"
click node_hema "https://github.com/jackotom/hongguo-drama/blob/main/src/native/hema.js"
click node_customsource "https://github.com/jackotom/hongguo-drama/blob/main/src/native/custom-source.js"
click node_danmaku "https://github.com/jackotom/hongguo-drama/blob/main/src/native/danmaku.js"
click node_history "https://github.com/jackotom/hongguo-drama/blob/main/src/native/watch-history.js"
click node_store "https://github.com/jackotom/hongguo-drama/blob/main/src/store.js"
click node_main "https://github.com/jackotom/hongguo-drama/blob/main/main.js"
click node_nasindex "https://github.com/jackotom/hongguo-drama/blob/main/server/index.cjs"
click node_nasstorage "https://github.com/jackotom/hongguo-drama/blob/main/server/storage.cjs"
click node_nasmedia "https://github.com/jackotom/hongguo-drama/blob/main/server/media.cjs"
click node_nasearch "https://github.com/jackotom/hongguo-drama/blob/main/server/search.cjs"

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_browse,node_feed,node_calendar,node_search,node_player,node_downloadui,node_historyui,node_accountui,node_user toneBlue
class node_catalog,node_appcatalog,node_appsearch,node_hongguosearch,node_publicdetails,node_account toneAmber
class node_source,node_reelshort,node_hema,node_customsource,node_danmaku,node_history toneMint
class node_store,node_main toneRose
class node_nasindex,node_nasstorage,node_nasmedia,node_nasearch toneIndigo
```

## Components

### Desktop interface

- [App shell](https://github.com/jackotom/hongguo-drama/blob/main/src/App.jsx): `src/App.jsx`
- [Browse](https://github.com/jackotom/hongguo-drama/blob/main/src/components/Browse.jsx): `src/components/Browse.jsx`
- [Drama feed](https://github.com/jackotom/hongguo-drama/blob/main/src/components/DramaFeed.jsx): `src/components/DramaFeed.jsx`
- [Release calendar](https://github.com/jackotom/hongguo-drama/blob/main/src/components/ReleaseCalendar.jsx): `src/components/ReleaseCalendar.jsx`
- [Search panel](https://github.com/jackotom/hongguo-drama/blob/main/src/components/SearchPanel.jsx): `src/components/SearchPanel.jsx`
- [Player](https://github.com/jackotom/hongguo-drama/blob/main/src/components/Player.jsx): `src/components/Player.jsx`
- [Download manager](https://github.com/jackotom/hongguo-drama/blob/main/src/components/DownloadManager.jsx): `src/components/DownloadManager.jsx`
- [Watch history](https://github.com/jackotom/hongguo-drama/blob/main/src/components/WatchHistory.jsx): `src/components/WatchHistory.jsx`
- [Account management](https://github.com/jackotom/hongguo-drama/blob/main/src/components/AccountManagement.jsx): `src/components/AccountManagement.jsx`

### Discovery and identity

- [Catalog sources](https://github.com/jackotom/hongguo-drama/blob/main/src/native/catalog.js): `src/native/catalog.js`
- [App catalog](https://github.com/jackotom/hongguo-drama/blob/main/src/native/hongguo-app-catalog.js): `src/native/hongguo-app-catalog.js`
- [App search](https://github.com/jackotom/hongguo-drama/blob/main/src/native/hongguo-app-search.js): `src/native/hongguo-app-search.js`
- [Hongguo search](https://github.com/jackotom/hongguo-drama/blob/main/src/native/hongguo-search.js): `src/native/hongguo-search.js`
- [Series details](https://github.com/jackotom/hongguo-drama/blob/main/src/native/public-details.js): `src/native/public-details.js`
- [Account session](https://github.com/jackotom/hongguo-drama/blob/main/src/native/account-session.js): `src/native/account-session.js`

### Playback and downloads

- [Source resolver](https://github.com/jackotom/hongguo-drama/blob/main/src/native/hongguo.js): `src/native/hongguo.js`
- [ReelShort source](https://github.com/jackotom/hongguo-drama/blob/main/src/native/reelshort.js): `src/native/reelshort.js`
- [Hema source](https://github.com/jackotom/hongguo-drama/blob/main/src/native/hema.js): `src/native/hema.js`
- [Custom sources](https://github.com/jackotom/hongguo-drama/blob/main/src/native/custom-source.js): `src/native/custom-source.js`
- [Danmaku](https://github.com/jackotom/hongguo-drama/blob/main/src/native/danmaku.js): `src/native/danmaku.js`
- [History backend](https://github.com/jackotom/hongguo-drama/blob/main/src/native/watch-history.js): `src/native/watch-history.js`

### Desktop runtime

- [App settings](https://github.com/jackotom/hongguo-drama/blob/main/src/store.js): `src/store.js`
- [Electron main](https://github.com/jackotom/hongguo-drama/blob/main/main.js): `main.js`

### NAS server

- [NAS service](https://github.com/jackotom/hongguo-drama/blob/main/server/index.cjs): `server/index.cjs`
- [Task storage](https://github.com/jackotom/hongguo-drama/blob/main/server/storage.cjs): `server/storage.cjs`
- [Media service](https://github.com/jackotom/hongguo-drama/blob/main/server/media.cjs): `server/media.cjs`
- [Search service](https://github.com/jackotom/hongguo-drama/blob/main/server/search.cjs): `server/search.cjs`

### Other components

- **Viewer**

## Connections

- Viewer → App shell: uses
- App shell → Browse: renders (evidence: `src/App.jsx`)
- App shell → Player: renders (evidence: `src/App.jsx`)
- App shell → Drama feed: renders (evidence: `src/App.jsx`)
- App shell → Release calendar: renders (evidence: `src/App.jsx`)
- App shell → Watch history: renders (evidence: `src/App.jsx`)
- App shell → Download manager: renders (evidence: `src/App.jsx`)
- App shell → Account management: renders (evidence: `src/App.jsx`)
- Browse → Catalog sources: loads catalog
- Search panel → App search: searches
- Search panel → Hongguo search: searches
- Browse → Series details: opens details
- Player → Source resolver: resolves media
- Account management → Account session: manages session
- Player → Danmaku: shows comments
- Player → History backend: updates history
- Electron main → App settings: uses (evidence: `main.js`)
- Source resolver → ReelShort source: delegates source (evidence: `src/native/hongguo.js`)
- Source resolver → Hema source: delegates source (evidence: `src/native/hongguo.js`)
- Source resolver → Custom sources: delegates source (evidence: `src/native/hongguo.js`)
- NAS service → Task storage: uses storage (evidence: `server/index.cjs`)
- NAS service → Media service: uses media (evidence: `server/index.cjs`)
- NAS service → Search service: uses search (evidence: `server/index.cjs`)
- Search service → App search: calls (evidence: `server/search.cjs`)
- Search service → Hongguo search: calls (evidence: `server/search.cjs`)
