feat: ClipPilot MVP — local-first video repair toolbox#1
Merged
Conversation
A polished, self-hostable Next.js app for processing short videos, built around a stabilise tool with an extensible job/tool abstraction. Core - Landing page + workspace (upload → tool → process → preview/download) - Drag-and-drop upload with progress; type/size validation; ffprobe metadata - Stabilise via two-pass FFmpeg vid.stab (audio preserved); compress, convert, trim, thumbnail tools - Real per-step progress parsed from FFmpeg; cancel/cleanup; recent jobs (localStorage); before/after size delta Architecture - Tool registry (catalog) + plan builders; in-memory job store + runner - Safe FFmpeg/ffprobe spawn wrappers (argv only, never a shell) - Filename sanitising + path-traversal-guarded file serving with HTTP ranges - Optional API token + CORS so it can be used as a headless API Quality & ops - 31 Vitest unit tests; ESLint clean; TypeScript strict - Dockerfile (FFmpeg baked in) + docker-compose; standalone output - Icons, web manifest, touch icon, mobile viewport - README, .env.example, health endpoint, ffmpeg preflight script Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01455aH5ej2EiFsnAdWxtpgL
Make storage and job state backend-agnostic, selected by env vars, so the same code runs zero-config locally or cloud-native on Supabase + Cloud Run. Storage adapters (src/lib/media/) - MediaStore interface with local filesystem and Supabase Storage backends - Runner downloads input → processes locally → uploads output (ephemeral-host friendly); file route streams locally or 302-redirects to a signed URL Job store adapters (src/lib/jobs/) - JobStoreBackend interface with in-memory and Supabase Postgres backends - Runner owns the full lifecycle (prepare → probe → plan → run → finalise), with throttled progress writes to keep DB cost down; cancellation stays in-process Config & ops - Auto-detects Supabase when SUPABASE_URL + service-role key are set; STORAGE_BACKEND / JOBS_BACKEND can force either - supabase/migrations/0001_jobs.sql (jobs table, RLS on) - Dockerfile standalone image; scripts/deploy-cloudrun.sh (--no-cpu-throttling so background FFmpeg finishes); .gcloudignore - /api/health reports active backends - README: Supabase + Cloud Run guide; .env.example updated Verified end-to-end on the local backend (stabilise + trim) after refactor; build, lint and 31 unit tests all pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01455aH5ej2EiFsnAdWxtpgL
One-click deploy from the Actions tab once GCP + Supabase secrets are set. Manual (workflow_dispatch) only, so the branch shows no red checks beforehand. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01455aH5ej2EiFsnAdWxtpgL
- Rotate: fix sideways/upside-down clips (transpose/flip), audio preserved - GIF: two-pass palette render (palettegen/paletteuse) with fps/width + trim - Wire .gif content types (file route + Supabase store); tool-picker grid - Tests for both builders (35 total); verified end-to-end locally Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01455aH5ej2EiFsnAdWxtpgL
- supabase-migrate.yml: applies supabase/migrations/*.sql on push (and manual); safe no-op until SUPABASE_DB_URL secret is set, idempotent SQL - deploy workflow also applies migrations before deploying, so one click does migrate + deploy - README: document the automatic migration path Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01455aH5ej2EiFsnAdWxtpgL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A polished, self-hostable Next.js app for processing short videos, built
around a stabilise tool with an extensible job/tool abstraction.
Core
trim, thumbnail tools
(localStorage); before/after size delta
Architecture
Quality & ops
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01455aH5ej2EiFsnAdWxtpgL