# sagarshivaji/learning-hub architecture

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

- Interactive diagram: https://gitdiagram.com/sagarshivaji/learning-hub
- Repository: https://github.com/sagarshivaji/learning-hub

## Overview

Watch Later is a browser-based bookmarking and learning library. Users add links, organize them into colored groups and nested subgroups, move links between them, and mark them done; changes are intended to sync across devices. The sampled server implements a separate Socket.IO path backed by local JSON, while the README documents Supabase cloud persistence and realtime sync. The frontend is a single unsampled HTML file, so its internal component boundaries and exact calls to either sync path cannot be verified; capability nodes therefore share that file path.

Main entry points: [`public/index.html`](https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html) (Learning library UI), [`server.js`](https://github.com/sagarshivaji/learning-hub/blob/main/server.js) (Express and Socket.IO server), [`supabase/migrations`](https://github.com/sagarshivaji/learning-hub/tree/main/supabase/migrations) (Items schema and migrations), [`data.json`](https://github.com/sagarshivaji/learning-hub/blob/main/data.json) (Local item file)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_organize["Library organization"]
  node_browser["Learning library UI<br/>[index.html]"]
  node_links["Link management<br/>[index.html]"]
  node_groups["Groups and colors<br/>[index.html]"]
  node_nesting["Subgroup nesting<br/>[index.html]"]
  node_linkmoves["Link moves<br/>[index.html]"]
  node_quickmove["Quick move modal<br/>[index.html]"]
  node_completion["Completion tracking<br/>[index.html]"]
end

subgraph group_sync["Persistence and sync"]
  node_localdata[("Local item file<br/>[data.json]")]
  node_supaconfig["Supabase connection config<br/>[supabase-config.js]"]
  node_supadb[("Supabase PostgreSQL")]
  node_schema[("Items schema and migrations")]
end

subgraph group_runtime["Application runtime"]
  node_server["Express and Socket.IO server<br/>[server.js]"]
end

node_user(("Library user"))
node_devices(("Connected browsers and devices"))

node_user -->|"uses"| node_browser
node_browser -->|"manages"| node_links
node_browser -->|"organizes"| node_groups
node_browser -->|"nests groups"| node_nesting
node_browser -->|"moves links"| node_linkmoves
node_browser -->|"opens"| node_quickmove
node_browser -->|"checks off"| node_completion
node_browser -.->|"uses realtime"| node_server
node_server -->|"loads and saves"| node_localdata
node_server -->|"broadcasts updates"| node_devices
node_browser -.->|"configures cloud"| node_supaconfig
node_browser -.->|"syncs items"| node_supadb
node_schema -->|"defines schema"| node_supadb
node_supadb -.->|"syncs changes"| node_devices
node_server -->|"serves app"| node_browser

click node_browser "https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html"
click node_links "https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html"
click node_groups "https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html"
click node_nesting "https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html"
click node_linkmoves "https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html"
click node_quickmove "https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html"
click node_completion "https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html"
click node_server "https://github.com/sagarshivaji/learning-hub/blob/main/server.js"
click node_localdata "https://github.com/sagarshivaji/learning-hub/blob/main/data.json"
click node_supaconfig "https://github.com/sagarshivaji/learning-hub/blob/main/public/supabase-config.js"
click node_schema "https://github.com/sagarshivaji/learning-hub/tree/main/supabase/migrations"

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_browser,node_links,node_groups,node_nesting,node_linkmoves,node_quickmove,node_completion,node_user,node_devices toneBlue
class node_localdata,node_supaconfig,node_supadb,node_schema toneAmber
class node_server toneMint
```

## Components

### Library organization

- [Learning library UI](https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html): `public/index.html`
- [Link management](https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html): `public/index.html`
- [Groups and colors](https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html): `public/index.html`
- [Subgroup nesting](https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html): `public/index.html`
- [Link moves](https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html): `public/index.html`
- [Quick move modal](https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html): `public/index.html`
- [Completion tracking](https://github.com/sagarshivaji/learning-hub/blob/main/public/index.html): `public/index.html`

### Persistence and sync

- [Local item file](https://github.com/sagarshivaji/learning-hub/blob/main/data.json): `data.json`
- [Supabase connection config](https://github.com/sagarshivaji/learning-hub/blob/main/public/supabase-config.js): `public/supabase-config.js`
- **Supabase PostgreSQL**
- [Items schema and migrations](https://github.com/sagarshivaji/learning-hub/tree/main/supabase/migrations): `supabase/migrations`

### Application runtime

- [Express and Socket.IO server](https://github.com/sagarshivaji/learning-hub/blob/main/server.js): `server.js`

### Other components

- **Library user**
- **Connected browsers and devices**

## Connections

- Library user → Learning library UI: uses (evidence: `README.md`)
- Learning library UI → Link management: manages (evidence: `README.md`)
- Learning library UI → Groups and colors: organizes (evidence: `README.md`)
- Learning library UI → Subgroup nesting: nests groups (evidence: `README.md`)
- Learning library UI → Link moves: moves links (evidence: `README.md`)
- Learning library UI → Quick move modal: opens (evidence: `README.md`)
- Learning library UI → Completion tracking: checks off (evidence: `README.md`)
- Learning library UI → Express and Socket.IO server: uses realtime
- Express and Socket.IO server → Local item file: loads and saves (evidence: `server.js`)
- Express and Socket.IO server → Connected browsers and devices: broadcasts updates (evidence: `server.js`)
- Learning library UI → Supabase connection config: configures cloud
- Learning library UI → Supabase PostgreSQL: syncs items (evidence: `README.md`)
- Items schema and migrations → Supabase PostgreSQL: defines schema (evidence: `README.md`)
- Supabase PostgreSQL → Connected browsers and devices: syncs changes (evidence: `README.md`)
- Express and Socket.IO server → Learning library UI: serves app (evidence: `server.js`)
