# notnaone/cutcut architecture

> Architecture diagram of the GitHub repository notnaone/cutcut, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/notnaone/cutcut
- Repository: https://github.com/notnaone/cutcut

## Overview

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: [`src/editor/AudiobookEditor.tsx`](https://github.com/notnaone/cutcut/blob/main/src/editor/AudiobookEditor.tsx) (Audiobook editor), [`src-tauri/src/lib.rs`](https://github.com/notnaone/cutcut/blob/main/src-tauri/src/lib.rs) (Tauri lib), [`src-tauri/src/transcription.rs`](https://github.com/notnaone/cutcut/blob/main/src-tauri/src/transcription.rs) (Transcription), [`src-tauri/src/cloud_sync.rs`](https://github.com/notnaone/cutcut/blob/main/src-tauri/src/cloud_sync.rs) (Cloud sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Docs & phases"]
  node_docs_context["System context<br/>architecture doc<br/>[SYSTEM_CONTEXT.md]"]
  node_docs_design["Design<br/>architecture doc<br/>[DESIGN.md]"]
  node_docs_phases["Phase docs<br/>delivery docs"]
end

subgraph group_frontend["React editor"]
  node_src_main(("App entry<br/>react entry<br/>[main.tsx]"))
  node_src_app["Shell UI<br/>react shell<br/>[App.tsx]"]
  node_editor["Audiobook editor<br/>editor surface"]
  node_wordnode(("Word node<br/>editor model<br/>[WordNode.ts]"))
  node_hydration(("Hydration<br/>editor plugin"))
  node_autosave(("Autosave<br/>editor plugin<br/>[AutosavePlugin.tsx]"))
  node_playback(("Playback sync<br/>editor plugin"))
  node_mutator(("EDL mutator<br/>editor plugin"))
  node_readonly(("Read only<br/>editor plugin<br/>[ReadOnlyPlugin.tsx]"))
  node_transients(("Transients<br/>editor plugin"))
end

subgraph group_backend["Rust backend"]
  node_audio_rs["Audio<br/>rust module<br/>[audio.rs]"]
  node_transcription_rs["Transcription<br/>rust module<br/>[transcription.rs]"]
  node_processing_rs["Processing<br/>rust module<br/>[processing.rs]"]
  node_cloud_sync_rs["Cloud sync<br/>rust module<br/>[cloud_sync.rs]"]
  node_lib_rs(("Tauri lib<br/>rust entry<br/>[lib.rs]"))
  node_main_rs(("Native main<br/>rust entry<br/>[main.rs]"))
end

subgraph group_runtime["External runtime"]
  node_python_sidecar["Transcribe sidecar<br/>python helper<br/>[transcribe.py]"]
end

node_src_main -->|"mounts"| node_src_app
node_src_app -->|"hosts"| node_editor
node_editor -->|"uses"| node_wordnode
node_editor -->|"loads"| node_hydration
node_editor -->|"persists"| node_autosave
node_editor -->|"syncs"| node_playback
node_editor -->|"mutates"| node_mutator
node_editor -->|"guards"| node_readonly
node_editor -->|"tracks"| node_transients
node_mutator -->|"writes"| node_autosave
node_hydration -.->|"restores from"| node_cloud_sync_rs
node_autosave -.->|"syncs via"| node_cloud_sync_rs
node_playback -->|"drives"| node_audio_rs
node_lib_rs -->|"coordinates"| node_audio_rs
node_lib_rs -->|"coordinates"| node_transcription_rs
node_lib_rs -->|"coordinates"| node_processing_rs
node_lib_rs -->|"coordinates"| node_cloud_sync_rs
node_transcription_rs -->|"launches"| node_python_sidecar
node_transcription_rs -->|"hands off"| node_processing_rs
node_processing_rs -.->|"publishes"| node_cloud_sync_rs
node_main_rs -->|"starts"| node_lib_rs
node_docs_context -.->|"describes"| node_lib_rs
node_docs_design -.->|"describes"| node_editor
node_docs_phases -.->|"plans"| node_transcription_rs

click node_src_main "https://github.com/notnaone/cutcut/blob/main/src/main.tsx"
click node_src_app "https://github.com/notnaone/cutcut/blob/main/src/App.tsx"
click node_editor "https://github.com/notnaone/cutcut/blob/main/src/editor/AudiobookEditor.tsx"
click node_wordnode "https://github.com/notnaone/cutcut/blob/main/src/editor/nodes/WordNode.ts"
click node_hydration "https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/HydrationPlugin.tsx"
click node_autosave "https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/AutosavePlugin.tsx"
click node_playback "https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/PlaybackSyncPlugin.tsx"
click node_mutator "https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/EdlMutatorPlugin.tsx"
click node_readonly "https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/ReadOnlyPlugin.tsx"
click node_transients "https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/TransientsPlugin.tsx"
click node_audio_rs "https://github.com/notnaone/cutcut/blob/main/src-tauri/src/audio.rs"
click node_transcription_rs "https://github.com/notnaone/cutcut/blob/main/src-tauri/src/transcription.rs"
click node_processing_rs "https://github.com/notnaone/cutcut/blob/main/src-tauri/src/processing.rs"
click node_cloud_sync_rs "https://github.com/notnaone/cutcut/blob/main/src-tauri/src/cloud_sync.rs"
click node_lib_rs "https://github.com/notnaone/cutcut/blob/main/src-tauri/src/lib.rs"
click node_main_rs "https://github.com/notnaone/cutcut/blob/main/src-tauri/src/main.rs"
click node_python_sidecar "https://github.com/notnaone/cutcut/blob/main/sidecars/transcribe.py"
click node_docs_context "https://github.com/notnaone/cutcut/blob/main/SYSTEM_CONTEXT.md"
click node_docs_design "https://github.com/notnaone/cutcut/blob/main/DESIGN.md"
click node_docs_phases "https://github.com/notnaone/cutcut/blob/main/PHASE_1_NATIVE_FOUNDATION.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_docs_context,node_docs_design,node_docs_phases toneBlue
class node_src_main,node_src_app,node_editor,node_wordnode,node_hydration,node_autosave,node_playback,node_mutator,node_readonly,node_transients toneAmber
class node_audio_rs,node_transcription_rs,node_processing_rs,node_cloud_sync_rs,node_lib_rs,node_main_rs toneMint
class node_python_sidecar toneRose
```

## Components

### Docs & phases

Architecture, decisions, and phased implementation docs.

- [System context](https://github.com/notnaone/cutcut/blob/main/SYSTEM_CONTEXT.md): architecture doc · High-level system boundary and runtime intent. · `SYSTEM_CONTEXT.md`
- [Design](https://github.com/notnaone/cutcut/blob/main/DESIGN.md): architecture doc · Product and subsystem design overview. · `DESIGN.md`
- [Phase docs](https://github.com/notnaone/cutcut/blob/main/PHASE_1_NATIVE_FOUNDATION.md): delivery 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](https://github.com/notnaone/cutcut/blob/main/src/main.tsx): react entry · Bootstraps the React app. · `src/main.tsx`
- [Shell UI](https://github.com/notnaone/cutcut/blob/main/src/App.tsx): react shell · Top-level application shell and routing. · `src/App.tsx`
- [Audiobook editor](https://github.com/notnaone/cutcut/blob/main/src/editor/AudiobookEditor.tsx): editor surface · Primary user-facing editing workspace. · `src/editor/AudiobookEditor.tsx`
- [Word node](https://github.com/notnaone/cutcut/blob/main/src/editor/nodes/WordNode.ts): editor model · Word-level editing unit used by the editor model. · `src/editor/nodes/WordNode.ts`
- [Hydration](https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/HydrationPlugin.tsx): editor plugin · Loads editor state from persisted or backend data. · `src/editor/plugins/HydrationPlugin.tsx`
- [Autosave](https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/AutosavePlugin.tsx): editor plugin · Persists incremental editor changes. · `src/editor/plugins/AutosavePlugin.tsx`
- [Playback sync](https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/PlaybackSyncPlugin.tsx): editor plugin · Keeps edits aligned with audio playback. · `src/editor/plugins/PlaybackSyncPlugin.tsx`
- [EDL mutator](https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/EdlMutatorPlugin.tsx): editor plugin · Mutates the edit sequence/model. · `src/editor/plugins/EdlMutatorPlugin.tsx`
- [Read only](https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/ReadOnlyPlugin.tsx): editor plugin · Locks the editor when editing is disabled. · `src/editor/plugins/ReadOnlyPlugin.tsx`
- [Transients](https://github.com/notnaone/cutcut/blob/main/src/editor/plugins/TransientsPlugin.tsx): editor plugin · Holds temporary editor and UI state. · `src/editor/plugins/TransientsPlugin.tsx`

### Rust backend

Native Tauri services and pipeline orchestration.

- [Audio](https://github.com/notnaone/cutcut/blob/main/src-tauri/src/audio.rs): rust module · Native audio handling and integration. · `src-tauri/src/audio.rs`
- [Transcription](https://github.com/notnaone/cutcut/blob/main/src-tauri/src/transcription.rs): rust module · Coordinates transcription workflow. · `src-tauri/src/transcription.rs`
- [Processing](https://github.com/notnaone/cutcut/blob/main/src-tauri/src/processing.rs): rust module · Transforms transcription output into editor-ready data. · `src-tauri/src/processing.rs`
- [Cloud sync](https://github.com/notnaone/cutcut/blob/main/src-tauri/src/cloud_sync.rs): rust module · Manages remote synchronization. · `src-tauri/src/cloud_sync.rs`
- [Tauri lib](https://github.com/notnaone/cutcut/blob/main/src-tauri/src/lib.rs): rust entry · Native command and app glue for Tauri. · `src-tauri/src/lib.rs`
- [Native main](https://github.com/notnaone/cutcut/blob/main/src-tauri/src/main.rs): rust entry · Starts the Tauri desktop runtime. · `src-tauri/src/main.rs`

### External runtime

Python sidecar used for transcription.

- [Transcribe sidecar](https://github.com/notnaone/cutcut/blob/main/sidecars/transcribe.py): python helper · External transcription process launched by the app. · `sidecars/transcribe.py`

## Connections

- 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.
