# ke8vpc/gather architecture

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

- Interactive diagram: https://gitdiagram.com/ke8vpc/gather
- Repository: https://github.com/ke8vpc/gather

## Overview

Gather has two parallel products: the TypeScript/Cloudflare app and a standalone PHP/MySQL conversion. The main workflow is sign-in, importing creator or podcast sources, storing subscriptions, then viewing recent content and recommendations; refresh can also check live status. The README documents imports, playback, filters, and platform integrations. Some runtime wiring—especially how the TypeScript UI calls its routes and unsampled PHP page handlers—is not shown, so those links are omitted rather than inferred.

Main entry points: [`php/app/Connections.php`](https://github.com/ke8vpc/gather/blob/main/php/app/Connections.php) (Account connections), [`php/app/YouTube.php`](https://github.com/ke8vpc/gather/blob/main/php/app/YouTube.php) (YouTube live checks), [`php/app/bootstrap.php`](https://github.com/ke8vpc/gather/blob/main/php/app/bootstrap.php) (PHP runtime and DB), [`app/api/library/route.ts`](https://github.com/ke8vpc/gather/blob/main/app/api/library/route.ts) (Library operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ts["TypeScript app"]
  node_webapp["Library interface<br/>[hub.tsx]"]
  node_tsauth["ChatGPT identity<br/>[chatgpt-auth.ts]"]
  node_libraryapi["Library operations<br/>[route.ts]"]
  node_syncapi["Refresh operations<br/>[route.ts]"]
  node_importformats["Import formats<br/>[imports.ts]"]
end

subgraph group_php["PHP conversion"]
  node_phpentry["PHP sign-in entry<br/>[auth.php]"]
  node_phplibrary["PHP library<br/>[Library.php]"]
  node_phpconnections["Account connections<br/>[Connections.php]"]
  node_phpfeeds["PHP feed parsing<br/>[Feeds.php]"]
  node_youtubechecks["YouTube live checks<br/>[YouTube.php]"]
  node_installer["Site installer<br/>[Installer.php]"]
  node_adminsettings["Admin settings<br/>[AdminSettings.php]"]
  node_phpbootstrap[("PHP runtime and DB<br/>[bootstrap.php]")]
end

subgraph group_shared["Feed and persistence"]
  node_feedlogic["Feed parsing<br/>[feeds.ts]"]
  node_store[("Library store<br/>[store.ts]")]
  node_dbschema["D1 schema<br/>[schema.ts]"]
end

subgraph group_platforms["Provider services"]
  node_twitch["Twitch API"]
  node_youtube["YouTube API"]
  node_podcastfeeds["Public RSS feeds"]
end

node_viewer(("Library user"))

node_viewer -->|"uses"| node_webapp
node_libraryapi -->|"authenticates"| node_tsauth
node_syncapi -->|"authenticates"| node_tsauth
node_libraryapi -->|"reads and writes"| node_store
node_libraryapi -->|"resolves sources"| node_feedlogic
node_syncapi -->|"reads and writes"| node_store
node_syncapi -->|"parses feeds"| node_feedlogic
node_viewer -->|"signs in"| node_phpentry
node_phplibrary -->|"parses feeds"| node_phpfeeds
node_phplibrary -->|"uses links"| node_phpconnections
node_phplibrary -->|"checks channels"| node_youtubechecks
node_phpconnections -->|"uses runtime"| node_phpbootstrap
node_phpconnections -->|"uses feeds"| node_phpfeeds
node_youtubechecks -->|"uses runtime"| node_phpbootstrap
node_youtubechecks -->|"fetches feeds"| node_phpfeeds
node_installer -.->|"configures site"| node_phpbootstrap
node_phpbootstrap -->|"loads settings"| node_adminsettings
node_phpconnections -->|"calls API"| node_twitch
node_phpconnections -->|"calls API"| node_youtube
node_youtubechecks -->|"checks live videos"| node_youtube
node_feedlogic -->|"fetches feeds"| node_podcastfeeds

click node_webapp "https://github.com/ke8vpc/gather/blob/main/app/hub.tsx"
click node_tsauth "https://github.com/ke8vpc/gather/blob/main/app/chatgpt-auth.ts"
click node_libraryapi "https://github.com/ke8vpc/gather/blob/main/app/api/library/route.ts"
click node_syncapi "https://github.com/ke8vpc/gather/blob/main/app/api/sync/route.ts"
click node_importformats "https://github.com/ke8vpc/gather/blob/main/lib/imports.ts"
click node_feedlogic "https://github.com/ke8vpc/gather/blob/main/lib/feeds.ts"
click node_store "https://github.com/ke8vpc/gather/blob/main/db/store.ts"
click node_dbschema "https://github.com/ke8vpc/gather/blob/main/db/schema.ts"
click node_phpentry "https://github.com/ke8vpc/gather/blob/main/php/public/auth.php"
click node_phplibrary "https://github.com/ke8vpc/gather/blob/main/php/app/Library.php"
click node_phpconnections "https://github.com/ke8vpc/gather/blob/main/php/app/Connections.php"
click node_phpfeeds "https://github.com/ke8vpc/gather/blob/main/php/app/Feeds.php"
click node_youtubechecks "https://github.com/ke8vpc/gather/blob/main/php/app/YouTube.php"
click node_installer "https://github.com/ke8vpc/gather/blob/main/php/app/Installer.php"
click node_adminsettings "https://github.com/ke8vpc/gather/blob/main/php/app/AdminSettings.php"
click node_phpbootstrap "https://github.com/ke8vpc/gather/blob/main/php/app/bootstrap.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_webapp,node_tsauth,node_libraryapi,node_syncapi,node_importformats,node_viewer toneBlue
class node_phpentry,node_phplibrary,node_phpconnections,node_phpfeeds,node_youtubechecks,node_installer,node_adminsettings,node_phpbootstrap toneAmber
class node_feedlogic,node_store,node_dbschema toneMint
class node_twitch,node_youtube,node_podcastfeeds toneRose
```

## Components

### TypeScript app

- [Library interface](https://github.com/ke8vpc/gather/blob/main/app/hub.tsx): `app/hub.tsx`
- [ChatGPT identity](https://github.com/ke8vpc/gather/blob/main/app/chatgpt-auth.ts): `app/chatgpt-auth.ts`
- [Library operations](https://github.com/ke8vpc/gather/blob/main/app/api/library/route.ts): `app/api/library/route.ts`
- [Refresh operations](https://github.com/ke8vpc/gather/blob/main/app/api/sync/route.ts): `app/api/sync/route.ts`
- [Import formats](https://github.com/ke8vpc/gather/blob/main/lib/imports.ts): `lib/imports.ts`

### PHP conversion

- [PHP sign-in entry](https://github.com/ke8vpc/gather/blob/main/php/public/auth.php): `php/public/auth.php`
- [PHP library](https://github.com/ke8vpc/gather/blob/main/php/app/Library.php): `php/app/Library.php`
- [Account connections](https://github.com/ke8vpc/gather/blob/main/php/app/Connections.php): `php/app/Connections.php`
- [PHP feed parsing](https://github.com/ke8vpc/gather/blob/main/php/app/Feeds.php): `php/app/Feeds.php`
- [YouTube live checks](https://github.com/ke8vpc/gather/blob/main/php/app/YouTube.php): `php/app/YouTube.php`
- [Site installer](https://github.com/ke8vpc/gather/blob/main/php/app/Installer.php): `php/app/Installer.php`
- [Admin settings](https://github.com/ke8vpc/gather/blob/main/php/app/AdminSettings.php): `php/app/AdminSettings.php`
- [PHP runtime and DB](https://github.com/ke8vpc/gather/blob/main/php/app/bootstrap.php): `php/app/bootstrap.php`

### Feed and persistence

- [Feed parsing](https://github.com/ke8vpc/gather/blob/main/lib/feeds.ts): `lib/feeds.ts`
- [Library store](https://github.com/ke8vpc/gather/blob/main/db/store.ts): `db/store.ts`
- [D1 schema](https://github.com/ke8vpc/gather/blob/main/db/schema.ts): `db/schema.ts`

### Provider services

- **Twitch API**
- **YouTube API**
- **Public RSS feeds**

### Other components

- **Library user**

## Connections

- Library user → Library interface: uses
- Library operations → ChatGPT identity: authenticates
- Refresh operations → ChatGPT identity: authenticates
- Library operations → Library store: reads and writes (evidence: `app/api/library/route.ts`)
- Library operations → Feed parsing: resolves sources (evidence: `app/api/library/route.ts`)
- Refresh operations → Library store: reads and writes (evidence: `app/api/sync/route.ts`)
- Refresh operations → Feed parsing: parses feeds (evidence: `app/api/sync/route.ts`)
- Library user → PHP sign-in entry: signs in
- PHP library → PHP feed parsing: parses feeds (evidence: `php/app/Library.php`)
- PHP library → Account connections: uses links (evidence: `php/app/Library.php`)
- PHP library → YouTube live checks: checks channels (evidence: `php/app/Library.php`)
- Account connections → PHP runtime and DB: uses runtime (evidence: `php/app/Connections.php`)
- Account connections → PHP feed parsing: uses feeds (evidence: `php/app/Connections.php`)
- YouTube live checks → PHP runtime and DB: uses runtime (evidence: `php/app/YouTube.php`)
- YouTube live checks → PHP feed parsing: fetches feeds (evidence: `php/app/YouTube.php`)
- Site installer → PHP runtime and DB: configures site
- PHP runtime and DB → Admin settings: loads settings (evidence: `php/app/bootstrap.php`)
- Account connections → Twitch API: calls API (evidence: `php/app/Connections.php`)
- Account connections → YouTube API: calls API (evidence: `php/app/Connections.php`)
- YouTube live checks → YouTube API: checks live videos (evidence: `php/app/YouTube.php`)
- Feed parsing → Public RSS feeds: fetches feeds (evidence: `lib/feeds.ts`)
