Skip to content

Tauri + Cargo Build

neegde-tauri is built with cargo tauri dev (development) and cargo tauri build (release). Tauri's CLI orchestrates Vite for the frontend and Cargo for the Rust backend, then bundles both into a native .app / .dmg.

Sources: src-tauri/Cargo.toml, src-tauri/tauri.conf.json


Build commands

cargo tauri dev      # Vite dev server + Tauri hot-reload (watch mode)
cargo tauri build    # Release bundle (.app + .dmg on macOS)
cargo check          # Rust-only type check, no C++ compile (fast)

The build.rs script runs as part of cargo build. It calls cmake::Config::build() which configures, compiles, and installs vozduxan (see vozduxan CMake Build).


Build output

src-tauri/target/
  debug/
    neegde               ← debug executable
    neegde.app/          ← macOS app bundle (debug)
  release/
    neegde               ← release executable
    bundle/
      macos/
        neegde.app/      ← signed .app
        neegde_*.dmg     ← distributable disk image

All persistent data lives next to the executable (neegde.app/Contents/MacOS/), not in ~/Library/Application Support. This portable layout means moving the .app moves all its data.


Key Cargo dependencies

Crate Purpose
tauri 2 Tauri framework, IPC, WebView management
tauri-build Build-time code generation for Tauri
cmake Runs CMake from build.rs to build vozduxan
reqwest HTTP client for RuTracker and Brave Search
tokio Async runtime (full features)
serde / serde_json Serialization for all IPC types
base64 .torrent file encoding, image data URLs
encoding_rs Windows-1251 decode for RuTracker responses
reqwest_cookie_store phpBB session cookie persistence
dashmap Lock-free concurrent map (SoulSeek search token routing)
argon2 Brave Search PoW challenge solving
md5 SoulSeek login hash, SoulSeek cover cache key
flate2 zlib decompress for FileSearchResponse
lru Cover art LRU cache
tokio-util Codec helpers

Debug vs release differences

Feature Debug build Release build
BT session path {exe_dir}/dev/bt/ {exe_dir}/bt/
Dev search dumps {exe_dir}/dev/dumps/ disabled
Debug window Opens automatically in App.vue Only on ?app-debug URL
cfg!(debug_assertions) true false

The dev/bt/ isolation prevents dev libtorrent sessions (accumulated piece cache, DHT routing table) from contaminating the production data directory on the same machine.


Frontend build (Vite)

vite build     # production frontend bundle → dist/

Tauri embeds the dist/ output into the app bundle at Contents/Resources/_app_. In dev mode, cargo tauri dev starts Vite on http://localhost:1420 and the Tauri WebView loads from there.

vite.config.js configures: - base: "./" — relative paths for embedded resources - TypeScript path aliases for src/ imports - Build target: esnext (modern Chromium/WKWebView)


tauri.conf.json highlights

  • bundle.identifier: ru.neegde.app — used by macOS for code signing and Keychain namespacing
  • bundle.icon: custom app icon at multiple sizes
  • security.csp: "default-src 'self'; connect-src 'self' http://127.0.0.1:*; media-src 'self' http://127.0.0.1:*; img-src 'self' data: http://127.0.0.1:*" — allows the WebView to load from the local HTTP streaming servers and display data: URLs for cover art