# selimy/linkdb architecture

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

- Interactive diagram: https://gitdiagram.com/selimy/linkdb
- Repository: https://github.com/selimy/linkdb

## Overview

LinkDB is a browser-based link archive whose data is stored in Supabase and whose access requires Google sign-in. The user opens the page, signs in, then imports or manages links; edits update the interface immediately and synchronize to the database in the background. The app also supports search, sorting, categories, tags, notes, hide/restore, and themes. Screenshot renewal and purge cleanup use a separate Supabase Edge Function that integrates with GitHub and thum.io. Only the README was available, so relationships below reflect documented behavior, not inspected implementation.

Main entry points: [`index.html`](https://github.com/selimy/linkdb/blob/main/index.html) (LinkDB page), [`images`](https://github.com/selimy/linkdb/tree/main/images) (Committed screenshots)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser app"]
  node_page["LinkDB page<br/>[index.html]"]
  node_link_controls["Link management<br/>[index.html]"]
  node_discovery["Search and display<br/>[index.html]"]
end

subgraph group_data_auth["Data and access"]
  node_memory["In-memory data<br/>[index.html]"]
  node_postgres[("Supabase Postgres")]
  node_supabase_auth["Supabase Auth"]
end

subgraph group_images["Screenshot pipeline"]
  node_renew_purge["Image renew and cleanup"]
  node_edge_function["renew-image function"]
  node_repo_images["Committed screenshots"]
end

node_user(("User"))
node_google["Google OAuth"]
node_github_raw["GitHub raw hosting"]
node_thum["thum.io"]

node_user -->|"opens"| node_page
node_user -->|"manages links"| node_link_controls
node_user -->|"searches and sorts"| node_discovery
node_page -->|"signs in through"| node_supabase_auth
node_supabase_auth -->|"uses OAuth"| node_google
node_page -->|"loads on boot"| node_memory
node_memory -->|"loads and syncs"| node_postgres
node_link_controls -->|"updates immediately"| node_memory
node_link_controls -->|"pushes edits"| node_postgres
node_user -->|"renews or purges"| node_renew_purge
node_renew_purge -->|"routes through"| node_edge_function
node_edge_function -->|"writes images"| node_github_raw
node_edge_function -->|"fetches screenshots"| node_thum
node_github_raw -->|"serves screenshots"| node_repo_images

click node_page "https://github.com/selimy/linkdb/blob/main/index.html"
click node_link_controls "https://github.com/selimy/linkdb/blob/main/index.html"
click node_discovery "https://github.com/selimy/linkdb/blob/main/index.html"
click node_memory "https://github.com/selimy/linkdb/blob/main/index.html"
click node_repo_images "https://github.com/selimy/linkdb/tree/main/images"

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_page,node_link_controls,node_discovery,node_user toneBlue
class node_memory,node_postgres,node_supabase_auth toneAmber
class node_renew_purge,node_edge_function,node_repo_images toneMint
class node_google,node_github_raw,node_thum toneIndigo
```

## Components

### Browser app

- [LinkDB page](https://github.com/selimy/linkdb/blob/main/index.html): `index.html`
- [Link management](https://github.com/selimy/linkdb/blob/main/index.html): `index.html`
- [Search and display](https://github.com/selimy/linkdb/blob/main/index.html): `index.html`

### Data and access

- [In-memory data](https://github.com/selimy/linkdb/blob/main/index.html): `index.html`
- **Supabase Postgres**
- **Supabase Auth**

### Screenshot pipeline

- **Image renew and cleanup**
- **renew-image function**
- [Committed screenshots](https://github.com/selimy/linkdb/tree/main/images): `images`

### Other components

- **User**
- **Google OAuth**
- **GitHub raw hosting**
- **thum.io**

## Connections

- User → LinkDB page: opens (evidence: `README.md`)
- User → Link management: manages links (evidence: `README.md`)
- User → Search and display: searches and sorts (evidence: `README.md`)
- LinkDB page → Supabase Auth: signs in through (evidence: `README.md`)
- Supabase Auth → Google OAuth: uses OAuth (evidence: `README.md`)
- LinkDB page → In-memory data: loads on boot (evidence: `README.md`)
- In-memory data → Supabase Postgres: loads and syncs (evidence: `README.md`)
- Link management → In-memory data: updates immediately (evidence: `README.md`)
- Link management → Supabase Postgres: pushes edits (evidence: `README.md`)
- User → Image renew and cleanup: renews or purges (evidence: `README.md`)
- Image renew and cleanup → renew-image function: routes through (evidence: `README.md`)
- renew-image function → GitHub raw hosting: writes images (evidence: `README.md`)
- renew-image function → thum.io: fetches screenshots (evidence: `README.md`)
- GitHub raw hosting → Committed screenshots: serves screenshots (evidence: `README.md`)
