# tsotraki/openvid architecture

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

- Interactive diagram: https://gitdiagram.com/tsotraki/openvid
- Repository: https://github.com/tsotraki/openvid

## Overview

OpenVid is a privacy-first video search aggregator. A user searches in the browser; the frontend requests the search API, which dispatches to selected public video services, normalizes and filters their results, and returns them for display and playback. The frontend also provides client-side filtering, voice search, and a local library for playlists, favorites, and theme settings. The README documents all five sources and these browser features; excerpts show the search dispatch and several integrations, but not every provider implementation or all UI handlers.

Main entry points: [`server.js`](https://github.com/tsotraki/openvid/blob/main/server.js) (Provider mapping and filters), [`public/js/app.js`](https://github.com/tsotraki/openvid/blob/main/public/js/app.js) (Search and interaction logic), [`public/index.html`](https://github.com/tsotraki/openvid/blob/main/public/index.html) (Search and library UI), [`public/css/styles.css`](https://github.com/tsotraki/openvid/blob/main/public/css/styles.css) (Responsive styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser experience"]
  node_ui["Search and library UI<br/>[index.html]"]
  node_client["Search and interaction logic<br/>[app.js]"]
  node_styles["Responsive styling<br/>[styles.css]"]
end

subgraph group_backend["Search service"]
  node_server["Express app and routes<br/>[server.js]"]
  node_normalization["Provider mapping and filters<br/>[server.js]"]
end

subgraph group_sources["Video sources"]
  node_peertube["PeerTube API"]
  node_archive["Internet Archive API"]
  node_nasa["NASA Library API"]
  node_wikimedia["Wikimedia Commons API"]
  node_dailymotion["Dailymotion API"]
end

node_user(("Video seeker"))
node_localstore[("Browser localStorage")]
node_speech["Web Speech API"]

node_user -->|"searches and browses"| node_ui
node_ui -.->|"provides controls"| node_client
node_client -->|"requests search"| node_server
node_server -->|"serves static files"| node_ui
node_server -->|"dispatches and filters"| node_normalization
node_normalization -->|"queries"| node_peertube
node_normalization -->|"queries"| node_archive
node_normalization -->|"queries"| node_nasa
node_normalization -->|"queries"| node_wikimedia
node_normalization -->|"queries"| node_dailymotion
node_client -->|"stores library and theme"| node_localstore
node_client -->|"recognizes voice queries"| node_speech
node_client -.->|"uses interface styles"| node_styles

click node_ui "https://github.com/tsotraki/openvid/blob/main/public/index.html"
click node_client "https://github.com/tsotraki/openvid/blob/main/public/js/app.js"
click node_styles "https://github.com/tsotraki/openvid/blob/main/public/css/styles.css"
click node_server "https://github.com/tsotraki/openvid/blob/main/server.js"
click node_normalization "https://github.com/tsotraki/openvid/blob/main/server.js"

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_ui,node_client,node_styles toneBlue
class node_server,node_normalization,node_localstore toneAmber
class node_peertube,node_archive,node_nasa,node_wikimedia,node_dailymotion,node_speech toneMint
class node_user toneIndigo
```

## Components

### Browser experience

- [Search and library UI](https://github.com/tsotraki/openvid/blob/main/public/index.html): `public/index.html`
- [Search and interaction logic](https://github.com/tsotraki/openvid/blob/main/public/js/app.js): `public/js/app.js`
- [Responsive styling](https://github.com/tsotraki/openvid/blob/main/public/css/styles.css): `public/css/styles.css`

### Search service

- [Express app and routes](https://github.com/tsotraki/openvid/blob/main/server.js): `server.js`
- [Provider mapping and filters](https://github.com/tsotraki/openvid/blob/main/server.js): `server.js`

### Video sources

- **PeerTube API**
- **Internet Archive API**
- **NASA Library API**
- **Wikimedia Commons API**
- **Dailymotion API**

### Other components

- **Video seeker**
- **Browser localStorage**
- **Web Speech API**

## Connections

- Video seeker → Search and library UI: searches and browses (evidence: `README.md`)
- Search and library UI → Search and interaction logic: provides controls
- Search and interaction logic → Express app and routes: requests search (evidence: `public/js/app.js`)
- Express app and routes → Search and library UI: serves static files (evidence: `server.js`)
- Express app and routes → Provider mapping and filters: dispatches and filters (evidence: `server.js`)
- Provider mapping and filters → PeerTube API: queries (evidence: `server.js`)
- Provider mapping and filters → Internet Archive API: queries (evidence: `server.js`)
- Provider mapping and filters → NASA Library API: queries (evidence: `server.js`)
- Provider mapping and filters → Wikimedia Commons API: queries (evidence: `server.js`)
- Provider mapping and filters → Dailymotion API: queries (evidence: `server.js`)
- Search and interaction logic → Browser localStorage: stores library and theme (evidence: `README.md`)
- Search and interaction logic → Web Speech API: recognizes voice queries (evidence: `public/js/app.js`)
- Search and interaction logic → Responsive styling: uses interface styles
