# whyboris/video-hub-app architecture

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

- Interactive diagram: https://gitdiagram.com/whyboris/video-hub-app
- Repository: https://github.com/whyboris/video-hub-app

## Overview

Video Hub App is an Angular/Electron desktop catalog for browsing, searching, and organizing local videos. The main workflow is to choose source folders, extract video metadata and preview assets, then browse and manage the resulting hub in the Angular UI. The README also documents an optional phone/tablet remote server. Relationships below rely on the README and SOURCE INDEX references; unsampled implementation details are not assumed.

Main entry points: [`src/app/components/home.component.ts`](https://github.com/whyboris/video-hub-app/blob/main/src/app/components/home.component.ts) (Hub browsing), [`main.ts`](https://github.com/whyboris/video-hub-app/blob/main/main.ts) (Electron main), [`node/main-extract-async.ts`](https://github.com/whyboris/video-hub-app/blob/main/node/main-extract-async.ts) (Folder scanning), [`node/main-ipc.ts`](https://github.com/whyboris/video-hub-app/blob/main/node/main-ipc.ts) (IPC handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop runtime"]
  node_electron["Electron main<br/>[main.ts]"]
  node_globals["Runtime state<br/>[main-globals.ts]"]
  node_ipc["IPC handlers<br/>[main-ipc.ts]"]
  node_remote["Remote server<br/>[server.ts]"]
  node_touchbar["Touch Bar<br/>[main-touch-bar.ts]"]
end

subgraph group_catalog["Hub creation"]
  node_scanner["Folder scanning"]
  node_metadata["Video metadata<br/>[main-extract.ts]"]
  node_filenames["Filename handling<br/>[main-filenames.ts]"]
  node_support["Hub utilities<br/>[main-support.ts]"]
end

subgraph group_ui["Browsing and organization"]
  node_app["Angular application<br/>[app.module.ts]"]
  node_home["Hub browsing<br/>[home.component.ts]"]
  node_views["Video views"]
  node_search["Search and filters"]
  node_manualtags["Manual tags"]
  node_autotags["Automatic tags"]
  node_statistics["Statistics"]
  node_media["Media paths"]
  node_elements["Video state"]
  node_settings["Settings actions"]
end

subgraph group_shared["Shared data and settings"]
  node_finalmodel["Video record model"]
  node_settingsmodel["Settings model"]
  node_sharedmodel["Shared UI types"]
end

node_user(("Desktop user"))

node_user -->|"operates"| node_electron
node_electron -->|"initializes"| node_globals
node_electron -->|"configures"| node_ipc
node_electron -->|"starts extraction"| node_scanner
node_electron -->|"uses utilities"| node_support
node_electron -->|"starts server"| node_remote
node_electron -->|"configures"| node_touchbar
node_scanner -->|"extracts metadata"| node_metadata
node_scanner -->|"uses filenames"| node_filenames
node_scanner -->|"uses utilities"| node_support
node_support -->|"resets watchers"| node_scanner
node_ipc -->|"dispatches extraction"| node_scanner
node_ipc -->|"requests extraction"| node_metadata
node_app -->|"declares"| node_home
node_home -->|"requests hub actions"| node_ipc
node_home -->|"uses search controls"| node_search
node_home -->|"selects views"| node_views
node_home -->|"manages tags"| node_manualtags
node_home -->|"uses auto tags"| node_autotags
node_home -->|"shows statistics"| node_statistics
node_home -->|"uses file paths"| node_media
node_home -->|"updates video state"| node_elements
node_home -->|"uses settings actions"| node_settings
node_media -->|"reads source folders"| node_statistics
node_autotags -->|"uses video records"| node_finalmodel
node_manualtags -->|"uses video records"| node_finalmodel
node_elements -->|"stores video records"| node_finalmodel
node_home -->|"uses video records"| node_finalmodel
node_electron -->|"uses saved settings"| node_settingsmodel
node_home -->|"uses shared types"| node_sharedmodel

click node_electron "https://github.com/whyboris/video-hub-app/blob/main/main.ts"
click node_globals "https://github.com/whyboris/video-hub-app/blob/main/node/main-globals.ts"
click node_ipc "https://github.com/whyboris/video-hub-app/blob/main/node/main-ipc.ts"
click node_remote "https://github.com/whyboris/video-hub-app/blob/main/node/server.ts"
click node_touchbar "https://github.com/whyboris/video-hub-app/blob/main/node/main-touch-bar.ts"
click node_scanner "https://github.com/whyboris/video-hub-app/blob/main/node/main-extract-async.ts"
click node_metadata "https://github.com/whyboris/video-hub-app/blob/main/node/main-extract.ts"
click node_filenames "https://github.com/whyboris/video-hub-app/blob/main/node/main-filenames.ts"
click node_support "https://github.com/whyboris/video-hub-app/blob/main/node/main-support.ts"
click node_app "https://github.com/whyboris/video-hub-app/blob/main/src/app/app.module.ts"
click node_home "https://github.com/whyboris/video-hub-app/blob/main/src/app/components/home.component.ts"
click node_views "https://github.com/whyboris/video-hub-app/tree/main/src/app/components/views"
click node_search "https://github.com/whyboris/video-hub-app/blob/main/src/app/components/search-boxes/search-boxes.component.ts"
click node_manualtags "https://github.com/whyboris/video-hub-app/blob/main/src/app/components/tags-manual/manual-tags.service.ts"
click node_autotags "https://github.com/whyboris/video-hub-app/blob/main/src/app/components/tags-auto/autotags.service.ts"
click node_statistics "https://github.com/whyboris/video-hub-app/blob/main/src/app/components/statistics/statistics.component.ts"
click node_media "https://github.com/whyboris/video-hub-app/blob/main/src/app/components/views/file-path.service.ts"
click node_elements "https://github.com/whyboris/video-hub-app/blob/main/src/app/services/image-element.service.ts"
click node_settings "https://github.com/whyboris/video-hub-app/blob/main/src/app/common/settings-buttons.ts"
click node_finalmodel "https://github.com/whyboris/video-hub-app/blob/main/interfaces/final-object.interface.ts"
click node_settingsmodel "https://github.com/whyboris/video-hub-app/blob/main/interfaces/settings-object.interface.ts"
click node_sharedmodel "https://github.com/whyboris/video-hub-app/blob/main/interfaces/shared-interfaces.ts"

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_electron,node_globals,node_ipc,node_remote,node_touchbar,node_user toneBlue
class node_scanner,node_metadata,node_filenames,node_support toneAmber
class node_app,node_home,node_views,node_search,node_manualtags,node_autotags,node_statistics,node_media,node_elements,node_settings toneMint
class node_finalmodel,node_settingsmodel,node_sharedmodel toneRose
```

## Components

### Desktop runtime

- [Electron main](https://github.com/whyboris/video-hub-app/blob/main/main.ts): `main.ts`
- [Runtime state](https://github.com/whyboris/video-hub-app/blob/main/node/main-globals.ts): `node/main-globals.ts`
- [IPC handlers](https://github.com/whyboris/video-hub-app/blob/main/node/main-ipc.ts): `node/main-ipc.ts`
- [Remote server](https://github.com/whyboris/video-hub-app/blob/main/node/server.ts): `node/server.ts`
- [Touch Bar](https://github.com/whyboris/video-hub-app/blob/main/node/main-touch-bar.ts): `node/main-touch-bar.ts`

### Hub creation

- [Folder scanning](https://github.com/whyboris/video-hub-app/blob/main/node/main-extract-async.ts): `node/main-extract-async.ts`
- [Video metadata](https://github.com/whyboris/video-hub-app/blob/main/node/main-extract.ts): `node/main-extract.ts`
- [Filename handling](https://github.com/whyboris/video-hub-app/blob/main/node/main-filenames.ts): `node/main-filenames.ts`
- [Hub utilities](https://github.com/whyboris/video-hub-app/blob/main/node/main-support.ts): `node/main-support.ts`

### Browsing and organization

- [Angular application](https://github.com/whyboris/video-hub-app/blob/main/src/app/app.module.ts): `src/app/app.module.ts`
- [Hub browsing](https://github.com/whyboris/video-hub-app/blob/main/src/app/components/home.component.ts): `src/app/components/home.component.ts`
- [Video views](https://github.com/whyboris/video-hub-app/tree/main/src/app/components/views): `src/app/components/views`
- [Search and filters](https://github.com/whyboris/video-hub-app/blob/main/src/app/components/search-boxes/search-boxes.component.ts): `src/app/components/search-boxes/search-boxes.component.ts`
- [Manual tags](https://github.com/whyboris/video-hub-app/blob/main/src/app/components/tags-manual/manual-tags.service.ts): `src/app/components/tags-manual/manual-tags.service.ts`
- [Automatic tags](https://github.com/whyboris/video-hub-app/blob/main/src/app/components/tags-auto/autotags.service.ts): `src/app/components/tags-auto/autotags.service.ts`
- [Statistics](https://github.com/whyboris/video-hub-app/blob/main/src/app/components/statistics/statistics.component.ts): `src/app/components/statistics/statistics.component.ts`
- [Media paths](https://github.com/whyboris/video-hub-app/blob/main/src/app/components/views/file-path.service.ts): `src/app/components/views/file-path.service.ts`
- [Video state](https://github.com/whyboris/video-hub-app/blob/main/src/app/services/image-element.service.ts): `src/app/services/image-element.service.ts`
- [Settings actions](https://github.com/whyboris/video-hub-app/blob/main/src/app/common/settings-buttons.ts): `src/app/common/settings-buttons.ts`

### Shared data and settings

- [Video record model](https://github.com/whyboris/video-hub-app/blob/main/interfaces/final-object.interface.ts): `interfaces/final-object.interface.ts`
- [Settings model](https://github.com/whyboris/video-hub-app/blob/main/interfaces/settings-object.interface.ts): `interfaces/settings-object.interface.ts`
- [Shared UI types](https://github.com/whyboris/video-hub-app/blob/main/interfaces/shared-interfaces.ts): `interfaces/shared-interfaces.ts`

### Other components

- **Desktop user**

## Connections

- Desktop user → Electron main: operates (evidence: `README.md`)
- Electron main → Runtime state: initializes (evidence: `main.ts`)
- Electron main → IPC handlers: configures (evidence: `main.ts`)
- Electron main → Folder scanning: starts extraction (evidence: `main.ts`)
- Electron main → Hub utilities: uses utilities (evidence: `main.ts`)
- Electron main → Remote server: starts server (evidence: `main.ts`)
- Electron main → Touch Bar: configures (evidence: `main.ts`)
- Folder scanning → Video metadata: extracts metadata (evidence: `node/main-extract-async.ts`)
- Folder scanning → Filename handling: uses filenames (evidence: `node/main-extract-async.ts`)
- Folder scanning → Hub utilities: uses utilities (evidence: `node/main-extract-async.ts`)
- Hub utilities → Folder scanning: resets watchers (evidence: `node/main-support.ts`)
- IPC handlers → Folder scanning: dispatches extraction (evidence: `node/main-ipc.ts`)
- IPC handlers → Video metadata: requests extraction (evidence: `node/main-ipc.ts`)
- Angular application → Hub browsing: declares (evidence: `src/app/app.module.ts`)
- Hub browsing → IPC handlers: requests hub actions (evidence: `src/app/components/home.component.ts`)
- Hub browsing → Search and filters: uses search controls (evidence: `src/app/components/home.component.ts`)
- Hub browsing → Video views: selects views (evidence: `src/app/components/home.component.ts`)
- Hub browsing → Manual tags: manages tags (evidence: `src/app/components/home.component.ts`)
- Hub browsing → Automatic tags: uses auto tags (evidence: `src/app/components/home.component.ts`)
- Hub browsing → Statistics: shows statistics (evidence: `src/app/components/home.component.ts`)
- Hub browsing → Media paths: uses file paths (evidence: `src/app/components/home.component.ts`)
- Hub browsing → Video state: updates video state (evidence: `src/app/components/home.component.ts`)
- Hub browsing → Settings actions: uses settings actions (evidence: `src/app/components/home.component.ts`)
- Media paths → Statistics: reads source folders (evidence: `src/app/components/views/file-path.service.ts`)
- Automatic tags → Video record model: uses video records (evidence: `src/app/components/tags-auto/autotags.service.ts`)
- Manual tags → Video record model: uses video records (evidence: `src/app/components/tags-manual/manual-tags.service.ts`)
- Video state → Video record model: stores video records (evidence: `src/app/services/image-element.service.ts`)
- Hub browsing → Video record model: uses video records (evidence: `src/app/components/home.component.ts`)
- Electron main → Settings model: uses saved settings (evidence: `main.ts`)
- Hub browsing → Shared UI types: uses shared types (evidence: `src/app/components/home.component.ts`)
