$ show mattpocock/course-video-manager
This repository is a full-stack video course management system (CVM) designed for creating, editing, and publishing technical video lessons. It consists of a web application (React Router v7 with SSR), a CLI tool (`cvm`), a remote RPC API (Hono, deployed on Vercel), and several internal packages including a core domain library with Drizzle ORM schema, a standalone Remotion overlay renderer, and a vendored Lucide icon set. The system orchestrates complex workflows such as video capture (OBS integration), timeline editing with clip trimming and overlay compositing, AI-assisted content generation (chapter autofill, SEO descriptions, newsletters using Anthropic Claude), and publishing to YouTube, Dropbox, and Buffer. A teleprompter popup syncs via BroadcastChannel, and a diagram editor built on tldraw supports snapshot-based revision history. The architecture is heavily driven by Effect-ts for backend services, with a clear separation between read-only CLI operations (via HTTP RPC) and write operations (via web app routes). The frontend uses optimistic updates for a fluid user experience, while the backend enforces draft-gate policies to prevent writes to published course versions. The codebase is thoroughly tested with Vitest and PGlite in-memory PostgreSQL, using fake service layers for external dependencies (Dropbox, AI generation, video processing). Despite its healthy test coverage and well-structured service pattern, the repository shows signs of organic growth: multiple modals with duplicated state logic, large reducer files, and some drift between duplicated prompt definitions. The dependency on the Effect-ts ecosystem and a large number of third-party APIs (Dropbox, YouTube, Buffer, OBS, Cloudinary) creates a maintenance surface that requires careful version alignment. The overlay renderer is isolated as a separate package with its own build process, reducing coupling but adding deployment complexity.
The LLM identified 3 files worth highlighting for reuse:
A pure function that merges clip transcript words and chapter boundaries into a structured prose transcript with indexed clip references. It is well-tested, has no framework dependencies, and can be reused in any video processing pipeline. Demonstrates clean functional design for aggregating time-series text data.
A reusable helper that creates a Server-Sent Events (SSE) response from an Effect stream, with abort handling via request.signal. It encapsulates the boilerplate of encoding events, keeping the connection alive, and cleaning up resources. Can be extracted for any Effect-based server sending real-time progress updates.
A pure function that recomputes clip start/end times and shifts all dependent elements (transcript words, overlay anchors) when a clip is trimmed. It is isolation-tested, has no side effects, and uses a simple shift accumulator. Demonstrates a clean approach to cascading timestamp updates in a timeline editor.