How notnaone/cutcut works
1. This repository is a desktop application built with Tauri, React, TypeScript, and Rust. The runtime boundary is the Tauri shell: a browser-based UI in src/ talks to a Rust backend in src-tauri/, rather than to a separate server.
2. The primary product appears to be an audiobook editing tool. The main user-facing surface is src/editor/AudiobookEditor.tsx, which sits inside the React app (src/App.tsx, src/main.tsx) and is styled separately in src/App.css and src/editor/AudiobookEditor.css.
3. The editor is decomposed into a node-based model and a plugin layer. src/editor/nodes/WordNode.ts suggests the editing model includes word-level units, while src/editor/plugins/* contains behavior modules that likely extend the editor without hard-coding workflow logic into the main component.
4. The editor plugins define the UI-side state and workflow boundaries:
- HydrationPlugin for loading editor state from persisted or backend data
- AutosavePlugin for incremental persistence
- PlaybackSyncPlugin for syncing edits with audio playback
- EdlMutatorPlugin for editing the EDL-like sequence/model
- ReadOnlyPlugin for lockout states
- TransientsPlugin for temporary UI/editor state
This strongly suggests the frontend is stateful and workflow-driven, not just a static document editor.
5. The Rust backend is split into functional modules under src-tauri/src/. audio.rs likely encapsulates audio handling, transcription.rs handles transcription orchestration, processing.rs covers pipeline steps after transcription, and cloud_sync.rs manages remote synchronization. lib.rs and main.rs are the Tauri entry points.
6. There is an explicit Python sidecar in sidecars/transcribe.py. That means transcription is not done fully inside Rust; instead, the Tauri app likely launches a helper process for speech-to-text work. Architecturally, this creates a separate execution boundary for heavy or specialized ML/transcription tooling.
7. The likely end-to-end data flow is: user edits in the React editor -> plugin layer mutates editor/EDL state -> autosave/hydration persists or restores state -> Rust commands coordinate audio/transcription/processing -> the Python sidecar performs transcription -> results return to Rust and then back to the UI. Playback synchronization is part of the live editor loop, not a separate service.
8. Cloud and local persistence are treated as distinct concerns. The presence of SQLITE_AND_SUPABASE_SCHEMA.md and src-tauri/src/cloud_sync.rs indicates local state is probably stored in SQLite while remote sync uses Supabase. That implies an offline-first or local-first architecture with sync as a backend concern rather than the primary source of truth.
9. The processing subsystem is its own stage, with dedicated Rust module and phase documentation (PHASE_5_PROCESSING.md). This suggests transcription output is transformed before being surfaced to the editor, likely into edit-ready structures rather than raw transcripts.
10. The repo includes strong architecture/governance documentation: SYSTEM_CONTEXT.md, DESIGN.md, DECISION_LOG.md, GOVERNANCE_PROTOCOL.md, and phase docs for native foundation, core editor, mutator, cloud sync, and processing. These are not runtime components, but they define the intended subsystem boundaries and implementation order.
11. Testing is concentrated on the Rust pipeline. src-tauri/tests/pipeline_test.rs and the mirrored artifact under src-tauri/src/artifact_dummy_dir/ indicate backend pipeline behavior is validated separately from the UI, which is important if you are drawing test boundaries in the diagram.
12. Infrastructure-wise, this is a packaged desktop app, not a conventional client/server web app. vite.config.ts and the web assets support the frontend build, while src-tauri/tauri.conf.json, capabilities/default.json, and build.rs define desktop packaging, permissions, and native build integration.
13. If you are diagramming the architecture, the clearest top-level boxes are: React editor/UI, Tauri bridge, Rust native services, Python transcription sidecar, and storage/sync backends. The main cross-cutting concerns are editor state management, audio/transcription processing, and local/remote persistence synchronization.
Main entry points: AudiobookEditor.tsx Audiobook editor · lib.rs Tauri lib · transcription.rs Transcription · cloud_sync.rs Cloud sync
Components 20
Docs & phases
Architecture, decisions, and phased implementation docs.
- System context · High-level system boundary and runtime intent.
SYSTEM_CONTEXT.md - Design · Product and subsystem design overview.
DESIGN.md - Phase docs · Implementation phases for native foundation, editor, sync, and processing.
PHASE_1_NATIVE_FOUNDATION.md
React editor
Tauri front-end UI and editor state.
- App entry · Bootstraps the React app.
src/main.tsx - Shell UI · Top-level application shell and routing.
src/App.tsx - Audiobook editor · Primary user-facing editing workspace.
src/editor/AudiobookEditor.tsx - Word node · Word-level editing unit used by the editor model.
src/editor/nodes/WordNode.ts - Hydration · Loads editor state from persisted or backend data.
src/editor/plugins/HydrationPlugin.tsx - Autosave · Persists incremental editor changes.
src/editor/plugins/AutosavePlugin.tsx - Playback sync · Keeps edits aligned with audio playback.
src/editor/plugins/PlaybackSyncPlugin.tsx - EDL mutator · Mutates the edit sequence/model.
src/editor/plugins/EdlMutatorPlugin.tsx - Read only · Locks the editor when editing is disabled.
src/editor/plugins/ReadOnlyPlugin.tsx - Transients · Holds temporary editor and UI state.
src/editor/plugins/TransientsPlugin.tsx
Rust backend
Native Tauri services and pipeline orchestration.
- Audio · Native audio handling and integration.
src-tauri/src/audio.rs - Transcription · Coordinates transcription workflow.
src-tauri/src/transcription.rs - Processing · Transforms transcription output into editor-ready data.
src-tauri/src/processing.rs - Cloud sync · Manages remote synchronization.
src-tauri/src/cloud_sync.rs - Tauri lib · Native command and app glue for Tauri.
src-tauri/src/lib.rs - Native main · Starts the Tauri desktop runtime.
src-tauri/src/main.rs
External runtime
Python sidecar used for transcription.
- Transcribe sidecar · External transcription process launched by the app.
sidecars/transcribe.py
Connections 24
- App entry → Shell UI: mounts · React entry mounts the application shell.
- Shell UI → Audiobook editor: hosts · The shell renders the main editor surface.
- Audiobook editor → Word node: uses · Editor is built around word-level nodes.
- Audiobook editor → Hydration: loads · Editor state is restored through hydration.
- Audiobook editor → Autosave: persists · Autosave keeps local state up to date.
- Audiobook editor → Playback sync: syncs · Playback synchronization drives the live editing loop.
- Audiobook editor → EDL mutator: mutates · Workflow changes are applied through the mutator layer.
- Audiobook editor → Read only: guards · Read-only states gate editing interactions.
- Audiobook editor → Transients: tracks · Temporary UI/editor state is kept separate.
- EDL mutator → Autosave: writes · Model mutations flow into persistence.
- Hydration → Cloud sync: restores from · Hydration can source state from local or synced backend data.
- Autosave → Cloud sync: syncs via · Persisted editor state can be mirrored through cloud sync.
- Playback sync → Audio: drives · Editor playback hooks into native audio control.
- Tauri lib → Audio: coordinates · Tauri backend exposes audio capabilities.
- Tauri lib → Transcription: coordinates · Native backend orchestrates transcription.
- Tauri lib → Processing: coordinates · Native backend runs post-transcription processing.
- Tauri lib → Cloud sync: coordinates · Native backend exposes sync operations.
- Transcription → Transcribe sidecar: launches · Transcription is delegated to the sidecar process.
- Transcription → Processing: hands off · Raw transcription output flows into processing.
- Processing → Cloud sync: publishes · Processed data can be prepared for sync.
- Native main → Tauri lib: starts · Native main boots the Tauri application.
- System context → Tauri lib: describes · Context docs define the native boundary.
- Design → Audiobook editor: describes · Design docs explain the editor-centric product.
- Phase docs → Transcription: plans · Phase docs cover the processing pipeline.