Skip to main content

Prerequisites

  • Node.js (LTS recommended) and npm
  • Chrome 113+ with WebGPU support — required for rendering
  • Dedicated GPU recommended for smooth 60fps preview
Firefox is supported but requires the Native Helper for project storage because Firefox does not support the File System Access API flow used by Chrome.
On Linux, enable Vulkan for smooth 60fps: chrome://flags/#enable-vulkan

Install and start

1

Clone the repository

git clone https://github.com/Sportinger/MasterSelects.git
cd MasterSelects
2

Install dependencies

npm install
3

Start the dev server

npm run dev
Opens at http://localhost:5173. Includes HMR (Hot Module Replacement). The engine singleton survives hot reloads via import.meta.hot.data.
Use npm run dev (not npm run dev:changelog) during normal development. The changelog dialog only appears in production builds and when explicitly requested via npm run dev:changelog.

Dev scripts

ScriptDescription
npm run devDev server with HMR at http://localhost:5173 (no changelog dialog)
npm run dev:changelogDev server with changelog dialog on load
npm run buildProduction build — runs tsc then vite build
npm run build:deployProduction build — skips tsc, runs vite build only
npm run lintESLint check
npm run previewServe the production build locally
npm run testRun all tests with Vitest (once)
npm run test:watchRun tests in watch mode
npm run test:unitRun unit tests only (tests/unit/)
npm run test:coverageRun tests with coverage report
npm run test:securitySecurity-focused test suite

Native Helper (optional)

The Native Helper is a cross-platform Rust companion app. It is required for:
  • Firefox project storage — Firefox lacks the File System Access API
  • External AI agent bridgePOST http://127.0.0.1:9877/api/ai-tools
  • Video downloads — yt-dlp integration for YouTube, TikTok, Instagram, Vimeo, etc.
cd tools/native-helper
cargo run --release
The helper binds to:
  • WebSocket port 9876 — browser tab connection
  • HTTP port 9877 — AI tools bridge and local API
Windows builds require FFMPEG_DIR and LIBCLANG_PATH environment variables. See tools/native-helper/README.md for platform-specific instructions.
Required external tools:
  • Rust — for building the helper
  • yt-dlp — for video downloads (must be on PATH)

Project structure

src/
├── components/          # React UI
│   ├── timeline/        # Timeline editor (hooks/, components/, utils/)
│   ├── panels/          # Properties, Media, AI, Download, Export, Scopes
│   ├── preview/         # Canvas + overlays + transform handles + SAM2 overlay
│   ├── outputManager/   # Multi-window output with slices
│   ├── export/          # Export dialog, codec selector
│   ├── dock/            # Panel/tab system
│   ├── common/          # Dialogs, tutorial, settings, shared components
│   └── mobile/          # Mobile-responsive layout
├── stores/              # Zustand state management
│   ├── timeline/        # 17 slices: track, clip, keyframe, mask, playback ...
│   └── mediaStore/      # 9 slices: import, folder, proxy, composition ...
├── engine/              # WebGPU rendering pipeline
│   ├── core/            # WebGPUContext, RenderTargetManager
│   ├── render/          # Compositor, RenderLoop, LayerCollector, NestedCompRenderer
│   ├── pipeline/        # CompositorPipeline, EffectsPipeline, OutputPipeline, SlicePipeline
│   ├── texture/         # TextureManager, ScrubbingCache, MaskTextureManager
│   ├── export/          # FrameExporter, VideoEncoder, ClipPreparation
│   ├── audio/           # AudioMixer, AudioEncoder, TimeStretch
│   ├── analysis/        # Histogram, Vectorscope, Waveform scopes
│   └── stats/           # PerformanceStats
├── effects/             # 30 GPU effects (color/, blur/, distort/, stylize/, keying/)
├── services/            # Business logic
│   ├── aiTools/         # 76 AI tool definitions + handlers
│   ├── sam2/            # SAM2 model manager + service
│   ├── project/         # Project persistence, save/load
│   ├── nativeHelper/    # Native decoder + WebSocket client
│   ├── layerBuilder/    # Layer building + video sync
│   └── monitoring/      # Playback health monitors
├── shaders/             # WGSL (composite, effects, output, optical flow, slice)
├── hooks/               # React hooks (useEngine, useGlobalHistory, useMIDI)
├── utils/               # Keyframe interpolation, mask renderer, file loader
├── types/               # TypeScript type definitions
└── workers/             # Transcription worker

tools/
├── native-helper/       # Rust binary (FFmpeg + yt-dlp bridge)
├── ffmpeg-build/        # FFmpeg build scripts
├── ffmpeg-wasm-build/   # FFmpeg WASM build configuration
└── qwen3vl-server/      # Qwen3 VL server for scene description

tests/
├── unit/                # Unit tests (Vitest)
└── stores/              # Store tests

Commit checklist

Before every commit, run all three checks:
npm run build    # must complete with no errors
npx eslint .     # 0 errors (warnings are OK)
npm run test     # all tests must pass
Never commit directly to master. Commit to staging and merge via PR.

Key files

AreaFile
Engine entrysrc/engine/WebGPUEngine.ts
Engine hooksrc/hooks/useEngine.ts
Render dispatchersrc/engine/render/RenderDispatcher.ts
Timeline storesrc/stores/timeline/index.ts
Media storesrc/stores/mediaStore/index.ts
History (undo/redo)src/stores/historyStore.ts
Loggersrc/services/logger.ts
Feature flagssrc/engine/featureFlags.ts
Version/changelogsrc/version.ts

Build docs developers (and LLMs) love