# ledccn/iyuuautoreseed architecture

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

- Interactive diagram: https://gitdiagram.com/ledccn/iyuuautoreseed
- Repository: https://github.com/ledccn/iyuuautoreseed

## Overview

IYUUAutoReseed is a PHP CLI tool for finding cross-seeding opportunities and moving torrents between download clients. Its documented main workflow loads local configuration, reads seeding torrent hashes from Transmission or qBittorrent, submits them to IYUU’s API, and sends returned torrent links to clients. The README also documents client transfer, multi-client/remote configurations, and notifications. The graph separates these domain stages, but the sampled AutoReseed excerpts are incomplete; edges not directly visible in source rely on the README’s workflow description.

Main entry points: [`app/AutoReseed.php`](https://github.com/ledccn/iyuuautoreseed/blob/master/app/AutoReseed.php) (Reseed engine), [`init.php`](https://github.com/ledccn/iyuuautoreseed/blob/master/init.php) (Environment bootstrap), [`iyuu.php`](https://github.com/ledccn/iyuuautoreseed/blob/master/iyuu.php) (CLI launcher), [`app/Library/Oauth.php`](https://github.com/ledccn/iyuuautoreseed/blob/master/app/Library/Oauth.php) (Site authorization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_cli["CLI launcher<br/>[iyuu.php]"]
  node_bootstrap["Environment bootstrap<br/>[init.php]"]
  node_config["Local configuration<br/>[config.sample.php]"]
end

subgraph group_reseed["Reseeding"]
  node_engine["Reseed engine<br/>[AutoReseed.php]"]
  node_hashes["Hash collection<br/>[AutoReseed.php]"]
  node_iyuuapi{{"IYUU API"}}
  node_siteauth["Site authorization<br/>[Oauth.php]"]
  node_ptsites{{"PT sites"}}
  node_torrentlinks["Torrent links<br/>[AutoReseed.php]"]
end

subgraph group_transfer["Client transfer"]
  node_clientapi{{"Client RPC APIs"}}
  node_transferflow["Torrent transfer<br/>[AutoReseed.php]"]
  node_notifications["Notifications<br/>[helper.php]"]
end

subgraph group_support["Local support"]
  node_cache[("Files and caches<br/>[IFile.php]")]
  node_tables["CLI tables<br/>[Table.php]"]
end

node_operator(("Operator / scheduler"))

node_operator -->|"runs"| node_cli
node_cli -->|"loads"| node_bootstrap
node_bootstrap -->|"loads"| node_config
node_bootstrap -->|"starts"| node_engine
node_engine -->|"authenticates"| node_siteauth
node_siteauth -->|"requests login"| node_iyuuapi
node_engine -.->|"collects hashes"| node_hashes
node_hashes -.->|"reads torrents"| node_clientapi
node_engine -->|"submits hashes"| node_iyuuapi
node_iyuuapi -.->|"returns links"| node_torrentlinks
node_engine -->|"builds links"| node_torrentlinks
node_engine -.->|"adds torrents"| node_clientapi
node_clientapi -->|"downloads torrents"| node_ptsites
node_engine -.->|"runs transfers"| node_transferflow
node_transferflow -->|"moves torrents"| node_clientapi
node_engine -.->|"sends updates"| node_notifications
node_engine -->|"uses cache"| node_cache
node_engine -->|"renders sites"| node_tables

click node_cli "https://github.com/ledccn/iyuuautoreseed/blob/master/iyuu.php"
click node_bootstrap "https://github.com/ledccn/iyuuautoreseed/blob/master/init.php"
click node_config "https://github.com/ledccn/iyuuautoreseed/blob/master/config/config.sample.php"
click node_engine "https://github.com/ledccn/iyuuautoreseed/blob/master/app/AutoReseed.php"
click node_hashes "https://github.com/ledccn/iyuuautoreseed/blob/master/app/AutoReseed.php"
click node_siteauth "https://github.com/ledccn/iyuuautoreseed/blob/master/app/Library/Oauth.php"
click node_torrentlinks "https://github.com/ledccn/iyuuautoreseed/blob/master/app/AutoReseed.php"
click node_transferflow "https://github.com/ledccn/iyuuautoreseed/blob/master/app/AutoReseed.php"
click node_notifications "https://github.com/ledccn/iyuuautoreseed/blob/master/app/helper.php"
click node_cache "https://github.com/ledccn/iyuuautoreseed/blob/master/app/Library/IFile.php"
click node_tables "https://github.com/ledccn/iyuuautoreseed/blob/master/app/Library/Table.php"

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_cli,node_bootstrap,node_config toneBlue
class node_engine,node_hashes,node_iyuuapi,node_siteauth,node_ptsites,node_torrentlinks toneAmber
class node_clientapi,node_transferflow,node_notifications toneMint
class node_cache,node_tables,node_operator toneRose
```

## Components

### CLI entry

- [CLI launcher](https://github.com/ledccn/iyuuautoreseed/blob/master/iyuu.php): `iyuu.php`
- [Environment bootstrap](https://github.com/ledccn/iyuuautoreseed/blob/master/init.php): `init.php`
- [Local configuration](https://github.com/ledccn/iyuuautoreseed/blob/master/config/config.sample.php): `config/config.sample.php`

### Reseeding

- [Reseed engine](https://github.com/ledccn/iyuuautoreseed/blob/master/app/AutoReseed.php): `app/AutoReseed.php`
- [Hash collection](https://github.com/ledccn/iyuuautoreseed/blob/master/app/AutoReseed.php): `app/AutoReseed.php`
- **IYUU API**
- [Site authorization](https://github.com/ledccn/iyuuautoreseed/blob/master/app/Library/Oauth.php): `app/Library/Oauth.php`
- **PT sites**
- [Torrent links](https://github.com/ledccn/iyuuautoreseed/blob/master/app/AutoReseed.php): `app/AutoReseed.php`

### Client transfer

- **Client RPC APIs**
- [Torrent transfer](https://github.com/ledccn/iyuuautoreseed/blob/master/app/AutoReseed.php): `app/AutoReseed.php`
- [Notifications](https://github.com/ledccn/iyuuautoreseed/blob/master/app/helper.php): `app/helper.php`

### Local support

- [Files and caches](https://github.com/ledccn/iyuuautoreseed/blob/master/app/Library/IFile.php): `app/Library/IFile.php`
- [CLI tables](https://github.com/ledccn/iyuuautoreseed/blob/master/app/Library/Table.php): `app/Library/Table.php`

### Other components

- **Operator / scheduler**

## Connections

- Operator / scheduler → CLI launcher: runs (evidence: `readme.md`)
- CLI launcher → Environment bootstrap: loads (evidence: `iyuu.php`)
- Environment bootstrap → Local configuration: loads (evidence: `init.php`)
- Environment bootstrap → Reseed engine: starts (evidence: `init.php`)
- Reseed engine → Site authorization: authenticates (evidence: `app/AutoReseed.php`)
- Site authorization → IYUU API: requests login (evidence: `app/Library/Oauth.php`)
- Reseed engine → Hash collection: collects hashes (evidence: `readme.md`)
- Hash collection → Client RPC APIs: reads torrents (evidence: `readme.md`)
- Reseed engine → IYUU API: submits hashes (evidence: `app/AutoReseed.php`)
- IYUU API → Torrent links: returns links (evidence: `readme.md`)
- Reseed engine → Torrent links: builds links (evidence: `app/AutoReseed.php`)
- Reseed engine → Client RPC APIs: adds torrents (evidence: `readme.md`)
- Client RPC APIs → PT sites: downloads torrents (evidence: `readme.md`)
- Reseed engine → Torrent transfer: runs transfers (evidence: `readme.md`)
- Torrent transfer → Client RPC APIs: moves torrents (evidence: `readme.md`)
- Reseed engine → Notifications: sends updates (evidence: `readme.md`)
- Reseed engine → Files and caches: uses cache (evidence: `app/AutoReseed.php`)
- Reseed engine → CLI tables: renders sites (evidence: `app/AutoReseed.php`)
