# weekend-project-space/web2rss architecture

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

- Interactive diagram: https://gitdiagram.com/weekend-project-space/web2rss
- Repository: https://github.com/weekend-project-space/web2rss

## Overview

web2rss is a Flask service that turns website URLs into RSS feeds, with AI-assisted parser generation, route sharing, and RSS proxying. The main workflow discovers or selects a route, fetches the source page, runs its parser, and returns cached RSS XML. Users can also generate parser code with AI and register it as a route. The graph reflects the inspected application and support code; README capabilities are included where their implementation was not sampled, with uncertain wiring omitted.

Main entry points: [`app.py`](https://github.com/weekend-project-space/web2rss/blob/main/app.py) (Flask endpoints), [`support/router.py`](https://github.com/weekend-project-space/web2rss/blob/main/support/router.py) (Route registry), [`support/fetch.py`](https://github.com/weekend-project-space/web2rss/blob/main/support/fetch.py) (Page fetcher), [`support/gpt.py`](https://github.com/weekend-project-space/web2rss/blob/main/support/gpt.py) (AI code generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask endpoints<br/>[app.py]"]
  node_cache["Feed cache<br/>[app.py]"]
  node_config["Configuration<br/>[config.py]"]
end

subgraph group_routes["Route management"]
  node_router["Route registry<br/>[router.py]"]
  node_route["Route handler<br/>[router.py]"]
  node_routefile["Route records<br/>[router.txt]"]
end

subgraph group_rss["RSS generation"]
  node_parserfiles["Parser modules"]
  node_dynamic["Parser runtime<br/>[dyncall.py]"]
  node_fetch["Page fetcher<br/>[fetch.py]"]
  node_preview["Content extraction<br/>[url2mc.py]"]
  node_demo_parser["Example parsers<br/>[demo.py]"]
end

subgraph group_integrations["External services"]
  node_ai["AI code generation<br/>[gpt.py]"]
end

node_user(("User"))
node_source(("Website sources"))
node_gptservice["GPT API"]
node_remote["Remote router"]
node_proxy["RSS proxy"]

node_user -->|"requests"| node_app
node_app -->|"searches routes"| node_router
node_app -->|"reads and writes"| node_cache
node_app -->|"requests code"| node_ai
node_ai -->|"fetches page"| node_fetch
node_ai -->|"sends prompt"| node_gptservice
node_ai -->|"returns code"| node_app
node_app -->|"validates parser"| node_dynamic
node_app -->|"adds or pulls"| node_router
node_router -->|"reads and appends"| node_routefile
node_router -->|"writes pulled parser"| node_parserfiles
node_router -.->|"fetches shared routes"| node_remote
node_router -->|"probes URL"| node_fetch
node_router -->|"selects route"| node_route
node_route -->|"loads parser"| node_dynamic
node_dynamic -->|"imports module"| node_parserfiles
node_demo_parser -->|"fetches page"| node_fetch
node_route -->|"proxies source"| node_fetch
node_route -->|"enriches preview"| node_preview
node_preview -->|"fetches article"| node_fetch
node_fetch -->|"requests page"| node_source
node_fetch -.->|"retries via proxy"| node_proxy
node_app -->|"loads settings"| node_config
node_router -->|"reads settings"| node_config

click node_app "https://github.com/weekend-project-space/web2rss/blob/main/app.py"
click node_cache "https://github.com/weekend-project-space/web2rss/blob/main/app.py"
click node_config "https://github.com/weekend-project-space/web2rss/blob/main/support/config.py"
click node_router "https://github.com/weekend-project-space/web2rss/blob/main/support/router.py"
click node_route "https://github.com/weekend-project-space/web2rss/blob/main/support/router.py"
click node_routefile "https://github.com/weekend-project-space/web2rss/blob/main/router.txt"
click node_parserfiles "https://github.com/weekend-project-space/web2rss/tree/main/repo"
click node_dynamic "https://github.com/weekend-project-space/web2rss/blob/main/support/dyncall.py"
click node_fetch "https://github.com/weekend-project-space/web2rss/blob/main/support/fetch.py"
click node_preview "https://github.com/weekend-project-space/web2rss/blob/main/support/url2mc.py"
click node_ai "https://github.com/weekend-project-space/web2rss/blob/main/support/gpt.py"
click node_demo_parser "https://github.com/weekend-project-space/web2rss/blob/main/repo/demo.py"

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_app,node_cache,node_config,node_user toneBlue
class node_router,node_route,node_routefile toneAmber
class node_parserfiles,node_dynamic,node_fetch,node_preview,node_demo_parser,node_gptservice,node_remote toneMint
class node_ai toneRose
class node_source,node_proxy toneIndigo
```

## Components

### Web application

- [Flask endpoints](https://github.com/weekend-project-space/web2rss/blob/main/app.py): `app.py`
- [Feed cache](https://github.com/weekend-project-space/web2rss/blob/main/app.py): `app.py`
- [Configuration](https://github.com/weekend-project-space/web2rss/blob/main/support/config.py): `support/config.py`

### Route management

- [Route registry](https://github.com/weekend-project-space/web2rss/blob/main/support/router.py): `support/router.py`
- [Route handler](https://github.com/weekend-project-space/web2rss/blob/main/support/router.py): `support/router.py`
- [Route records](https://github.com/weekend-project-space/web2rss/blob/main/router.txt): `router.txt`

### RSS generation

- [Parser modules](https://github.com/weekend-project-space/web2rss/tree/main/repo): `repo`
- [Parser runtime](https://github.com/weekend-project-space/web2rss/blob/main/support/dyncall.py): `support/dyncall.py`
- [Page fetcher](https://github.com/weekend-project-space/web2rss/blob/main/support/fetch.py): `support/fetch.py`
- [Content extraction](https://github.com/weekend-project-space/web2rss/blob/main/support/url2mc.py): `support/url2mc.py`
- [Example parsers](https://github.com/weekend-project-space/web2rss/blob/main/repo/demo.py): `repo/demo.py`

### External services

- [AI code generation](https://github.com/weekend-project-space/web2rss/blob/main/support/gpt.py): `support/gpt.py`

### Other components

- **User**
- **Website sources**
- **GPT API**
- **Remote router**
- **RSS proxy**

## Connections

- User → Flask endpoints: requests
- Flask endpoints → Route registry: searches routes
- Flask endpoints → Feed cache: reads and writes
- Flask endpoints → AI code generation: requests code
- AI code generation → Page fetcher: fetches page
- AI code generation → GPT API: sends prompt
- AI code generation → Flask endpoints: returns code
- Flask endpoints → Parser runtime: validates parser
- Flask endpoints → Route registry: adds or pulls
- Route registry → Route records: reads and appends
- Route registry → Parser modules: writes pulled parser
- Route registry → Remote router: fetches shared routes
- Route registry → Page fetcher: probes URL
- Route registry → Route handler: selects route
- Route handler → Parser runtime: loads parser
- Parser runtime → Parser modules: imports module
- Example parsers → Page fetcher: fetches page
- Route handler → Page fetcher: proxies source
- Route handler → Content extraction: enriches preview
- Content extraction → Page fetcher: fetches article
- Page fetcher → Website sources: requests page
- Page fetcher → RSS proxy: retries via proxy
- Flask endpoints → Configuration: loads settings
- Route registry → Configuration: reads settings
