# ashok-kumar-btech/ebook-reader architecture

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

- Interactive diagram: https://gitdiagram.com/ashok-kumar-btech/ebook-reader
- Repository: https://github.com/ashok-kumar-btech/ebook-reader

## Overview

Ebook Reader is a local-first, cross-platform reader for files on a device. Its main workflow is to browse a local folder or selected Android documents, choose a supported book, load it through a format-specific adapter, and read, search, navigate its contents, and save reading progress locally. The app also provides library history, bookmarks, themes, and responsive reading layouts. Edges are limited to relationships shown in excerpts, the source index, or the README; some README-described capabilities have no sampled implementation details, so their connections are documented rather than inferred from unsampled code.

Main entry points: [`src/components/ReaderView.tsx`](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/ReaderView.tsx) (Reading View), [`src/adapters/registry.ts`](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/registry.ts) (Adapter Dispatch), [`src/App.tsx`](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/App.tsx) (Ebook Reader), [`src/platform/fs/index.ts`](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/platform/fs/index.ts) (Filesystem Provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Library Browsing"]
  node_reader["Ebook Reader<br/>[App.tsx]"]
  node_library_views["Library Views"]
  node_file_list["Virtualized List"]
  node_breadcrumbs["Breadcrumb Navigation<br/>[BreadcrumbsBar.tsx]"]
  node_launchpad["Recent Folders<br/>[Launchpad.tsx]"]
end

subgraph group_reading["Reading Experience"]
  node_reader_view["Reading View<br/>[ReaderView.tsx]"]
  node_book_controls["Reading Controls<br/>[SettingsDrawer.tsx]"]
  node_search_bookmarks["Search and Bookmarks"]
  node_toc["Table of Contents"]
end

subgraph group_formats["Format Processing"]
  node_formats["Format Definitions<br/>[registry.ts]"]
  node_adapter_registry["Adapter Dispatch<br/>[registry.ts]"]
  node_pdf_adapter["PDF Adapter<br/>[pdfAdapter.ts]"]
  node_epub_adapter["EPUB Adapter<br/>[epubAdapter.ts]"]
  node_cbz_adapter["CBZ Adapter<br/>[cbzAdapter.ts]"]
  node_txt_adapter["Text Adapter<br/>[txtAdapter.ts]"]
  node_html_adapter["HTML and DOCX<br/>[htmlAdapter.ts]"]
end

subgraph group_platform["Platform and State"]
  node_book_state[("Reading Progress<br/>[bookStore.ts]")]
  node_ui_state[("Library Preferences<br/>[uiStore.ts]")]
  node_filesystem["Filesystem Provider<br/>[index.ts]"]
  node_desktop_fs["Desktop Filesystem<br/>[desktop.ts]"]
  node_android_fs["Android SAF<br/>[android.ts]"]
  node_web_fs["Web Filesystem<br/>[web.ts]"]
  node_tauri_bridge["Native Tauri Bridge<br/>[tauriApi.ts]"]
  node_native_commands["Native File Commands<br/>[lib.rs]"]
  node_error_handling["Error Handling<br/>[appError.ts]"]
  node_path_utilities["Path Utilities<br/>[pathUtils.ts]"]
  node_logging["Structured Logging<br/>[LogManager.ts]"]
end

node_local_files[("Local Documents")]
node_user(("Reader"))

node_user -->|"selects books"| node_reader
node_reader -->|"browses files"| node_filesystem
node_filesystem -->|"dispatches to"| node_desktop_fs
node_filesystem -->|"dispatches to"| node_android_fs
node_filesystem -->|"dispatches to"| node_web_fs
node_desktop_fs -->|"calls"| node_tauri_bridge
node_android_fs -->|"checks formats"| node_adapter_registry
node_desktop_fs -->|"checks formats"| node_adapter_registry
node_desktop_fs -->|"checks support"| node_formats
node_tauri_bridge -->|"invokes commands"| node_native_commands
node_reader -->|"renders browsing"| node_library_views
node_reader -->|"renders list"| node_file_list
node_reader -.->|"renders navigation"| node_breadcrumbs
node_reader -->|"renders recents"| node_launchpad
node_reader -->|"opens book"| node_reader_view
node_reader_view -->|"gets adapter"| node_adapter_registry
node_adapter_registry -->|"checks formats"| node_formats
node_adapter_registry -->|"creates adapter"| node_pdf_adapter
node_adapter_registry -->|"creates adapter"| node_epub_adapter
node_adapter_registry -->|"creates adapter"| node_cbz_adapter
node_adapter_registry -->|"creates adapter"| node_txt_adapter
node_adapter_registry -->|"creates adapter"| node_html_adapter
node_reader_view -->|"shows settings"| node_book_controls
node_reader_view -->|"shows search"| node_search_bookmarks
node_reader_view -->|"shows contents"| node_toc
node_reader_view -->|"reads progress"| node_book_state
node_reader_view -->|"loads book data"| node_filesystem
node_book_controls -->|"reads capabilities"| node_formats
node_book_state -.->|"persists locally"| node_ui_state
node_ui_state -.->|"persists preferences"| node_filesystem
node_desktop_fs -->|"normalizes errors"| node_error_handling
node_android_fs -->|"normalizes errors"| node_error_handling
node_reader_view -->|"uses path helpers"| node_path_utilities
node_reader -.->|"updates preferences"| node_ui_state
node_reader_view -->|"records events"| node_logging
node_local_files -.->|"provides documents"| node_filesystem

click node_reader "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/App.tsx"
click node_library_views "https://github.com/ashok-kumar-btech/ebook-reader/tree/main/src/components/shell"
click node_file_list "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/VirtualizedFileList.tsx"
click node_breadcrumbs "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/shell/BreadcrumbsBar.tsx"
click node_launchpad "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/shell/Launchpad.tsx"
click node_reader_view "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/ReaderView.tsx"
click node_book_controls "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/SettingsDrawer.tsx"
click node_search_bookmarks "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/SearchAndBookmarksDrawer.tsx"
click node_toc "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/TableOfContentsDrawer.tsx"
click node_book_state "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/stores/bookStore.ts"
click node_ui_state "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/stores/uiStore.ts"
click node_formats "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/formats/registry.ts"
click node_adapter_registry "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/registry.ts"
click node_pdf_adapter "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/pdfAdapter.ts"
click node_epub_adapter "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/epubAdapter.ts"
click node_cbz_adapter "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/cbzAdapter.ts"
click node_txt_adapter "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/txtAdapter.ts"
click node_html_adapter "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/htmlAdapter.ts"
click node_filesystem "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/platform/fs/index.ts"
click node_desktop_fs "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/platform/fs/desktop.ts"
click node_android_fs "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/platform/fs/android.ts"
click node_web_fs "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/platform/fs/web.ts"
click node_tauri_bridge "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/utils/tauriApi.ts"
click node_native_commands "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src-tauri/src/lib.rs"
click node_error_handling "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/errors/appError.ts"
click node_path_utilities "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/utils/pathUtils.ts"
click node_logging "https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/utils/logger/LogManager.ts"

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_reader,node_library_views,node_file_list,node_breadcrumbs,node_launchpad toneBlue
class node_reader_view,node_book_controls,node_search_bookmarks,node_toc,node_local_files toneAmber
class node_formats,node_adapter_registry,node_pdf_adapter,node_epub_adapter,node_cbz_adapter,node_txt_adapter,node_html_adapter toneMint
class node_book_state,node_ui_state,node_filesystem,node_desktop_fs,node_android_fs,node_web_fs,node_tauri_bridge,node_native_commands,node_error_handling,node_path_utilities,node_logging toneRose
class node_user toneIndigo
```

## Components

### Library Browsing

- [Ebook Reader](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/App.tsx): `src/App.tsx`
- [Library Views](https://github.com/ashok-kumar-btech/ebook-reader/tree/main/src/components/shell): `src/components/shell`
- [Virtualized List](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/VirtualizedFileList.tsx): `src/components/VirtualizedFileList.tsx`
- [Breadcrumb Navigation](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/shell/BreadcrumbsBar.tsx): `src/components/shell/BreadcrumbsBar.tsx`
- [Recent Folders](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/shell/Launchpad.tsx): `src/components/shell/Launchpad.tsx`

### Reading Experience

- [Reading View](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/ReaderView.tsx): `src/components/ReaderView.tsx`
- [Reading Controls](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/SettingsDrawer.tsx): `src/components/SettingsDrawer.tsx`
- [Search and Bookmarks](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/SearchAndBookmarksDrawer.tsx): `src/components/SearchAndBookmarksDrawer.tsx`
- [Table of Contents](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/components/TableOfContentsDrawer.tsx): `src/components/TableOfContentsDrawer.tsx`

### Format Processing

- [Format Definitions](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/formats/registry.ts): `src/formats/registry.ts`
- [Adapter Dispatch](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/registry.ts): `src/adapters/registry.ts`
- [PDF Adapter](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/pdfAdapter.ts): `src/adapters/pdfAdapter.ts`
- [EPUB Adapter](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/epubAdapter.ts): `src/adapters/epubAdapter.ts`
- [CBZ Adapter](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/cbzAdapter.ts): `src/adapters/cbzAdapter.ts`
- [Text Adapter](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/txtAdapter.ts): `src/adapters/txtAdapter.ts`
- [HTML and DOCX](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/adapters/htmlAdapter.ts): `src/adapters/htmlAdapter.ts`

### Platform and State

- [Reading Progress](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/stores/bookStore.ts): `src/stores/bookStore.ts`
- [Library Preferences](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/stores/uiStore.ts): `src/stores/uiStore.ts`
- [Filesystem Provider](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/platform/fs/index.ts): `src/platform/fs/index.ts`
- [Desktop Filesystem](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/platform/fs/desktop.ts): `src/platform/fs/desktop.ts`
- [Android SAF](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/platform/fs/android.ts): `src/platform/fs/android.ts`
- [Web Filesystem](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/platform/fs/web.ts): `src/platform/fs/web.ts`
- [Native Tauri Bridge](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/utils/tauriApi.ts): `src/utils/tauriApi.ts`
- [Native File Commands](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Error Handling](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/errors/appError.ts): `src/errors/appError.ts`
- [Path Utilities](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/utils/pathUtils.ts): `src/utils/pathUtils.ts`
- [Structured Logging](https://github.com/ashok-kumar-btech/ebook-reader/blob/main/src/utils/logger/LogManager.ts): `src/utils/logger/LogManager.ts`

### Other components

- **Local Documents**
- **Reader**

## Connections

- Reader → Ebook Reader: selects books (evidence: `README.md`)
- Ebook Reader → Filesystem Provider: browses files (evidence: `src/App.tsx`)
- Filesystem Provider → Desktop Filesystem: dispatches to (evidence: `src/platform/fs/index.ts`)
- Filesystem Provider → Android SAF: dispatches to (evidence: `src/platform/fs/index.ts`)
- Filesystem Provider → Web Filesystem: dispatches to (evidence: `src/platform/fs/index.ts`)
- Desktop Filesystem → Native Tauri Bridge: calls (evidence: `src/platform/fs/desktop.ts`)
- Android SAF → Adapter Dispatch: checks formats (evidence: `src/platform/fs/android.ts`)
- Desktop Filesystem → Adapter Dispatch: checks formats (evidence: `src/platform/fs/desktop.ts`)
- Desktop Filesystem → Format Definitions: checks support (evidence: `src/platform/fs/desktop.ts`)
- Native Tauri Bridge → Native File Commands: invokes commands (evidence: `src/utils/tauriApi.ts`)
- Ebook Reader → Library Views: renders browsing (evidence: `src/App.tsx`)
- Ebook Reader → Virtualized List: renders list (evidence: `src/App.tsx`)
- Ebook Reader → Breadcrumb Navigation: renders navigation (evidence: `src/App.tsx`)
- Ebook Reader → Recent Folders: renders recents (evidence: `src/App.tsx`)
- Ebook Reader → Reading View: opens book (evidence: `src/App.tsx`)
- Reading View → Adapter Dispatch: gets adapter (evidence: `src/components/ReaderView.tsx`)
- Adapter Dispatch → Format Definitions: checks formats (evidence: `src/adapters/registry.ts`)
- Adapter Dispatch → PDF Adapter: creates adapter (evidence: `src/adapters/registry.ts`)
- Adapter Dispatch → EPUB Adapter: creates adapter (evidence: `src/adapters/registry.ts`)
- Adapter Dispatch → CBZ Adapter: creates adapter (evidence: `src/adapters/registry.ts`)
- Adapter Dispatch → Text Adapter: creates adapter (evidence: `src/adapters/registry.ts`)
- Adapter Dispatch → HTML and DOCX: creates adapter (evidence: `src/adapters/registry.ts`)
- Reading View → Reading Controls: shows settings (evidence: `src/components/ReaderView.tsx`)
- Reading View → Search and Bookmarks: shows search (evidence: `src/components/ReaderView.tsx`)
- Reading View → Table of Contents: shows contents (evidence: `src/components/ReaderView.tsx`)
- Reading View → Reading Progress: reads progress (evidence: `src/components/ReaderView.tsx`)
- Reading View → Filesystem Provider: loads book data (evidence: `src/components/ReaderView.tsx`)
- Reading Controls → Format Definitions: reads capabilities (evidence: `src/components/SettingsDrawer.tsx`)
- Reading Progress → Library Preferences: persists locally
- Library Preferences → Filesystem Provider: persists preferences
- Desktop Filesystem → Error Handling: normalizes errors (evidence: `src/platform/fs/desktop.ts`)
- Android SAF → Error Handling: normalizes errors (evidence: `src/platform/fs/android.ts`)
- Reading View → Path Utilities: uses path helpers (evidence: `src/components/ReaderView.tsx`)
- Ebook Reader → Library Preferences: updates preferences (evidence: `src/App.tsx`)
- Reading View → Structured Logging: records events (evidence: `src/components/ReaderView.tsx`)
- Local Documents → Filesystem Provider: provides documents
