Building and running
Toolchain
Section titled “Toolchain”The Rust version is pinned in rust-toolchain.toml (1.99.0, with the wasm32-unknown-unknown target); rustup installs it automatically. On Linux the desktop shell also needs the WebKitGTK development packages:
sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-devTwo prebuilt tools, installed with cargo-binstall (so nothing is compiled):
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bashEveryday commands
Section titled “Everyday commands”The development laptop is slow, so run the narrowest command that verifies a change:
cargo fmt --allcargo clippy -p beholder-server --all-targets -- -D warningscargo test -p beholder-server permissionscargo check -p beholder-core -p beholder-protocol -p beholder-ui --target wasm32-unknown-unknownBefore a commit that touches several crates:
cargo clippy --workspace --all-targets -- -D warnings && cargo test --workspaceRun the app
Section titled “Run the app”Terminal 1, the server (data in ./data-dev):
BEHOLDER_DATA_DIR=./data-dev cargo run -p beholder-serverTerminal 2, the desktop app (it starts trunk serve for the UI on port 1420):
cd apps/desktop/src-tauricargo tauri devUse http://127.0.0.1:8080 as the server address. To try two players, register a second account on another machine pointing at your LAN IP, or log out and in again.
Release builds and packages
Section titled “Release builds and packages”cd apps/desktop/ui && trunk build --release # UI only; WASM in dist/cd apps/desktop/src-tauri && cargo tauri build --bundles deb,rpm # Linuxcd apps/desktop/src-tauri && cargo tauri build --bundles nsis # Windowsdocker build -f deploy/Dockerfile -t beholder-server . # server imageCI (.github/workflows/) runs fmt, clippy, tests and the wasm check on every push, reports the UI WASM and server binary sizes, publishes the server image to GHCR, and builds the installers on v* tags.
Slow networks
Section titled “Slow networks”Downloading crates over a slow VPN is the usual bottleneck. Fetch once while the connection is good, then work offline:
export CARGO_NET_RETRY=10 CARGO_HTTP_TIMEOUT=180cargo fetchcargo build --offlineA crates.io mirror such as rsproxy.cn can be set in your user-level ~/.cargo/config.toml (never in the repository).
This documentation
Section titled “This documentation”The docs are an Astro Starlight site in docs/site. They need Node ≥ 22.12:
cd docs/sitenpm installnpm run dev # http://localhost:4321/docs/npm run build # static site in docs/site/dist, with offline search