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:

  • APIapps/api/src/index.ts starts a Fastly‑compatible HTTP server (see apps/api/wrangler.jsonc).
  • Desktopapps/desktop/src/main.rs builds a native window with a Rust core (see apps/desktop/Cargo.toml).
  • Webapps/web/src/routes/index.tsx is 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

  1. apps/api/src/index.ts is the Node entry point executed by moon run api:dev.
  2. It imports @cloudflare/kv-asset-handler (via package.json) and starts the server defined in wrangler.jsonc. No database or filesystem writes are present; the API only serves static assets and forwards editor‑specific RPC calls.

Start → Desktop

  1. apps/desktop/src/main.rs is compiled by Cargo (cargo build --workspace).
  2. 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

  1. moon run web:dev launches Vite, which serves apps/web/src/routes/index.tsx.
  2. router.tsx imports routeTree.gen.ts to build the route hierarchy; both files form a circular import (measured high‑severity).
  3. The router renders UI components (e.g., components/ui/sidebar.tsx, components/ui/chart.tsx).
  4. UI actions eventually call the API endpoints defined in apps/api/src/index.ts.

Effect Ownership

  • Network – only apps/api/src/index.ts performs HTTP handling.
  • Filesystem – no code writes to disk; the only file I/O is Vite’s dev server reading static assets.
  • Process Boundaryapps/desktop/src/main.rs is 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 cycleapps/web/src/routeTree.gen.tsapps/web/src/router.tsx. Break the cycle by extracting shared types or using lazy imports.
  • High – Deep nestingapps/web/src/components/ui/chart.tsx has 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 lockfileCargo.toml lacks a Cargo.lock; generate and commit it to freeze Rust dependencies.
  • High – Unpinned GitHub Action.github/workflows/bun-ci.yml uses moonrepo/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.yml for Rust, npm, and GitHub Actions.
  • Medium – No dependency‑vulnerability gate – Insert dependency-review-action or osv-scanner into CI.
  • Low – No job timeouts – Add timeout-minutes to 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.