Skip to content

Building from Source

Virgile Thonnier edited this page Aug 29, 2026 · 2 revisions

Building from Source

Prerequisites

  • Node.js (LTS) + npm.
  • Rust (stable) with the MSVC toolchain on Windows.
  • protoc (Protocol Buffers compiler) — required by LanceDB (lance-encoding). choco install protoc or winget install protobuf, and make sure it's on PATH. This is the one non-obvious native prerequisite.
  • Visual Studio C++ build tools and WebView2 (usually already present on Win10/11).

Clone & run

git clone https://github.com/Eligrive/SenseTree.git
cd SenseTree
npm install

npm run tauri dev      # dev build, hot-reload frontend

The first build is long: it compiles heavy crates (ort, lancedb, arrow, hayro) and, on first index, downloads ONNX Runtime and the local embedding model.

Scripts

Command Does
npm run dev Vite dev server (frontend only).
npm run build tsc typecheck + Vite production build.
npm run tauri dev Full app in development.
npm run tauri build Production build → installers in src-tauri/target/release/bundle/.
cargo test --manifest-path src-tauri/Cargo.toml The Rust test suite.

Rust changes require restarting npm run tauri dev; frontend changes hot-reload.

Tests

Unit tests cover the regression-prone areas: path-boundary security, prompt fallback, config backward compatibility, chunking, tool schemas, MCP JSON-RPC/SSE parsing, transcription and video wire format (against a throwaway local HTTP server), scoring functions, and queue state transitions.

There is also a manual embedding benchmark, ignored by default:

EMBED_MODEL=multilingual-e5-large \
  cargo test --lib banc_embedding_local -- --ignored --nocapture

It reports load time, chunks/s and MB/s for a local model under realistic indexing conditions (batches of 32 × 1000-character chunks).

Project layout

SenseTree/
├─ src/                 # React 19 + TS frontend
│  ├─ components/       # UI panels & modals
│  └─ lib/              # typed IPC, types, helpers
├─ src-tauri/           # Rust core (Tauri v2)
│  ├─ src/              # backend modules (see Architecture)
│  ├─ Cargo.toml        # Rust deps + app version
│  └─ tauri.conf.json   # bundle config + version + identifier + updater
├─ docs/                # product & technical specifications
├─ package.json         # frontend deps + app version
└─ .github/workflows/   # ci.yml (build + tests) · release.yml (tagged release)

Module-by-module map: Architecture.

Bundle configuration

src-tauri/tauri.conf.json:

  • productName: sensetree, identifier: com.virgi.sensetree — the identifier is the stable key that makes upgrades install in place. Don't change it lightly.
  • bundle.targets: "all" → both NSIS (-setup.exe) and MSI installers.
  • bundle.createUpdaterArtifacts: true → emits the signed artifacts and latest.json the updater consumes.
  • plugins.updater → the release feed URL and the minisign public key the app checks every update against.

CI

.github/workflows/ci.yml builds and tests on every push to main and every PR (windows-latest), and also runs twice a week to keep the Rust build cache warm. That cache (shared key tauri-release) is what takes a release build from ~1h40 to ~10–15 min, and GitHub evicts caches untouched for 7 days — hence the schedule.

Releasing

.github/workflows/release.yml triggers on a v* tag:

  1. Bump the version in three places so they agree: package.json, src-tauri/Cargo.toml (and Cargo.lock — CI builds --locked), src-tauri/tauri.conf.json.
  2. Commit, tag, push:
    git commit -am "chore(release): version X.Y.Z"
    git tag -a vX.Y.Z -m "SenseTree vX.Y.Z"
    git push origin main
    git push origin vX.Y.Z
  3. The workflow installs Node, Rust and protoc, restores the warm cache, builds, signs the updater artifacts, and publishes a GitHub Release named SenseTree vX.Y.Z with the installers and latest.json attached.

The tag must match v + the version in tauri.conf.json. A tag build uses the workflow file as of the tagged commit, so if you fix the workflow itself, re-create the tag on the commit containing the fix.

Update signing

Auto-update artifacts are signed with a minisign key pair generated by npm run tauri signer generate. The public key lives in tauri.conf.json; the private key and its password live in the repository secrets TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD.

Two consequences worth knowing:

  • Losing the private key breaks auto-update for existing installs. A new key means a new public key in the config, which only ships in a build users would have to install manually.
  • The repository must stay public, or the updater's release endpoint returns 404 and no installed client can see updates.

Common build issue

Could not find protoc → install protoc (above). See Troubleshooting.

Clone this wiki locally