# jeffuntalan/suwayomi-rakuyomi-source architecture

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

- Interactive diagram: https://gitdiagram.com/jeffuntalan/suwayomi-rakuyomi-source
- Repository: https://github.com/jeffuntalan/suwayomi-rakuyomi-source

## Overview

This is an Aidoku source plugin that lets Rakuyomi/KOReader browse and read a library served by Suwayomi. The main flow is a client request through the source’s handlers, GraphQL queries for manga and chapters, conversion into Aidoku models, then chapter-page URLs returned for reading. The README also documents library search, filters, sorting, categories, recent updates, configurable server settings, and optional Basic Auth. Source excerpts show the principal calls; some endpoint relationships are documented only in the README.

Main entry points: [`src/lib.rs`](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs) (Source Handlers), [`src/api/graphql.rs`](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/api/graphql.rs) (GraphQL Client), [`src/helpers.rs`](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/helpers.rs) (Aidoku Conversion), [`src/api/rest.rs`](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/api/rest.rs) (REST URL Helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Aidoku Source"]
  node_source_runtime["Source Handlers<br/>[lib.rs]"]
  node_settings["Server Settings<br/>[settings.json]"]
  node_library["Library Search<br/>[lib.rs]"]
  node_categories["Category Listings<br/>[lib.rs]"]
  node_manga_details["Manga Details<br/>[lib.rs]"]
  node_chapter_lists["Chapter Lists<br/>[lib.rs]"]
  node_home_recent["Home &amp; Recent<br/>[lib.rs]"]
  node_page_delivery["Chapter Pages<br/>[lib.rs]"]
  node_image_auth["Image Requests<br/>[lib.rs]"]
end

subgraph group_api["Suwayomi API"]
  node_graphql_client["GraphQL Client<br/>[graphql.rs]"]
  node_response_models["Response Models<br/>[models.rs]"]
  node_rest_urls["REST URL Helpers<br/>[rest.rs]"]
end

subgraph group_mapping["Model Mapping"]
  node_aidoku_mapping["Aidoku Conversion<br/>[helpers.rs]"]
end

node_rakuyomi(("Rakuyomi / KOReader"))
node_suwayomi[("Suwayomi Server")]

node_rakuyomi -->|"requests source data"| node_source_runtime
node_source_runtime -.->|"reads settings"| node_settings
node_source_runtime -->|"invokes queries"| node_graphql_client
node_source_runtime -->|"converts responses"| node_aidoku_mapping
node_library -.->|"handled by"| node_source_runtime
node_categories -.->|"handled by"| node_source_runtime
node_manga_details -.->|"handled by"| node_source_runtime
node_chapter_lists -.->|"handled by"| node_source_runtime
node_home_recent -.->|"handled by"| node_source_runtime
node_page_delivery -.->|"handled by"| node_source_runtime
node_image_auth -.->|"handled by"| node_source_runtime
node_graphql_client -->|"deserializes into"| node_response_models
node_aidoku_mapping -->|"maps response data"| node_response_models
node_aidoku_mapping -->|"builds image URLs"| node_rest_urls
node_graphql_client -->|"sends GraphQL requests"| node_suwayomi
node_rest_urls -->|"targets thumbnails"| node_suwayomi
node_page_delivery -->|"gets page URLs"| node_suwayomi
node_image_auth -.->|"fetches images"| node_suwayomi

click node_source_runtime "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs"
click node_settings "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/res/settings.json"
click node_library "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs"
click node_categories "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs"
click node_manga_details "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs"
click node_chapter_lists "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs"
click node_home_recent "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs"
click node_page_delivery "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs"
click node_image_auth "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs"
click node_graphql_client "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/api/graphql.rs"
click node_response_models "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/api/models.rs"
click node_rest_urls "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/api/rest.rs"
click node_aidoku_mapping "https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/helpers.rs"

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_source_runtime,node_settings,node_library,node_categories,node_manga_details,node_chapter_lists,node_home_recent,node_page_delivery,node_image_auth toneBlue
class node_graphql_client,node_response_models,node_rest_urls,node_suwayomi toneAmber
class node_aidoku_mapping toneMint
class node_rakuyomi toneIndigo
```

## Components

### Aidoku Source

- [Source Handlers](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs): `src/lib.rs`
- [Server Settings](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/res/settings.json): `res/settings.json`
- [Library Search](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs): `src/lib.rs`
- [Category Listings](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs): `src/lib.rs`
- [Manga Details](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs): `src/lib.rs`
- [Chapter Lists](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs): `src/lib.rs`
- [Home & Recent](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs): `src/lib.rs`
- [Chapter Pages](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs): `src/lib.rs`
- [Image Requests](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/lib.rs): `src/lib.rs`

### Suwayomi API

- [GraphQL Client](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/api/graphql.rs): `src/api/graphql.rs`
- [Response Models](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/api/models.rs): `src/api/models.rs`
- [REST URL Helpers](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/api/rest.rs): `src/api/rest.rs`

### Model Mapping

- [Aidoku Conversion](https://github.com/jeffuntalan/suwayomi-rakuyomi-source/blob/main/src/helpers.rs): `src/helpers.rs`

### Other components

- **Rakuyomi / KOReader**
- **Suwayomi Server**

## Connections

- Rakuyomi / KOReader → Source Handlers: requests source data (evidence: `README.md`)
- Source Handlers → Server Settings: reads settings
- Source Handlers → GraphQL Client: invokes queries (evidence: `src/lib.rs`)
- Source Handlers → Aidoku Conversion: converts responses (evidence: `src/lib.rs`)
- Library Search → Source Handlers: handled by (evidence: `src/lib.rs`)
- Category Listings → Source Handlers: handled by (evidence: `src/lib.rs`)
- Manga Details → Source Handlers: handled by (evidence: `src/lib.rs`)
- Chapter Lists → Source Handlers: handled by (evidence: `src/lib.rs`)
- Home & Recent → Source Handlers: handled by (evidence: `src/lib.rs`)
- Chapter Pages → Source Handlers: handled by (evidence: `src/lib.rs`)
- Image Requests → Source Handlers: handled by (evidence: `src/lib.rs`)
- GraphQL Client → Response Models: deserializes into (evidence: `src/api/graphql.rs`)
- Aidoku Conversion → Response Models: maps response data (evidence: `src/helpers.rs`)
- Aidoku Conversion → REST URL Helpers: builds image URLs (evidence: `src/helpers.rs`)
- GraphQL Client → Suwayomi Server: sends GraphQL requests (evidence: `src/api/graphql.rs`)
- REST URL Helpers → Suwayomi Server: targets thumbnails (evidence: `README.md`)
- Chapter Pages → Suwayomi Server: gets page URLs (evidence: `README.md`)
- Image Requests → Suwayomi Server: fetches images
