Skip to content

Building from Source

Kenneth LaCroix edited this page Apr 13, 2026 · 1 revision

Building from Source

Prerequisites (all platforms)


Linux

sudo apt install -y \
  libwebkit2gtk-4.1-dev \
  libgtk-3-dev \
  libayatana-appindicator3-dev \
  librsvg2-dev

# Optional — hardware key (FIDO2/YubiKey) support:
sudo apt install -y libudev-dev

git clone https://github.com/kenlacroix/moodhaven-journal.git
cd moodhaven-journal
npm install
npm run tauri build

Output: src-tauri/target/release/bundle/.AppImage + .deb

macOS

xcode-select --install

git clone https://github.com/kenlacroix/moodhaven-journal.git
cd moodhaven-journal
npm install
npm run tauri build

# Universal binary (Intel + Apple Silicon):
npm run tauri build -- --target universal-apple-darwin

Output: .app bundle + .dmg

Windows

  1. Install Visual Studio Build Tools 2022 with Desktop development with C++
  2. WebView2 Runtime is pre-installed on Windows 10/11
git clone https://github.com/kenlacroix/moodhaven-journal.git
cd moodhaven-journal
npm install
npm run tauri build

Output: .msi + .exe NSIS installer


Development Mode

npm run tauri dev          # Desktop dev server with hot reload
npm run dev:web            # Browser dev server (no Rust needed)
VITE_DEV_MODE=bypass npm run dev:web   # Skip auth gate for browser dev
npm run build:web          # Browser build → dist-web/

Build with Hardware Key Support

cd src-tauri
cargo build --release --features hardware-key

Linux note: Requires libudev-dev at compile time and libudev1 at runtime. If libudev is unavailable, omit --features hardware-key and the feature will simply be absent from the build.


Troubleshooting

Issue Solution
Rust compilation errors rustup update
WebKit not found (Linux) Install libwebkit2gtk-4.1-dev
libudev not found (Linux) Install libudev-dev OR build without --features hardware-key
Code signing failed (macOS) Check certificate and key paths in environment
npm run tauri dev opens blank window Check src-tauri/tauri.conf.json dev URL matches the Vite port

Release Checklist

  • Version bumped: package.json, Cargo.toml, tauri.conf.json
  • npm run typecheck passes (zero errors)
  • cargo check passes
  • npm test — all tests pass
  • npm audit + cargo audit clean
  • Linux: AppImage works on Ubuntu 22.04+
  • Windows: MSI installs on Windows 10/11
  • macOS: DMG installs on macOS 10.15+
  • GitHub release created with CHANGELOG entry

Full reference: .claude/docs/build.md

Clone this wiki locally