# qqaazz2/dreader architecture

> Architecture diagram of the GitHub repository qqaazz2/dreader, 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/qqaazz2/dreader
- Repository: https://github.com/qqaazz2/dreader

## Overview

DReader is a cross-platform EPUB reader backed by a self-hosted cloud library. Its principal workflow is reading locally parsed EPUB content while synchronizing reading progress across devices. The README also documents server-side folder scanning, book/series organization, reading-status indicators, statistics, settings, and tag management. Dart implementation excerpts were not provided, so these connections reflect documented capabilities rather than inspected call sites; the sampled code covers only the Windows Flutter host.

Main entry points: [`lib/routes/book/widgets/ReaderView.dart`](https://github.com/qqaazz2/dreader/blob/main/lib/routes/book/widgets/ReaderView.dart) (Reader View), [`lib/main.dart`](https://github.com/qqaazz2/dreader/blob/main/lib/main.dart) (Flutter App), [`lib/routes/HomePage.dart`](https://github.com/qqaazz2/dreader/blob/main/lib/routes/HomePage.dart) (Home Library), [`lib/routes/book`](https://github.com/qqaazz2/dreader/tree/main/lib/routes/book) (Book Pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Reader Client"]
  node_app["Flutter App<br/>[main.dart]"]
  node_login["Sign In<br/>[LoginPage.dart]"]
  node_home["Home Library<br/>[HomePage.dart]"]
end

subgraph group_library["Library Management"]
  node_book_pages["Book Pages"]
  node_author_pages["Author Pages"]
  node_library_state["Library State"]
  node_book_data["Library Data<br/>[FilesList.dart]"]
  node_scan_control["Scan Control<br/>[ScanningPop.dart]"]
  node_status["Reading Status<br/>[BookStatus.dart]"]
end

subgraph group_reading["Reading Experience"]
  node_reader_view["Reader View<br/>[ReaderView.dart]"]
  node_epub_parser["EPUB Parser<br/>[EpubParsing.dart]"]
  node_epub_render["EPUB Rendering<br/>[DomRendering.dart]"]
  node_read_progress["Progress State"]
end

subgraph group_support["Shared Client Services"]
  node_settings["Settings"]
  node_logs["Reading Statistics<br/>[LogPage.dart]"]
  node_api["HTTP API<br/>[HttpApi.dart]"]
end

node_user(("Reader"))
node_server{{"DReader Server"}}

node_user -->|"uses"| node_app
node_app -.->|"offers sign-in"| node_login
node_app -.->|"opens library"| node_home
node_user -->|"reads books"| node_reader_view
node_reader_view -->|"parses locally"| node_epub_parser
node_reader_view -.->|"renders content"| node_epub_render
node_reader_view -->|"tracks progress"| node_read_progress
node_read_progress -->|"syncs progress"| node_api
node_api -->|"exchanges data"| node_server
node_server -->|"syncs across devices"| node_read_progress
node_user -->|"starts scan"| node_scan_control
node_scan_control -.->|"requests scan"| node_api
node_server -->|"organizes books"| node_book_data
node_home -.->|"manages library"| node_book_pages
node_home -.->|"browses authors"| node_author_pages
node_book_pages -.->|"manages listings"| node_library_state
node_library_state -.->|"uses book data"| node_book_data
node_book_pages -->|"shows reading status"| node_status
node_user -.->|"configures reader"| node_settings
node_settings -.->|"views statistics"| node_logs

click node_app "https://github.com/qqaazz2/dreader/blob/main/lib/main.dart"
click node_login "https://github.com/qqaazz2/dreader/blob/main/lib/routes/LoginPage.dart"
click node_home "https://github.com/qqaazz2/dreader/blob/main/lib/routes/HomePage.dart"
click node_book_pages "https://github.com/qqaazz2/dreader/tree/main/lib/routes/book"
click node_author_pages "https://github.com/qqaazz2/dreader/tree/main/lib/routes/author"
click node_settings "https://github.com/qqaazz2/dreader/tree/main/lib/routes/setting"
click node_logs "https://github.com/qqaazz2/dreader/blob/main/lib/routes/LogPage.dart"
click node_reader_view "https://github.com/qqaazz2/dreader/blob/main/lib/routes/book/widgets/ReaderView.dart"
click node_epub_parser "https://github.com/qqaazz2/dreader/blob/main/lib/common/EpubParsing.dart"
click node_epub_render "https://github.com/qqaazz2/dreader/blob/main/lib/epub/DomRendering.dart"
click node_read_progress "https://github.com/qqaazz2/dreader/blob/main/lib/state/book/BookProgressState.dart"
click node_library_state "https://github.com/qqaazz2/dreader/blob/main/lib/state/book/FilesListState.dart"
click node_api "https://github.com/qqaazz2/dreader/blob/main/lib/common/HttpApi.dart"
click node_book_data "https://github.com/qqaazz2/dreader/blob/main/lib/entity/book/FilesList.dart"
click node_scan_control "https://github.com/qqaazz2/dreader/blob/main/lib/common/ScanningPop.dart"
click node_status "https://github.com/qqaazz2/dreader/blob/main/lib/status/BookStatus.dart"

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_login,node_home toneBlue
class node_book_pages,node_author_pages,node_library_state,node_book_data,node_scan_control,node_status toneAmber
class node_reader_view,node_epub_parser,node_epub_render,node_read_progress,node_server toneMint
class node_settings,node_logs,node_api toneRose
class node_user toneIndigo
```

## Components

### Reader Client

- [Flutter App](https://github.com/qqaazz2/dreader/blob/main/lib/main.dart): `lib/main.dart`
- [Sign In](https://github.com/qqaazz2/dreader/blob/main/lib/routes/LoginPage.dart): `lib/routes/LoginPage.dart`
- [Home Library](https://github.com/qqaazz2/dreader/blob/main/lib/routes/HomePage.dart): `lib/routes/HomePage.dart`

### Library Management

- [Book Pages](https://github.com/qqaazz2/dreader/tree/main/lib/routes/book): `lib/routes/book`
- [Author Pages](https://github.com/qqaazz2/dreader/tree/main/lib/routes/author): `lib/routes/author`
- [Library State](https://github.com/qqaazz2/dreader/blob/main/lib/state/book/FilesListState.dart): `lib/state/book/FilesListState.dart`
- [Library Data](https://github.com/qqaazz2/dreader/blob/main/lib/entity/book/FilesList.dart): `lib/entity/book/FilesList.dart`
- [Scan Control](https://github.com/qqaazz2/dreader/blob/main/lib/common/ScanningPop.dart): `lib/common/ScanningPop.dart`
- [Reading Status](https://github.com/qqaazz2/dreader/blob/main/lib/status/BookStatus.dart): `lib/status/BookStatus.dart`

### Reading Experience

- [Reader View](https://github.com/qqaazz2/dreader/blob/main/lib/routes/book/widgets/ReaderView.dart): `lib/routes/book/widgets/ReaderView.dart`
- [EPUB Parser](https://github.com/qqaazz2/dreader/blob/main/lib/common/EpubParsing.dart): `lib/common/EpubParsing.dart`
- [EPUB Rendering](https://github.com/qqaazz2/dreader/blob/main/lib/epub/DomRendering.dart): `lib/epub/DomRendering.dart`
- [Progress State](https://github.com/qqaazz2/dreader/blob/main/lib/state/book/BookProgressState.dart): `lib/state/book/BookProgressState.dart`

### Shared Client Services

- [Settings](https://github.com/qqaazz2/dreader/tree/main/lib/routes/setting): `lib/routes/setting`
- [Reading Statistics](https://github.com/qqaazz2/dreader/blob/main/lib/routes/LogPage.dart): `lib/routes/LogPage.dart`
- [HTTP API](https://github.com/qqaazz2/dreader/blob/main/lib/common/HttpApi.dart): `lib/common/HttpApi.dart`

### Other components

- **Reader**
- **DReader Server**

## Connections

- Reader → Flutter App: uses (evidence: `README.md`)
- Flutter App → Sign In: offers sign-in
- Flutter App → Home Library: opens library
- Reader → Reader View: reads books (evidence: `README.md`)
- Reader View → EPUB Parser: parses locally (evidence: `README.md`)
- Reader View → EPUB Rendering: renders content
- Reader View → Progress State: tracks progress (evidence: `README.md`)
- Progress State → HTTP API: syncs progress (evidence: `README.md`)
- HTTP API → DReader Server: exchanges data (evidence: `README.md`)
- DReader Server → Progress State: syncs across devices (evidence: `README.md`)
- Reader → Scan Control: starts scan (evidence: `README.md`)
- Scan Control → HTTP API: requests scan
- DReader Server → Library Data: organizes books (evidence: `README.md`)
- Home Library → Book Pages: manages library
- Home Library → Author Pages: browses authors
- Book Pages → Library State: manages listings
- Library State → Library Data: uses book data
- Book Pages → Reading Status: shows reading status (evidence: `README.md`)
- Reader → Settings: configures reader
- Settings → Reading Statistics: views statistics
