# littlefoxy067/novel-hub architecture

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

- Interactive diagram: https://gitdiagram.com/littlefoxy067/novel-hub
- Repository: https://github.com/littlefoxy067/novel-hub

## Overview

Novel Hub is a novel-discovery and reading web app, with an Android WebView wrapper. The main journey is browsing or searching the catalogue, opening a novel, loading its chapters, and reading chapter content; local shelf and reading-progress features complement that journey. The README documents the Novel API and the principal discovery and reading capabilities. Source excerpts show the browser app’s route handling and chapter retrieval, but do not expose every internal call or the full Android asset-loading flow, so those connections are omitted where unverified.

Main entry points: [`app.js`](https://github.com/littlefoxy067/novel-hub/blob/main/app.js) (Web app routes), [`api/share-image.js`](https://github.com/littlefoxy067/novel-hub/blob/main/api/share-image.js) (Share image proxy), [`library.js`](https://github.com/littlefoxy067/novel-hub/blob/main/library.js) (Local library), [`api/share.js`](https://github.com/littlefoxy067/novel-hub/blob/main/api/share.js) (Novel share page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Discovery and reading"]
  node_webapp["Web app routes<br/>[app.js]"]
  node_discovery["Novel discovery<br/>[app.js]"]
  node_details["Novel details<br/>[app.js]"]
  node_chapterlist["Chapter loading<br/>[app.js]"]
  node_reading["Chapter reader<br/>[app.js]"]
  node_pdf["Reading PDF<br/>[app.js]"]
end

subgraph group_personal["Personal library"]
  node_library["Local library<br/>[library.js]"]
  node_browserstore[("Browser storage")]
end

subgraph group_platform["App platform"]
  node_ui["Navigation and install UI<br/>[ui-fixes.js]"]
  node_offline["Offline cache<br/>[sw.js]"]
  node_android["Android WebView shell<br/>[MainActivity.java]"]
  node_recovery["API detail recovery<br/>[api-recovery.js]"]
end

subgraph group_sharing["Sharing services"]
  node_share["Novel share page<br/>[share.js]"]
  node_shareimage["Share image proxy<br/>[share-image.js]"]
end

node_reader(("Visitor"))
node_novelapi{{"Novel API"}}
node_imageproxy{{"Image transform service"}}

node_reader -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_discovery
node_webapp -->|"routes to"| node_details
node_webapp -->|"routes to"| node_reading
node_discovery -->|"requests catalogue"| node_novelapi
node_details -->|"requests details"| node_novelapi
node_details -->|"loads chapters"| node_chapterlist
node_chapterlist -->|"requests chapters"| node_novelapi
node_reading -->|"loads content"| node_novelapi
node_reading -->|"exports book"| node_pdf
node_reader -->|"manages shelf"| node_library
node_library -->|"reads and writes"| node_browserstore
node_reader -->|"uses"| node_ui
node_reader -.->|"uses app"| node_android
node_recovery -->|"retries detail"| node_novelapi
node_reader -.->|"opens shared novel"| node_share
node_share -->|"fetches novel"| node_novelapi
node_shareimage -->|"fetches cover"| node_novelapi
node_shareimage -->|"transforms image"| node_imageproxy

click node_webapp "https://github.com/littlefoxy067/novel-hub/blob/main/app.js"
click node_discovery "https://github.com/littlefoxy067/novel-hub/blob/main/app.js"
click node_details "https://github.com/littlefoxy067/novel-hub/blob/main/app.js"
click node_chapterlist "https://github.com/littlefoxy067/novel-hub/blob/main/app.js"
click node_reading "https://github.com/littlefoxy067/novel-hub/blob/main/app.js"
click node_pdf "https://github.com/littlefoxy067/novel-hub/blob/main/app.js"
click node_library "https://github.com/littlefoxy067/novel-hub/blob/main/library.js"
click node_ui "https://github.com/littlefoxy067/novel-hub/blob/main/ui-fixes.js"
click node_offline "https://github.com/littlefoxy067/novel-hub/blob/main/sw.js"
click node_android "https://github.com/littlefoxy067/novel-hub/blob/main/android/app/src/main/java/com/littlefoxy/novelhub/MainActivity.java"
click node_recovery "https://github.com/littlefoxy067/novel-hub/blob/main/api-recovery.js"
click node_share "https://github.com/littlefoxy067/novel-hub/blob/main/api/share.js"
click node_shareimage "https://github.com/littlefoxy067/novel-hub/blob/main/api/share-image.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_webapp,node_discovery,node_details,node_chapterlist,node_reading,node_pdf toneBlue
class node_library,node_browserstore toneAmber
class node_ui,node_offline,node_android,node_recovery,node_novelapi toneMint
class node_share,node_shareimage toneRose
class node_reader,node_imageproxy toneIndigo
```

## Components

### Discovery and reading

- [Web app routes](https://github.com/littlefoxy067/novel-hub/blob/main/app.js): `app.js`
- [Novel discovery](https://github.com/littlefoxy067/novel-hub/blob/main/app.js): `app.js`
- [Novel details](https://github.com/littlefoxy067/novel-hub/blob/main/app.js): `app.js`
- [Chapter loading](https://github.com/littlefoxy067/novel-hub/blob/main/app.js): `app.js`
- [Chapter reader](https://github.com/littlefoxy067/novel-hub/blob/main/app.js): `app.js`
- [Reading PDF](https://github.com/littlefoxy067/novel-hub/blob/main/app.js): `app.js`

### Personal library

- [Local library](https://github.com/littlefoxy067/novel-hub/blob/main/library.js): `library.js`
- **Browser storage**

### App platform

- [Navigation and install UI](https://github.com/littlefoxy067/novel-hub/blob/main/ui-fixes.js): `ui-fixes.js`
- [Offline cache](https://github.com/littlefoxy067/novel-hub/blob/main/sw.js): `sw.js`
- [Android WebView shell](https://github.com/littlefoxy067/novel-hub/blob/main/android/app/src/main/java/com/littlefoxy/novelhub/MainActivity.java): `android/app/src/main/java/com/littlefoxy/novelhub/MainActivity.java`
- [API detail recovery](https://github.com/littlefoxy067/novel-hub/blob/main/api-recovery.js): `api-recovery.js`

### Sharing services

- [Novel share page](https://github.com/littlefoxy067/novel-hub/blob/main/api/share.js): `api/share.js`
- [Share image proxy](https://github.com/littlefoxy067/novel-hub/blob/main/api/share-image.js): `api/share-image.js`

### Other components

- **Visitor**
- **Novel API**
- **Image transform service**

## Connections

- Visitor → Web app routes: uses (evidence: `README.md`)
- Web app routes → Novel discovery: routes to (evidence: `app.js`)
- Web app routes → Novel details: routes to (evidence: `app.js`)
- Web app routes → Chapter reader: routes to (evidence: `app.js`)
- Novel discovery → Novel API: requests catalogue (evidence: `README.md`)
- Novel details → Novel API: requests details (evidence: `README.md`)
- Novel details → Chapter loading: loads chapters (evidence: `app.js`)
- Chapter loading → Novel API: requests chapters (evidence: `README.md`)
- Chapter reader → Novel API: loads content (evidence: `app.js`)
- Chapter reader → Reading PDF: exports book (evidence: `app.js`)
- Visitor → Local library: manages shelf (evidence: `README.md`)
- Local library → Browser storage: reads and writes (evidence: `library.js`)
- Visitor → Navigation and install UI: uses (evidence: `ui-fixes.js`)
- Visitor → Android WebView shell: uses app
- API detail recovery → Novel API: retries detail (evidence: `api-recovery.js`)
- Visitor → Novel share page: opens shared novel
- Novel share page → Novel API: fetches novel (evidence: `api/share.js`)
- Share image proxy → Novel API: fetches cover (evidence: `api/share-image.js`)
- Share image proxy → Image transform service: transforms image (evidence: `api/share-image.js`)
