Skip to content

Project layout and scripts ​

Toolchain ​

LayerTechnology
Desktop shellTauri 2
BackendRust, edition 2024 (needs Rust 1.85 or newer). Crate altar-studio, library altar_studio_lib.
DatabaseSQLite through rusqlite (bundled), WAL mode, FTS5
InterfaceReact 19, TypeScript ~6.0, Vite 8, Tailwind CSS v4
Componentsshadcn/ui-style primitives on radix-ui, lucide-react icons, sonner toasts, cmdk, dnd-kit, react-resizable-panels
Statezustand 5
Documentsjszip, pdfjs-dist (interface); zip, quick-xml (Rust)
Speechsherpa-onnx (offline speech-to-text, prebuilt static libraries) and cpal (audio input), in the shared altar-speech crate
Autopilot Linktokio, tokio-tungstenite (WebSocket), mdns-sd (Bonjour), spake2 and snow (pairing and encryption)
FontsFontsource variable fonts, bundled
Testsvitest 5; Rust #[test] modules
Git hooksHusky 9 (.husky/pre-push)

Prerequisites: Node 20 or newer, stable Rust, and the Tauri 2 platform prerequisites: WebView2 on Windows, Xcode command-line tools on macOS, WebKitGTK on Linux. Linux also needs libasound2-dev. Nothing pins the exact toolchain: there's no rust-toolchain file and no engines field. The Linux build image (scripts/linux/Dockerfile) uses Node 24.19.0 and Rust 1.98.1.

npm scripts ​

Run these from the app repository root.

ScriptRunsPurpose
npm run devviteVite dev server on port 1420. In a browser, the interface uses an in-memory mock backend.
npm run tauri devTauri CLIThe desktop app. Starts npm run dev and builds the Rust backend.
npm run buildtsc && vite buildType-check, then bundle the interface to dist/. This is the type-check gate.
npm run previewvite previewServe the built dist/
npm run tauri buildTauri CLIRelease build and installers
npm run tauri <cmd>Tauri CLIAny other Tauri CLI command
npm run iconsnode branding/build-icons.mjsRegenerate app icons and the favicon from the SVG masters
npm run logo-videoswift -O branding/logo-animation.swiftRender the 5-second logo animation (macOS only)
npm testvitest runRun all TypeScript tests once, Autopilot's included
npm run packs:lower-thirdsnode scripts/build-lower-third-packs.tsWrite the bundled lower-third packs, animated and still
npm run release:upload -- <tag>node scripts/release-upload.mjsBuild and upload a release to R2. The pre-push hook runs the same script. See Release a new version.
npm run release:linux -- <tag>bash scripts/linux/release-linux.shBuild and smoke-test both apps' Linux packages in Docker
npm run autopilot:measure -- <folders>node autopilot/scripts/measure.mjsReplay Autopilot recordings through the follower and score them
preparehuskyInstalls the Git hooks. npm runs it by itself on npm install.

There are no lint or format scripts and no ESLint, Prettier or rustfmt.toml configuration. TypeScript is strict, with noUnusedLocals, noUnusedParameters and noFallthroughCasesInSwitch.

Rust tests run with cargo test in src-tauri/, and separately in each crate under crates/ and in autopilot/src-tauri/. See Run the tests.

On Windows, npm run may refuse with EALLOWSCRIPTS. Run the script's command directly instead, such as node scripts/release-upload.mjs v1.2.3.

The Autopilot app has its own scripts in autopilot/package.json: dev (Vite on port 1430), build and tauri.

Folders ​

index.html               Entry page; pre-paint script picks light/dark, in-window splash
splash.html              The small launch window shown before the control window
vite.config.ts           React + Tailwind plugins, @ → src, port 1420 (strict), both pages
.husky/pre-push          Runs scripts/release-upload.mjs on every push
.env                     R2 settings for releases (not in git)
branding/                Logo and icon SVG masters, build-icons.mjs, logo animation, brand guide
public/favicon.svg       Generated by npm run icons
scripts/
  release-upload.mjs     Builds and uploads a release (pre-push hook)
  linux/                 Dockerfile, build and smoke-test scripts for the Linux packages
  build-lower-third-packs.ts   The bundled lower-third packs
releases/                Local copies of release builds and release.txt (not in git)
crates/
  autopilot-link/        The Link's messages, shared by both apps; secure.rs: pairing and encryption
  altar-speech/          Speech engine shared by Listen and Autopilot: audio input, voice
                         detection, transcription, model downloads, lyric spotting, model choice
autopilot/               Altar Studio Autopilot, a second Tauri app (see below)
src/
  main.tsx               Entry: applies appearance (control) or "output" class
  App.tsx                Role router and error boundaries
  components/ui/         Interface primitives
  control/               Operator workspace
    ControlApp.tsx       Startup, page routing, logo
    TopBar.tsx           Page tabs, save state, output chips
    FirstRun.tsx         First-run wizard
    keyboard.ts          Global shortcuts
    OutputsDialog.tsx    Displays and outputs
    present/             Present page: schedule, Main View, Preview/Live, control bar, preflight,
                         the Autopilot pill (AutopilotPill.tsx)
    resources/           Library page and the resource band panels, Listen's Heard list (Listening.tsx)
    editors/             Item, song, deck, theme, lower third, breaker and feed editors
    import/              Document import dialog
    services/            Services page and .altar packages
    settings/            Settings page
  output/                Audience, confidence and identify windows
  render/                Layout engine, scene and slide renderers, keyer, camera, effects, fonts
  state/                 zustand stores
  lib/                   Typed backend bindings, mock backend, domain types, parsers,
                         spokenRefs.ts (references in speech transcripts), splash.ts
  assets/bible/kjv.json  The bundled King James Version
  styles/globals.css     Tailwind v4 and interface tokens
src-tauri/
  tauri.conf.json        Windows (splash, then control), CSP, asset protocol, bundle settings
  .cargo/config.toml     Static C runtime on Windows, to match sherpa-onnx's libraries
  build.rs               Declares every command (per-window permissions)
  capabilities/          default.json (control window), output.json (output windows)
  permissions/autogenerated/   One allow/deny file per command (generated, committed)
  Info.plist, Entitlements.plist   macOS camera, microphone and local network access
  icons/                 Generated by npm run icons
  src/                   Rust modules (below)

Rust modules ​

ModuleResponsibility
main.rsCalls altar_studio_lib::run(). No console window in release builds on Windows.
lib.rsApp state, plugins, command registration, closing output windows with the control window
error.rsAppError and AppResult
db.rsOpening SQLite, pragmas, migrations, settings helpers
workspace.rsWorkspace location, first-run info, open and reveal
library.rsResources, services, settings and history
assets.rsHash-addressed media store and file helpers
bible.rsaltar-bible/1 packs, passages, keyword search
backup.rsVACUUM INTO backups, retention, validated restore
package.rs.altar export, inspect and import
docparse.rsDOCX text extraction
pptx.rsPowerPoint import
coordinator.rsPreview and Live state, revisions, command IDs, transitions, acknowledgements
outputs.rsDisplay list, output and identify windows, display-loss watch
permissions.rsWebView2 camera permission handling (Windows)
splash.rsThe launch window, then the maximized control window after two seconds
speech.rsListen: the altar-speech engine behind the speech_* commands and events. Models are kept in the app's local data folder, shared with Autopilot.
autopilot.rsAltar Studio's side of Autopilot: the loopback Link server, launching and watching the app, its commands, and the requests the control window carries out
autopilot_net.rsNetwork mode: listening on port 47820, the Bonjour announcement, pairing, paired computers
autopilot_log.rsThe decision log: one JSON line per event, a file per service and day
autopilot_track.rsEach kind's track record, and whether it has earned moving Live in Auto

zustand stores ​

StoreFileResponsibility
useWorkspacestate/workspace.tsWorkspace info and caches: settings, themes, breakers, feeds, lower thirds, assets, Bible packs. renderVersion changes whenever render inputs change.
usePresentstate/present.tsStaging and selection, Preview and Live commands, the Enter gesture, live history, a mirror of the backend's live state, output-loss handling
useServicestate/service.tsThe open service and service list, schedule edits, 100-step undo/redo, autosave (700 ms debounce, saves run one at a time)
useUIstate/ui.tsCurrent page, section order, editor and dialog flags, live details open
useAppearancestate/appearance.tsControl-window colour scheme and interface font and size, kept in localStorage
useScriptureHistorystate/scriptureHistory.tsPassages sent live, saved in the workspace setting scripture-history
useSpeechstate/speech.tsListen: status, models, input, and the Heard list of references found in what was said, from Listen or from Autopilot
useAutopilotstate/autopilot.tsAutopilot's status, the mode per type, pause, network mode and pairing, and what it is following

Two modules work beside the stores in the control window. state/autopilotBridge.ts carries out Autopilot's requests: it lays out a passage or Word slide the way the operator's Go Live would, then sends it Live marked as Autopilot's, or to Preview. It also tells Autopilot which scriptures the live Word item plans. state/sungLine.ts decides the sung line to colour on screen and sends it to every window as live:sung.

Workspace data is saved through the backend in SQLite. Only per-computer interface preferences use localStorage.

Altar Studio Autopilot ​

autopilot/ is a separate Tauri 2 and React app with its own window, built and released beside Altar Studio. It has no npm packages of its own: it uses the repository's node_modules and, through the @ alias, Altar Studio's interface components and parsers.

autopilot/
  src/
    App.tsx, Connect.tsx, Recordings.tsx   The window: the link, what it follows, network, recordings
    follow/follower.ts   The follower: transcripts and Live in, commands out (pure, tested)
    follow/driver.ts     Runs the follower in the window
    measure/             Reading, replaying and scoring recordings
  scripts/               measure.mjs and measure-cli.ts (npm run autopilot:measure)
  src-tauri/src/
    link.rs              The Link client
    listen.rs            Listening with altar-speech
    net.rs               Network mode: discovery, pairing, remembered Altar Studios
    record.rs            Recording a service: audio.wav, events.jsonl, meta.json

Version string ​

Altar Studio's version appears in seven places. A release changes all of them. Autopilot has its own version, in four places. See Release a new version.

FileField
package.jsonversion
package-lock.jsontwo places
src-tauri/Cargo.toml[package] version
src-tauri/Cargo.lockthe altar-studio entry
src-tauri/tauri.conf.jsonversion (what the app reports at runtime)
src/control/settings/SettingsPage.tsxfallback shown before the backend answers
src/lib/mock-backend.tsthe browser preview's workspace_info

Altar Studio by Milton Black. Free and open source.