$ show nexmoe/VidBee
VidBee is a multi-platform media downloader and transcript workspace. The primary product is an Electron desktop app that downloads video/audio from 1000+ sites via yt-dlp, runs local speech-to-text transcription (sherpa-onnx Whisper/SenseVoice/Qwen3/Parakeet families) with speaker diarization in an isolated worker process, and provides an AI agent chat, summarization, translation, and FAQ layer over the resulting transcripts. It also ships a self-hosted Fastify API with a TanStack Start web client, a CLI wrapper around yt-dlp that can run fully in-process or connect to the desktop/API, and a browser extension (WXT) that hands video URLs to the desktop app via a token-authenticated loopback HTTP bridge. An RSS subscription engine with SQLite CAS leader election supports feed auto-download. Architecturally this is a pnpm monorepo built around host-neutral packages: packages/task-queue (FSM-driven job queue with priority scheduler, retry backoff, watchdog, and SQLite/memory persistence adapters), packages/transcription (ASR pipeline, caption parsing, speaker clustering, chunk manifests), packages/downloader-core (yt-dlp args, format selection, cookie handling, oRPC contracts), packages/subscriptions-core (feed parsing, scheduler, leader election), plus packages/ui, packages/i18n, packages/db, and packages/logger. The desktop, API, CLI, and web hosts share these packages, and oRPC contract schemas are explicitly kept byte-equal across hosts. The desktop renderer uses React 19, TanStack Router, Jotai, and Tailwind 4; the main process uses an IPC-decorator pattern with roughly fifteen typed services. Engineering quality is consistently above average: shared contracts with zod validation, swappable persistence adapters, a pure-function task FSM, security-conscious extension token auth, and an SSRF-guarded remote image proxy. The main weaknesses are duplication and sync fragility: near-identical download UI components exist in both desktop and web apps, several overlapping error classifiers must be kept manually in sync, the API hardcodes APP_VERSION separately from package versions, and legacy migration/back-compat paths (task-queue projection to legacy DownloadItem shapes, migrate-history scripts) accumulate complexity. This is an application repository, not data research: the ASR and speaker-clustering code is product engineering rather than a research artifact, though the transcription package is a genuinely reusable pipeline.
The LLM identified 7 files worth highlighting for reuse:
Pure-function task state machine with a legal transition table. Host-neutral and shared by desktop, API, CLI, and web: every adapter routes transitions through one transition() call, centralizing all state-change rules in a single testable pure module. Extractable into any job/queue system that needs strict lifecycle enforcement.
Priority plus FIFO min-heap scheduler with global and per-group concurrency slots, demote-on-shrink behavior, and slot sweeping. A generic scheduling primitive for any queue-driven application with concurrency caps; no framework coupling and cleanly separated from persistence and execution concerns.
SQLite persistence adapter implementing a narrow PersistAdapter interface (WAL mode, transactions, process journal), allowing the same task queue to run on memory or disk. Demonstrates a clean swappable-backend pattern that is directly reusable in other queue or job-store systems.
Chunked speaker diarization with overlapping windows, cosine-distance agglomerative embedding clustering, short-cluster folding, and speaker capping, with constants tuned on real audio samples. Non-obvious DSP/ML engineering that solves a recurring media problem and can be extracted for any diarization or segment-clustering task.
VTT/SRT/ASS caption parser with BCP-47 language normalization, Chinese script detection, and canonical segment/word model output, shared by desktop and API producers. Solves the recurring problem of converting heterogeneous subtitle formats into one structured representation.
SQLite compare-and-swap lease-based leader election used to guarantee only one host checks RSS feeds at a time. A minimal but correct distributed-coordination primitive embeddable in any single-database multi-process system, avoiding external coordination services.
Generic fluid hover hook with axis support (x/y/xy), gap-click routing, and measurement coalescing, powering the traveling-highlight navigation used across the UI kit. A reusable interaction primitive, not framework boilerplate, and extractable into any React design system.