# angelosha/uchiyomi architecture

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

- Interactive diagram: https://gitdiagram.com/angelosha/uchiyomi
- Repository: https://github.com/angelosha/uchiyomi

## Overview

Uchiyomi is a self-hosted manga library, reader, and chapter-downloading server, with a web client and optional desktop shell. The main journey is browsing or following a series, discovering available chapters through configured sources, downloading them into the library, and reading while progress is maintained. Health and repair, release scheduling, household accounts, and tracker integrations are additional product capabilities. The tree and excerpts establish the main modules; the supplied README excerpt is truncated, so some feature relationships are documented rather than verified in implementation.

Main entry points: [`bff/src/server.ts`](https://github.com/angelosha/uchiyomi/blob/main/bff/src/server.ts) (HTTP server), [`bff/src/lib/sources/index.ts`](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/sources/index.ts) (Source adapters), [`web/app/page.tsx`](https://github.com/angelosha/uchiyomi/blob/main/web/app/page.tsx) (Web app), [`bff/src/lib/library.ts`](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/library.ts) (Library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Reader clients"]
  node_reader["Web reader<br/>[page.tsx]"]
  node_web["Web app<br/>[page.tsx]"]
  node_desktop["Desktop shell<br/>[main.js]"]
end

subgraph group_server["Server and library"]
  node_api["HTTP server<br/>[server.ts]"]
  node_library["Library<br/>[library.ts]"]
  node_visibility["Visibility rules<br/>[visibility.ts]"]
  node_db[("PostgreSQL<br/>[db.ts]")]
end

subgraph group_sources["Sources and downloads"]
  node_source_catalog["Source adapters<br/>[index.ts]"]
  node_extension_engine["Extension engine<br/>[client.ts]"]
  node_registration["Source registration<br/>[register.ts]"]
  node_archive["Chapter downloads<br/>[archive.ts]"]
end

subgraph group_operations["Health and scheduling"]
  node_health["Health checks<br/>[health.ts]"]
  node_repair["Repair actions<br/>[repair.ts]"]
  node_updater["Update scheduler<br/>[updater.ts]"]
  node_release_radar["Release radar<br/>[releaseRadar.ts]"]
end

subgraph group_household["Household and integrations"]
  node_auth["Accounts and sign-in<br/>[auth.ts]"]
  node_trackers["Reading trackers<br/>[trackers.ts]"]
end

node_user(("Reader"))

node_user -->|"browses and reads"| node_web
node_web -->|"uses server"| node_api
node_desktop -->|"runs server"| node_api
node_api -.->|"serves library"| node_library
node_api -.->|"offers downloads"| node_archive
node_archive -->|"fetches chapters"| node_source_catalog
node_source_catalog -->|"uses engine"| node_extension_engine
node_registration -->|"records sources"| node_db
node_api -->|"offers health"| node_health
node_health -.->|"supports repair"| node_repair
node_updater -.->|"checks sources"| node_source_catalog
node_release_radar -.->|"shows estimates"| node_user
node_api -.->|"supports accounts"| node_auth
node_reader -.->|"loads chapters"| node_api
node_api -->|"enforces access"| node_visibility
node_library -.->|"stores library data"| node_db
node_api -.->|"supports tracker sync"| node_trackers

click node_reader "https://github.com/angelosha/uchiyomi/blob/main/web/app/reader/page.tsx"
click node_web "https://github.com/angelosha/uchiyomi/blob/main/web/app/page.tsx"
click node_desktop "https://github.com/angelosha/uchiyomi/blob/main/desktop/src/main.js"
click node_api "https://github.com/angelosha/uchiyomi/blob/main/bff/src/server.ts"
click node_library "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/library.ts"
click node_visibility "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/visibility.ts"
click node_db "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/db.ts"
click node_source_catalog "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/sources/index.ts"
click node_extension_engine "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/sources/suwayomi/client.ts"
click node_registration "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/sources/suwayomi/register.ts"
click node_archive "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/archive.ts"
click node_health "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/health.ts"
click node_repair "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/repair.ts"
click node_updater "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/updater.ts"
click node_release_radar "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/releaseRadar.ts"
click node_auth "https://github.com/angelosha/uchiyomi/blob/main/bff/src/routes/auth.ts"
click node_trackers "https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/trackers.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_web,node_desktop toneBlue
class node_api,node_library,node_visibility,node_db toneAmber
class node_source_catalog,node_extension_engine,node_registration,node_archive toneMint
class node_health,node_repair,node_updater,node_release_radar toneRose
class node_auth,node_trackers,node_user toneIndigo
```

## Components

### Reader clients

- [Web reader](https://github.com/angelosha/uchiyomi/blob/main/web/app/reader/page.tsx): `web/app/reader/page.tsx`
- [Web app](https://github.com/angelosha/uchiyomi/blob/main/web/app/page.tsx): `web/app/page.tsx`
- [Desktop shell](https://github.com/angelosha/uchiyomi/blob/main/desktop/src/main.js): `desktop/src/main.js`

### Server and library

- [HTTP server](https://github.com/angelosha/uchiyomi/blob/main/bff/src/server.ts): `bff/src/server.ts`
- [Library](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/library.ts): `bff/src/lib/library.ts`
- [Visibility rules](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/visibility.ts): `bff/src/lib/visibility.ts`
- [PostgreSQL](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/db.ts): `bff/src/lib/db.ts`

### Sources and downloads

- [Source adapters](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/sources/index.ts): `bff/src/lib/sources/index.ts`
- [Extension engine](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/sources/suwayomi/client.ts): `bff/src/lib/sources/suwayomi/client.ts`
- [Source registration](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/sources/suwayomi/register.ts): `bff/src/lib/sources/suwayomi/register.ts`
- [Chapter downloads](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/archive.ts): `bff/src/lib/archive.ts`

### Health and scheduling

- [Health checks](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/health.ts): `bff/src/lib/health.ts`
- [Repair actions](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/repair.ts): `bff/src/lib/repair.ts`
- [Update scheduler](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/updater.ts): `bff/src/lib/updater.ts`
- [Release radar](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/releaseRadar.ts): `bff/src/lib/releaseRadar.ts`

### Household and integrations

- [Accounts and sign-in](https://github.com/angelosha/uchiyomi/blob/main/bff/src/routes/auth.ts): `bff/src/routes/auth.ts`
- [Reading trackers](https://github.com/angelosha/uchiyomi/blob/main/bff/src/lib/trackers.ts): `bff/src/lib/trackers.ts`

### Other components

- **Reader**

## Connections

- Reader → Web app: browses and reads (evidence: `README.md`)
- Web app → HTTP server: uses server (evidence: `README.md`)
- Desktop shell → HTTP server: runs server (evidence: `README.md`)
- HTTP server → Library: serves library (evidence: `bff/src/server.ts`)
- HTTP server → Chapter downloads: offers downloads (evidence: `bff/src/server.ts`)
- Chapter downloads → Source adapters: fetches chapters (evidence: `bff/src/lib/archive.ts`)
- Source adapters → Extension engine: uses engine
- Source registration → PostgreSQL: records sources (evidence: `bff/src/lib/sources/suwayomi/register.ts`)
- HTTP server → Health checks: offers health (evidence: `bff/src/server.ts`)
- Health checks → Repair actions: supports repair
- Update scheduler → Source adapters: checks sources
- Release radar → Reader: shows estimates
- HTTP server → Accounts and sign-in: supports accounts
- Web reader → HTTP server: loads chapters
- HTTP server → Visibility rules: enforces access (evidence: `bff/src/lib/visibility.ts`)
- Library → PostgreSQL: stores library data
- HTTP server → Reading trackers: supports tracker sync
