INIT-01: Project Scaffold & Initial Structure
Define the baseline repository layout, build tooling, and development workflows for Speakr.
Requirement
- Workspace Layout (multi-crate)
speakr-core/
– pure Rust library (record → transcribe → inject).speakr-tauri/
– Tauri desktop shell; containssrc-tauri/
and embeds Leptos frontend by default.speakr-ui/
– optional standalone Leptos UI crate (only if the UI is fully separated).models/
– user-downloaded GGUF Whisper models (git-ignored).docs/
– architecture, PRD, and spec docs (this folder).nix/
– flakes, overlays,devenv.nix
, CI helpers.scripts/
– one-off dev scripts (lint, release, etc.).- Root-level
Cargo.toml
/Cargo.lock
defining a[workspace]
withmembers
.
- Build Tooling
- Use Cargo workspace to manage crates and enable incremental rebuilds.
- Root-level Nix flake +
devenv.nix
for reproducible shells. Trunk.toml
(inspeakr-tauri/
) bundles static assets for the WebView.
- CI / CD
- GitHub Actions workflow for: lint (
rustfmt
,clippy
), test, macOS build, docs build. - Release workflow signs and notarises macOS DMG.
- GitHub Actions workflow for: lint (
- Linters & Hooks
- Pre-commit config:
rustfmt
,markdownlint
,shellcheck
,nixpkgs-fmt
.
- Pre-commit config:
- Documentation Site
- mdBook in
docs/book/
published via GitHub Pages.
- mdBook in
- Version Control Hygiene
.gitignore
tracks target, model files, and local config overrides.
Rationale
A consistent scaffold accelerates onboarding, enforces build reproducibility, and aligns with the project’s privacy-first & cross-platform goals.
Acceptance Criteria
-
Fresh clone followed by
devenv shell
(ordevenv up
) yields a working shell withcargo
, -
tauri
, andmdbook
available. -
cargo test
passes with placeholder tests. -
npm run tauri dev
(via Trunk) launches stub window. - GitHub Actions green on lint + test.
-
mdbook serve
builds documentation without errors.
Migration Steps (from mono-crate → multi-crate)
-
Create workspace file
# At repo root echo "[workspace]\nmembers = [ \"speakr-core\", \"speakr-tauri\", \"speakr-ui\" ]" > Cargo.toml
-
Scaffold core crate
cargo new --lib speakr-core mv src/*.rs speakr-core/src/ # move existing logic rm -rf src/
-
Scaffold Tauri crate
cargo tauri init --template leptos speakr-tauri # move existing src-tauri/ into speakr-tauri/ mv src-tauri speakr-tauri/
-
Wire dependency In
speakr-tauri/Cargo.toml
add:speakr-core = { path = "../speakr-core" }
-
(Optional) Separate UI crate
cargo new --lib speakr-ui mv speakr-tauri/src-leptos/* speakr-ui/src/ # then depend on speakr-ui from speakr-tauri via WASM asset pipeline
-
Update paths in code & imports.
-
Run tests & build
cargo test --workspace cargo tauri dev -p speakr-tauri
-
CI / Nix – update workflows and
devenv.nix
to use--workspace
.
Completion of these steps should yield the new structure with all tests & tauri dev
working.