# dowenai/jasna-ltx-site architecture

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

- Interactive diagram: https://gitdiagram.com/dowenai/jasna-ltx-site
- Repository: https://github.com/dowenai/jasna-ltx-site

## Overview

Jasna-LTX is a movie-resource catalogue: users load and search a local movie database, browse filtered/sorted cards, then copy links or send downloads to configured services. The repository also contains a scheduled JavDB ingestion path, a Cloudflare API for community comments/submissions/feedback, and separate X-media helpers and TV spider integrations. Edges are limited to README or sampled-code relationships; unsampled modules are represented only where documented or indexed.

Main entry points: [`js/app.js`](https://github.com/dowenai/jasna-ltx-site/blob/main/js/app.js) (Catalogue UI), [`data/movies.json`](https://github.com/dowenai/jasna-ltx-site/blob/main/data/movies.json) (Movie database), [`scripts/sync_javdb.py`](https://github.com/dowenai/jasna-ltx-site/blob/main/scripts/sync_javdb.py) (JavDB sync), [`scripts/sync.js`](https://github.com/dowenai/jasna-ltx-site/blob/main/scripts/sync.js) (LTX sync engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalogue["Catalogue experience"]
  node_webapp["Catalogue UI<br/>[app.js]"]
  node_movie_data[("Movie database<br/>[movies.json]")]
  node_download_targets["Aria2 / 115"]
end

subgraph group_ingestion["Resource ingestion"]
  node_sync_engine["JavDB sync<br/>[sync_javdb.py]"]
  node_sync_js["LTX sync engine<br/>[sync.js]"]
  node_sync_state[("Sync datasets")]
end

subgraph group_cloud["Cloud API"]
  node_pages_api["API router<br/>[&#91;&#91;path&#93;&#93;.js]"]
  node_kv[("Cloudflare KV")]
end

subgraph group_media["Media integrations"]
  node_image_proxy["Image proxy<br/>[img.js]"]
  node_x_search["X post search<br/>[xsearch.js]"]
  node_x_resolver["X media resolver<br/>[ts.js]"]
  node_x_diagnostics["Search diagnostics<br/>[xtest.js]"]
  node_proxy_diagnostics["Proxy diagnostics<br/>[xtest2.js]"]
  node_tv_spider["Huangguo TV spider"]
  node_xd_panel["XD recommendation panel<br/>[xd_plus.js]"]
  node_xd_data[("XD resource data<br/>[movies.json]")]
end

node_visitor(("Catalogue visitor"))
node_external_user(("TV client / user"))

node_visitor -->|"browses"| node_webapp
node_webapp -->|"loads"| node_movie_data
node_webapp -->|"submits downloads"| node_download_targets
node_sync_engine -->|"updates"| node_movie_data
node_sync_engine -->|"tracks checks"| node_sync_state
node_sync_js -.->|"syncs resources"| node_movie_data
node_pages_api -->|"reads and writes"| node_kv
node_external_user -->|"requests streams"| node_tv_spider
node_xd_panel -.->|"loads data"| node_xd_data

click node_webapp "https://github.com/dowenai/jasna-ltx-site/blob/main/js/app.js"
click node_movie_data "https://github.com/dowenai/jasna-ltx-site/blob/main/data/movies.json"
click node_sync_engine "https://github.com/dowenai/jasna-ltx-site/blob/main/scripts/sync_javdb.py"
click node_sync_js "https://github.com/dowenai/jasna-ltx-site/blob/main/scripts/sync.js"
click node_sync_state "https://github.com/dowenai/jasna-ltx-site/tree/main/data"
click node_pages_api "https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/%5B%5Bpath%5D%5D.js"
click node_image_proxy "https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/img.js"
click node_x_search "https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/xsearch.js"
click node_x_resolver "https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/ts.js"
click node_x_diagnostics "https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/xtest.js"
click node_proxy_diagnostics "https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/xtest2.js"
click node_tv_spider "https://github.com/dowenai/jasna-ltx-site/blob/main/tv/huangguo_web_spider.js"
click node_xd_panel "https://github.com/dowenai/jasna-ltx-site/blob/main/xd_plus.js"
click node_xd_data "https://github.com/dowenai/jasna-ltx-site/blob/main/data/movies.json"

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_webapp,node_movie_data,node_download_targets,node_external_user toneBlue
class node_sync_engine,node_sync_js,node_sync_state toneAmber
class node_pages_api,node_kv toneMint
class node_image_proxy,node_x_search,node_x_resolver,node_x_diagnostics,node_proxy_diagnostics,node_tv_spider,node_xd_panel,node_xd_data toneRose
class node_visitor toneIndigo
```

## Components

### Catalogue experience

- [Catalogue UI](https://github.com/dowenai/jasna-ltx-site/blob/main/js/app.js): `js/app.js`
- [Movie database](https://github.com/dowenai/jasna-ltx-site/blob/main/data/movies.json): `data/movies.json`
- **Aria2 / 115**

### Resource ingestion

- [JavDB sync](https://github.com/dowenai/jasna-ltx-site/blob/main/scripts/sync_javdb.py): `scripts/sync_javdb.py`
- [LTX sync engine](https://github.com/dowenai/jasna-ltx-site/blob/main/scripts/sync.js): `scripts/sync.js`
- [Sync datasets](https://github.com/dowenai/jasna-ltx-site/tree/main/data): `data`

### Cloud API

- [API router](https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/%5B%5Bpath%5D%5D.js): `functions/api/[[path]].js`
- **Cloudflare KV**

### Media integrations

- [Image proxy](https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/img.js): `functions/api/img.js`
- [X post search](https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/xsearch.js): `functions/api/xsearch.js`
- [X media resolver](https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/ts.js): `functions/api/ts.js`
- [Search diagnostics](https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/xtest.js): `functions/api/xtest.js`
- [Proxy diagnostics](https://github.com/dowenai/jasna-ltx-site/blob/main/functions/api/xtest2.js): `functions/api/xtest2.js`
- [Huangguo TV spider](https://github.com/dowenai/jasna-ltx-site/blob/main/tv/huangguo_web_spider.js): `tv/huangguo_web_spider.js`
- [XD recommendation panel](https://github.com/dowenai/jasna-ltx-site/blob/main/xd_plus.js): `xd_plus.js`
- [XD resource data](https://github.com/dowenai/jasna-ltx-site/blob/main/data/movies.json): `data/movies.json`

### Other components

- **Catalogue visitor**
- **TV client / user**

## Connections

- Catalogue visitor → Catalogue UI: browses (evidence: `README.md`)
- Catalogue UI → Movie database: loads (evidence: `js/app.js`)
- Catalogue UI → Aria2 / 115: submits downloads (evidence: `README.md`)
- JavDB sync → Movie database: updates (evidence: `scripts/sync_javdb.py`)
- JavDB sync → Sync datasets: tracks checks (evidence: `scripts/sync_javdb.py`)
- LTX sync engine → Movie database: syncs resources
- API router → Cloudflare KV: reads and writes (evidence: `functions/api/[[path]].js`)
- TV client / user → Huangguo TV spider: requests streams (evidence: `tv/huangguo_web_spider.js`)
- XD recommendation panel → XD resource data: loads data
