# zpaolo11x/mangabox architecture

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

- Interactive diagram: https://gitdiagram.com/zpaolo11x/mangabox
- Repository: https://github.com/zpaolo11x/mangabox

## Overview

MangaBox is a web-technology client for Komga, deployed as a web/PWA, Electron desktop app, or Capacitor mobile app. The principal workflow is to authenticate with a Komga server, browse libraries and series, select a book, and read it. The README also documents filtering, global search, reading controls, thumbnails, themes, and offline books. The excerpts show authentication and Electron offline-book handling; UI feature links not visible in sampled source are documented by the README, so unsampled implementation details are not inferred.

Main entry points: [`index.html`](https://github.com/zpaolo11x/mangabox/blob/main/index.html) (Library browser), [`script-auth.js`](https://github.com/zpaolo11x/mangabox/blob/main/script-auth.js) (Server login), [`package-main.js`](https://github.com/zpaolo11x/mangabox/blob/main/package-main.js) (Electron main process), [`package-preload.js`](https://github.com/zpaolo11x/mangabox/blob/main/package-preload.js) (Preload bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and authentication"]
  node_client["MangaBox client<br/>[index.html]"]
  node_auth["Server login<br/>[script-auth.js]"]
  node_credential["Credential storage<br/>[package-preload.js]"]
end

subgraph group_discovery["Library discovery"]
  node_dashboard["Dashboard<br/>[index.html]"]
  node_library["Library browser<br/>[index.html]"]
  node_filters["Library filters<br/>[index.html]"]
  node_search["Global search<br/>[index.html]"]
  node_series["Series details<br/>[index.html]"]
  node_book["Book selection<br/>[index.html]"]
end

subgraph group_reading["Reading experience"]
  node_reader["Reading mode<br/>[index.html]"]
  node_thumbnails["Page thumbnails<br/>[index.html]"]
  node_readstate["Read controls<br/>[index.html]"]
  node_appearance["Themes and layout"]
end

subgraph group_runtime["Runtime and offline"]
  node_transliteration["Transliteration map"]
  node_electron["Electron main process<br/>[package-main.js]"]
  node_offlinebooks[("Offline book files<br/>[package-main.js]")]
  node_preload["Preload bridge<br/>[package-preload.js]"]
end

node_user(("Reader"))
node_komga["Komga server"]

node_user -->|"uses"| node_client
node_client -->|"authenticates through"| node_auth
node_auth -->|"checks session"| node_komga
node_auth -->|"loads credentials"| node_credential
node_user -->|"opens"| node_dashboard
node_dashboard -->|"browses"| node_library
node_library -->|"filters"| node_filters
node_library -->|"searches"| node_search
node_library -->|"opens series"| node_series
node_series -->|"selects book"| node_book
node_book -->|"opens reader"| node_reader
node_reader -->|"previews pages"| node_thumbnails
node_reader -->|"updates read state"| node_readstate
node_reader -->|"uses reading layout"| node_appearance
node_user -.->|"uses text conversion"| node_transliteration
node_preload -->|"bridges IPC"| node_electron
node_electron -->|"downloads book data"| node_komga
node_electron -->|"writes and reads"| node_offlinebooks

click node_client "https://github.com/zpaolo11x/mangabox/blob/main/index.html"
click node_auth "https://github.com/zpaolo11x/mangabox/blob/main/script-auth.js"
click node_credential "https://github.com/zpaolo11x/mangabox/blob/main/package-preload.js"
click node_dashboard "https://github.com/zpaolo11x/mangabox/blob/main/index.html"
click node_library "https://github.com/zpaolo11x/mangabox/blob/main/index.html"
click node_filters "https://github.com/zpaolo11x/mangabox/blob/main/index.html"
click node_search "https://github.com/zpaolo11x/mangabox/blob/main/index.html"
click node_series "https://github.com/zpaolo11x/mangabox/blob/main/index.html"
click node_book "https://github.com/zpaolo11x/mangabox/blob/main/index.html"
click node_reader "https://github.com/zpaolo11x/mangabox/blob/main/index.html"
click node_thumbnails "https://github.com/zpaolo11x/mangabox/blob/main/index.html"
click node_readstate "https://github.com/zpaolo11x/mangabox/blob/main/index.html"
click node_appearance "https://github.com/zpaolo11x/mangabox/blob/main/style-mangabox-reader.css"
click node_transliteration "https://github.com/zpaolo11x/mangabox/blob/main/script-transliterate.js"
click node_electron "https://github.com/zpaolo11x/mangabox/blob/main/package-main.js"
click node_offlinebooks "https://github.com/zpaolo11x/mangabox/blob/main/package-main.js"
click node_preload "https://github.com/zpaolo11x/mangabox/blob/main/package-preload.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_client,node_auth,node_credential toneBlue
class node_dashboard,node_library,node_filters,node_search,node_series,node_book toneAmber
class node_reader,node_thumbnails,node_readstate,node_appearance,node_komga toneMint
class node_transliteration,node_electron,node_offlinebooks,node_preload toneRose
class node_user toneIndigo
```

## Components

### Access and authentication

- [MangaBox client](https://github.com/zpaolo11x/mangabox/blob/main/index.html): `index.html`
- [Server login](https://github.com/zpaolo11x/mangabox/blob/main/script-auth.js): `script-auth.js`
- [Credential storage](https://github.com/zpaolo11x/mangabox/blob/main/package-preload.js): `package-preload.js`

### Library discovery

- [Dashboard](https://github.com/zpaolo11x/mangabox/blob/main/index.html): `index.html`
- [Library browser](https://github.com/zpaolo11x/mangabox/blob/main/index.html): `index.html`
- [Library filters](https://github.com/zpaolo11x/mangabox/blob/main/index.html): `index.html`
- [Global search](https://github.com/zpaolo11x/mangabox/blob/main/index.html): `index.html`
- [Series details](https://github.com/zpaolo11x/mangabox/blob/main/index.html): `index.html`
- [Book selection](https://github.com/zpaolo11x/mangabox/blob/main/index.html): `index.html`

### Reading experience

- [Reading mode](https://github.com/zpaolo11x/mangabox/blob/main/index.html): `index.html`
- [Page thumbnails](https://github.com/zpaolo11x/mangabox/blob/main/index.html): `index.html`
- [Read controls](https://github.com/zpaolo11x/mangabox/blob/main/index.html): `index.html`
- [Themes and layout](https://github.com/zpaolo11x/mangabox/blob/main/style-mangabox-reader.css): `style-mangabox-reader.css`

### Runtime and offline

- [Transliteration map](https://github.com/zpaolo11x/mangabox/blob/main/script-transliterate.js): `script-transliterate.js`
- [Electron main process](https://github.com/zpaolo11x/mangabox/blob/main/package-main.js): `package-main.js`
- [Offline book files](https://github.com/zpaolo11x/mangabox/blob/main/package-main.js): `package-main.js`
- [Preload bridge](https://github.com/zpaolo11x/mangabox/blob/main/package-preload.js): `package-preload.js`

### Other components

- **Reader**
- **Komga server**

## Connections

- Reader → MangaBox client: uses (evidence: `README.md`)
- MangaBox client → Server login: authenticates through (evidence: `README.md`)
- Server login → Komga server: checks session (evidence: `script-auth.js`)
- Server login → Credential storage: loads credentials (evidence: `script-auth.js`)
- Reader → Dashboard: opens (evidence: `README.md`)
- Dashboard → Library browser: browses (evidence: `README.md`)
- Library browser → Library filters: filters (evidence: `README.md`)
- Library browser → Global search: searches (evidence: `README.md`)
- Library browser → Series details: opens series (evidence: `README.md`)
- Series details → Book selection: selects book (evidence: `README.md`)
- Book selection → Reading mode: opens reader (evidence: `README.md`)
- Reading mode → Page thumbnails: previews pages (evidence: `README.md`)
- Reading mode → Read controls: updates read state (evidence: `README.md`)
- Reading mode → Themes and layout: uses reading layout (evidence: `README.md`)
- Reader → Transliteration map: uses text conversion
- Preload bridge → Electron main process: bridges IPC (evidence: `package-preload.js`)
- Electron main process → Komga server: downloads book data (evidence: `package-main.js`)
- Electron main process → Offline book files: writes and reads (evidence: `package-main.js`)
