# bariskisir/epubreader architecture

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

- Interactive diagram: https://gitdiagram.com/bariskisir/epubreader
- Repository: https://github.com/bariskisir/epubreader

## Overview

EPUB Reader is a client-side reader: users open a book from a URL or local upload, the app opens and renders it, and saved library and reading state support later visits. Playback can read the current page aloud using Deepgram or browser speech. The sampled source is partial, so the graph keeps uncertain wiring—such as how startup telemetry is invoked—out of the map.

Main entry points: [`src/main.tsx`](https://github.com/bariskisir/epubreader/blob/master/src/main.tsx) (Reader), [`src/telemetry.ts`](https://github.com/bariskisir/epubreader/blob/master/src/telemetry.ts) (Startup telemetry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reading["Reading experience"]
  node_reader["Reader<br/>[main.tsx]"]
  node_epubjs["EPUB.js"]
end

subgraph group_library["Books and state"]
  node_libraryui["Book library<br/>[main.tsx]"]
  node_localstate[("Browser local storage")]
  node_uploadstore[("Uploaded EPUB store<br/>[main.tsx]")]
end

subgraph group_speech["Speech and telemetry"]
  node_speechplayback["Speech playback<br/>[main.tsx]"]
  node_deepgram["Deepgram TTS"]
  node_webspeech["Web Speech API"]
  node_telemetry["Startup telemetry<br/>[telemetry.ts]"]
end

node_person(("Reader"))
node_booksource["EPUB URL host"]
node_localfile["Local EPUB file"]
node_insights["Application Insights"]

node_person -->|"opens book"| node_reader
node_booksource -->|"provides EPUB URL"| node_reader
node_localfile -->|"uploads EPUB"| node_reader
node_reader -->|"opens and renders"| node_epubjs
node_reader -->|"fetches EPUB"| node_booksource
node_reader -->|"manages books"| node_libraryui
node_reader -->|"persists settings and progress"| node_localstate
node_reader -->|"saves and reads uploads"| node_uploadstore
node_reader -->|"starts page playback"| node_speechplayback
node_speechplayback -.->|"requests speech audio"| node_deepgram
node_speechplayback -.->|"uses browser speech"| node_webspeech
node_telemetry -->|"posts startup event"| node_insights

click node_reader "https://github.com/bariskisir/epubreader/blob/master/src/main.tsx"
click node_libraryui "https://github.com/bariskisir/epubreader/blob/master/src/main.tsx"
click node_uploadstore "https://github.com/bariskisir/epubreader/blob/master/src/main.tsx"
click node_speechplayback "https://github.com/bariskisir/epubreader/blob/master/src/main.tsx"
click node_telemetry "https://github.com/bariskisir/epubreader/blob/master/src/telemetry.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_epubjs toneBlue
class node_libraryui,node_localstate,node_uploadstore toneAmber
class node_speechplayback,node_deepgram,node_webspeech,node_telemetry toneMint
class node_person,node_booksource,node_localfile,node_insights toneIndigo
```

## Components

### Reading experience

- [Reader](https://github.com/bariskisir/epubreader/blob/master/src/main.tsx): `src/main.tsx`
- **EPUB.js**

### Books and state

- [Book library](https://github.com/bariskisir/epubreader/blob/master/src/main.tsx): `src/main.tsx`
- **Browser local storage**
- [Uploaded EPUB store](https://github.com/bariskisir/epubreader/blob/master/src/main.tsx): `src/main.tsx`

### Speech and telemetry

- [Speech playback](https://github.com/bariskisir/epubreader/blob/master/src/main.tsx): `src/main.tsx`
- **Deepgram TTS**
- **Web Speech API**
- [Startup telemetry](https://github.com/bariskisir/epubreader/blob/master/src/telemetry.ts): `src/telemetry.ts`

### Other components

- **Reader**
- **EPUB URL host**
- **Local EPUB file**
- **Application Insights**

## Connections

- Reader → Reader: opens book
- EPUB URL host → Reader: provides EPUB URL
- Local EPUB file → Reader: uploads EPUB
- Reader → EPUB.js: opens and renders
- Reader → EPUB URL host: fetches EPUB
- Reader → Book library: manages books
- Reader → Browser local storage: persists settings and progress
- Reader → Uploaded EPUB store: saves and reads uploads
- Reader → Speech playback: starts page playback
- Speech playback → Deepgram TTS: requests speech audio
- Speech playback → Web Speech API: uses browser speech
- Startup telemetry → Application Insights: posts startup event
