# diygod/rsshub architecture

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

- Interactive diagram: https://gitdiagram.com/diygod/rsshub
- Repository: https://github.com/diygod/rsshub

## Overview

RSSHub is a service that aggregates content from many websites and exposes it as RSS feeds for readers and discovery tools. The principal workflow is a reader requesting a feed, RSSHub retrieving source content through a route, and the service returning a feed representation. The tree also shows API endpoints, middleware, caching, and worker/runtime components. Route implementations and most wiring were not sampled, so those relationships are shown as unverified rather than asserted as direct calls.

Main entry points: [`lib/app.worker.tsx`](https://github.com/diygod/rsshub/blob/master/lib/app.worker.tsx) (RSSHub service), [`lib/registry.ts`](https://github.com/diygod/rsshub/blob/master/lib/registry.ts) (Route dispatch), [`lib/routes`](https://github.com/diygod/rsshub/tree/master/lib/routes) (Source routes), [`lib/views/rss.tsx`](https://github.com/diygod/rsshub/blob/master/lib/views/rss.tsx) (RSS renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Service runtime"]
  node_service["RSSHub service<br/>[app.worker.tsx]"]
  node_routing["Route dispatch<br/>[registry.ts]"]
  node_worker["Worker entry<br/>[worker.ts]"]
end

subgraph group_feeds["Feed generation"]
  node_source_routes["Source routes"]
  node_rss_view["RSS renderer<br/>[rss.tsx]"]
  node_atom_view["Atom renderer<br/>[atom.tsx]"]
  node_index_view["Feed views<br/>[index.tsx]"]
end

subgraph group_platform["Runtime services"]
  node_cache["Cache service<br/>[index.worker.ts]"]
  node_config["Service configuration<br/>[config.ts]"]
end

subgraph group_api["API and operations"]
  node_api_routes["API endpoints"]
  node_middleware["Request middleware"]
  node_errors["Error handling<br/>[index.tsx]"]
end

node_reader(("Feed reader"))
node_content_sources(("Content sources"))
node_feed_clients(("RSS clients"))

node_reader -->|"requests feeds"| node_service
node_service -.->|"dispatches requests"| node_routing
node_routing -.->|"selects route"| node_source_routes
node_source_routes -->|"aggregates content"| node_content_sources
node_service -.->|"renders feed"| node_rss_view
node_service -.->|"renders feed"| node_atom_view
node_service -.->|"renders output"| node_index_view
node_service -.->|"uses cache"| node_cache
node_service -.->|"uses settings"| node_config
node_worker -.->|"starts service"| node_service
node_service -.->|"processes requests"| node_middleware
node_service -.->|"handles failures"| node_errors
node_service -.->|"exposes endpoints"| node_api_routes
node_rss_view -->|"returns feed"| node_feed_clients
node_atom_view -.->|"returns feed"| node_feed_clients

click node_service "https://github.com/diygod/rsshub/blob/master/lib/app.worker.tsx"
click node_routing "https://github.com/diygod/rsshub/blob/master/lib/registry.ts"
click node_source_routes "https://github.com/diygod/rsshub/tree/master/lib/routes"
click node_rss_view "https://github.com/diygod/rsshub/blob/master/lib/views/rss.tsx"
click node_atom_view "https://github.com/diygod/rsshub/blob/master/lib/views/atom.tsx"
click node_index_view "https://github.com/diygod/rsshub/blob/master/lib/views/index.tsx"
click node_cache "https://github.com/diygod/rsshub/blob/master/lib/utils/cache/index.worker.ts"
click node_config "https://github.com/diygod/rsshub/blob/master/lib/config.ts"
click node_worker "https://github.com/diygod/rsshub/blob/master/lib/worker.ts"
click node_api_routes "https://github.com/diygod/rsshub/tree/master/lib/api"
click node_middleware "https://github.com/diygod/rsshub/tree/master/lib/middleware"
click node_errors "https://github.com/diygod/rsshub/blob/master/lib/errors/index.tsx"

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_service,node_routing,node_worker,node_feed_clients toneBlue
class node_source_routes,node_rss_view,node_atom_view,node_index_view toneAmber
class node_cache,node_config toneMint
class node_api_routes,node_middleware,node_errors toneRose
class node_reader,node_content_sources toneIndigo
```

## Components

### Service runtime

- [RSSHub service](https://github.com/diygod/rsshub/blob/master/lib/app.worker.tsx): `lib/app.worker.tsx`
- [Route dispatch](https://github.com/diygod/rsshub/blob/master/lib/registry.ts): `lib/registry.ts`
- [Worker entry](https://github.com/diygod/rsshub/blob/master/lib/worker.ts): `lib/worker.ts`

### Feed generation

- [Source routes](https://github.com/diygod/rsshub/tree/master/lib/routes): `lib/routes`
- [RSS renderer](https://github.com/diygod/rsshub/blob/master/lib/views/rss.tsx): `lib/views/rss.tsx`
- [Atom renderer](https://github.com/diygod/rsshub/blob/master/lib/views/atom.tsx): `lib/views/atom.tsx`
- [Feed views](https://github.com/diygod/rsshub/blob/master/lib/views/index.tsx): `lib/views/index.tsx`

### Runtime services

- [Cache service](https://github.com/diygod/rsshub/blob/master/lib/utils/cache/index.worker.ts): `lib/utils/cache/index.worker.ts`
- [Service configuration](https://github.com/diygod/rsshub/blob/master/lib/config.ts): `lib/config.ts`

### API and operations

- [API endpoints](https://github.com/diygod/rsshub/tree/master/lib/api): `lib/api`
- [Request middleware](https://github.com/diygod/rsshub/tree/master/lib/middleware): `lib/middleware`
- [Error handling](https://github.com/diygod/rsshub/blob/master/lib/errors/index.tsx): `lib/errors/index.tsx`

### Other components

- **Feed reader**
- **Content sources**
- **RSS clients**

## Connections

- Feed reader → RSSHub service: requests feeds
- RSSHub service → Route dispatch: dispatches requests
- Route dispatch → Source routes: selects route
- Source routes → Content sources: aggregates content
- RSSHub service → RSS renderer: renders feed
- RSSHub service → Atom renderer: renders feed
- RSSHub service → Feed views: renders output
- RSSHub service → Cache service: uses cache
- RSSHub service → Service configuration: uses settings
- Worker entry → RSSHub service: starts service
- RSSHub service → Request middleware: processes requests
- RSSHub service → Error handling: handles failures
- RSSHub service → API endpoints: exposes endpoints
- RSS renderer → RSS clients: returns feed
- Atom renderer → RSS clients: returns feed
