Skip to content

Phase 1.a — Extract waveflow-core crate #128

@InstaZDLL

Description

@InstaZDLL

Tracking issue for sub-phase 1.a of RFC-001.

Extract a waveflow-core workspace crate from src-tauri/src/ so the same business logic can be reused by waveflow-server (Phase 1.b+) without forking the codebase. Pure refactor — zero behavior change for the desktop app.

Scope

  • Convert src-tauri/ into a Cargo workspace (src-tauri/Cargo.toml becomes workspace manifest).
  • Create src-tauri/crates/core/ with:
    • Scanner pipeline (BLAKE3 hashing, lofty tag parsing, multi-artist split, album grouping)
    • Metadata clients (Deezer, Last.fm) — already use reqwest + rustls-tls
    • Audio analysis (ReplayGain, BPM, key detection)
    • DSD → PCM converter (src-tauri/src/audio/dsd/)
    • Domain types (Track, Album, Artist, Playlist, etc.)
  • Define repository traits (trait TrackRepository, trait PlaylistRepository, …) parameterized over a connection type so SQLite (desktop) and Postgres (server) can plug in their own impls later.
  • Move desktop-specific code (Tauri commands, media controls, DLNA, mini-player) to src-tauri/crates/app/.
  • Run cargo check --all-targets + cargo test clean from the workspace root.
  • Ship a tag-bumped desktop release to validate nothing regressed.

Out of scope

  • Postgres impl of the repository traits (that's 1.b).
  • Splitting waveflow-core into its own repo (deferred until API stabilizes; see RFC §5).

Acceptance criteria

  • cargo build --release produces the same desktop binary footprint (± 5%) and the app boots normally.
  • Existing test suite passes from the workspace root.
  • CI updated to run cargo check/cargo test against the workspace, not just the legacy crate.
  • Documentation: CLAUDE.md + docs/architecture/ updated to describe the new layout.

Estimate

~3 weeks. Treat as research-grade work — if the extraction reveals tight coupling that needs a larger refactor, scope-creep is acceptable. Everything downstream depends on this being clean (see RFC §9 Risks).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase: 1Phase 1 — waveflow-server (RFC-001)rustPull requests that update rust codescope: backendRust/Tauri backend (src-tauri/)

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions