The Problem
Video editors on the web and desktop are either closed‑source or require heavyweight native builds. Users who want a free, extensible editor that runs in a browser, on Windows/macOS/Linux, or on mobile lack a single codebase that can be customized or automated.
What This Does
OpenCut is a rewrite of the classic CapCut‑like editor. The repository contains three runnable apps:
- API –
apps/api/src/index.tsstarts a Fastly‑compatible HTTP server (seeapps/api/wrangler.jsonc). - Desktop –
apps/desktop/src/main.rsbuilds a native window with a Rust core (seeapps/desktop/Cargo.toml). - Web –
apps/web/src/routes/index.tsxis the SPA entry point, compiled by Vite (apps/web/vite.config.ts).
The UI components live under apps/web/src/components/ui/*.tsx; routing logic is in apps/web/src/router.tsx and the generated route tree (apps/web/src/routeTree.gen.ts). The Rust core, referenced by the desktop and eventually by the web via WASM, is declared in the top‑level Cargo.toml.
How It Is Wired
Start → API
apps/api/src/index.tsis the Node entry point executed bymoon run api:dev.- It imports
@cloudflare/kv-asset-handler(viapackage.json) and starts the server defined inwrangler.jsonc. No database or filesystem writes are present; the API only serves static assets and forwards editor‑specific RPC calls.
Start → Desktop
apps/desktop/src/main.rsis compiled by Cargo (cargo build --workspace).- The binary creates a Tauri window that loads the web bundle from
apps/web/dist. All UI interactions are handled by the same React component tree used by the web app, so the desktop process is essentially a thin host.
Start → Web
moon run web:devlaunches Vite, which servesapps/web/src/routes/index.tsx.router.tsximportsrouteTree.gen.tsto build the route hierarchy; both files form a circular import (measured high‑severity).- The router renders UI components (e.g.,
components/ui/sidebar.tsx,components/ui/chart.tsx). - UI actions eventually call the API endpoints defined in
apps/api/src/index.ts.
Effect Ownership
- Network – only
apps/api/src/index.tsperforms HTTP handling. - Filesystem – no code writes to disk; the only file I/O is Vite’s dev server reading static assets.
- Process Boundary –
apps/desktop/src/main.rsis the only native process; all other logic runs in the browser/Node runtime.
The circular import between router.tsx and routeTree.gen.ts creates a tight coupling that increases the blast radius of any change to routing logic. The large sidebar.tsx (672 lines) and deep nesting in chart.tsx also concentrate UI responsibilities, making refactoring riskier.
How To Use It
# Clone the repo
git clone https://github.com/moses-y/OpenCut.git
cd OpenCut
# Install proto (Moon toolchain manager)
bash <(curl -fsSL https://moonrepo.dev/install/proto.sh)
# Pull pinned tools (Node, Cargo, etc.)
proto use
# Run each app locally
moon run web:dev # http://localhost:5173
moon run api:dev # http://localhost:8787
moon run desktop:dev # follows apps/desktop/README.md
No additional environment variables are required; the dev server reads apps/web/wrangler.jsonc for the API configuration. Production builds would need a Cloudflare Workers account for the API and a packaging step for the desktop binary (standard Cargo workflow).
Real‑World Use
A media‑production SaaS could embed the web build (apps/web/dist) in its own dashboard, using the API as a microservice for asset storage. The desktop binary can be distributed to power‑users who need offline editing, while the same UI components guarantee feature parity across platforms.
Code Health & Issues
- High – Import cycle –
apps/web/src/routeTree.gen.ts↔apps/web/src/router.tsx. Break the cycle by extracting shared types or using lazy imports. - High – Deep nesting –
apps/web/src/components/ui/chart.tsxhas 8‑level indentation; refactor into smaller functions. - High – Missing test suite – No test files despite 65 source files; add at least one test per public entry point and run them in CI.
- High – No Cargo lockfile –
Cargo.tomllacks aCargo.lock; generate and commit it to freeze Rust dependencies. - High – Unpinned GitHub Action –
.github/workflows/bun-ci.ymlusesmoonrepo/setup-toolchain@v0; replace with a commit SHA. - Medium – Least‑privilege GITHUB_TOKEN – Workflow declares no permissions; add
permissions: contents: read. - Medium – No Dependabot – Add
.github/dependabot.ymlfor Rust, npm, and GitHub Actions. - Medium – No dependency‑vulnerability gate – Insert
dependency-review-actionorosv-scannerinto CI. - Low – No job timeouts – Add
timeout-minutesto each workflow job. - Low – Missing repo conventions – Add
.editorconfig,.gitattributes, and a formatter config.
The Bottom Line
OpenCut provides a unified, open‑source video‑editor stack with a clear separation between API, desktop host, and web UI. The codebase is functional but suffers from a few architectural smells (import cycle, oversized UI files) and lacks production‑grade safeguards (lockfiles, tests, pinned CI actions). Engineers comfortable with React and Rust can use it as a starting point for custom editor extensions, but they should address the highlighted health issues before relying on it in production.