# dhaka88-prog/bookvoice-web architecture

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

- Interactive diagram: https://gitdiagram.com/dhaka88-prog/bookvoice-web
- Repository: https://github.com/dhaka88-prog/bookvoice-web

## Overview

Bookvoice is a static, on-device e-book reader that turns DRM-free files into spoken reading. The main workflow is selecting a book, parsing its format, then playing and navigating its text; the player tracks position and uses the browser’s speech capability. The README also describes highlighting, chapter navigation, speed and voice controls, and a sleep timer. The excerpts show UI-to-parser and UI/player storage interactions, but do not expose the full parsing-to-text-preparation path, so that relationship is omitted.

Main entry points: [`js/ui.js`](https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/ui.js) (Library and controls), [`js/player.js`](https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/player.js) (Playback engine), [`js/storage.js`](https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/storage.js) (Books and progress), [`js/parsers.js`](https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/parsers.js) (Format parsers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_import["Book import"]
  node_parsers["Format parsers<br/>[parsers.js]"]
  node_text["Text preparation<br/>[text.js]"]
end

subgraph group_reading["Reading experience"]
  node_player["Playback engine<br/>[player.js]"]
  node_speech["Browser speech"]
end

subgraph group_local["Local data"]
  node_storage[("Books and progress<br/>[storage.js]")]
  node_settings[("Reader settings<br/>[storage.js]")]
end

subgraph group_interface["User interface"]
  node_ui["Library and controls<br/>[ui.js]"]
end

node_reader(("Book reader"))

node_reader -->|"selects book"| node_ui
node_ui -->|"parses file"| node_parsers
node_ui -->|"reads library"| node_storage
node_ui -->|"controls playback"| node_player
node_player -->|"loads and saves"| node_storage
node_player -->|"speaks sentences"| node_speech

click node_ui "https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/ui.js"
click node_parsers "https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/parsers.js"
click node_text "https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/text.js"
click node_player "https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/player.js"
click node_storage "https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/storage.js"
click node_settings "https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/storage.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_parsers,node_text toneBlue
class node_player,node_speech toneAmber
class node_storage,node_settings toneMint
class node_ui toneRose
class node_reader toneIndigo
```

## Components

### Book import

- [Format parsers](https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/parsers.js): `js/parsers.js`
- [Text preparation](https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/text.js): `js/text.js`

### Reading experience

- [Playback engine](https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/player.js): `js/player.js`
- **Browser speech**

### Local data

- [Books and progress](https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/storage.js): `js/storage.js`
- [Reader settings](https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/storage.js): `js/storage.js`

### User interface

- [Library and controls](https://github.com/dhaka88-prog/bookvoice-web/blob/main/js/ui.js): `js/ui.js`

### Other components

- **Book reader**

## Connections

- Book reader → Library and controls: selects book (evidence: `README.md`)
- Library and controls → Format parsers: parses file (evidence: `js/ui.js`)
- Library and controls → Books and progress: reads library (evidence: `js/ui.js`)
- Library and controls → Playback engine: controls playback (evidence: `js/ui.js`)
- Playback engine → Books and progress: loads and saves (evidence: `js/player.js`)
- Playback engine → Browser speech: speaks sentences (evidence: `js/player.js`)
