Project layout and scripts
Toolchain
| Layer | Technology |
|---|---|
| Desktop shell | Tauri 2 |
| Backend | Rust, edition 2024 (needs Rust 1.85 or newer). Crate altar-studio, library altar_studio_lib. |
| Database | SQLite through rusqlite (bundled), WAL mode, FTS5 |
| Interface | React 19, TypeScript ~6.0, Vite 8, Tailwind CSS v4 |
| Components | shadcn/ui-style primitives on radix-ui, lucide-react icons, sonner toasts, cmdk, dnd-kit, react-resizable-panels |
| State | zustand 5 |
| Documents | jszip, pdfjs-dist (interface); zip, quick-xml (Rust) |
| Speech | sherpa-onnx (offline speech-to-text, prebuilt static libraries) and cpal (audio input), in the shared altar-speech crate |
| Autopilot Link | tokio, tokio-tungstenite (WebSocket), mdns-sd (Bonjour), spake2 and snow (pairing and encryption) |
| Fonts | Fontsource variable fonts, bundled |
| Tests | vitest 5; Rust #[test] modules |
| Git hooks | Husky 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.
| Script | Runs | Purpose |
|---|---|---|
npm run dev | vite | Vite dev server on port 1420. In a browser, the interface uses an in-memory mock backend. |
npm run tauri dev | Tauri CLI | The desktop app. Starts npm run dev and builds the Rust backend. |
npm run build | tsc && vite build | Type-check, then bundle the interface to dist/. This is the type-check gate. |
npm run preview | vite preview | Serve the built dist/ |
npm run tauri build | Tauri CLI | Release build and installers |
npm run tauri <cmd> | Tauri CLI | Any other Tauri CLI command |
npm run icons | node branding/build-icons.mjs | Regenerate app icons and the favicon from the SVG masters |
npm run logo-video | swift -O branding/logo-animation.swift | Render the 5-second logo animation (macOS only) |
npm test | vitest run | Run all TypeScript tests once, Autopilot's included |
npm run packs:lower-thirds | node scripts/build-lower-third-packs.ts | Write the bundled lower-third packs, animated and still |
npm run release:upload -- <tag> | node scripts/release-upload.mjs | Build 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.sh | Build and smoke-test both apps' Linux packages in Docker |
npm run autopilot:measure -- <folders> | node autopilot/scripts/measure.mjs | Replay Autopilot recordings through the follower and score them |
prepare | husky | Installs 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
| Module | Responsibility |
|---|---|
main.rs | Calls altar_studio_lib::run(). No console window in release builds on Windows. |
lib.rs | App state, plugins, command registration, closing output windows with the control window |
error.rs | AppError and AppResult |
db.rs | Opening SQLite, pragmas, migrations, settings helpers |
workspace.rs | Workspace location, first-run info, open and reveal |
library.rs | Resources, services, settings and history |
assets.rs | Hash-addressed media store and file helpers |
bible.rs | altar-bible/1 packs, passages, keyword search |
backup.rs | VACUUM INTO backups, retention, validated restore |
package.rs | .altar export, inspect and import |
docparse.rs | DOCX text extraction |
pptx.rs | PowerPoint import |
coordinator.rs | Preview and Live state, revisions, command IDs, transitions, acknowledgements |
outputs.rs | Display list, output and identify windows, display-loss watch |
permissions.rs | WebView2 camera permission handling (Windows) |
splash.rs | The launch window, then the maximized control window after two seconds |
speech.rs | Listen: the altar-speech engine behind the speech_* commands and events. Models are kept in the app's local data folder, shared with Autopilot. |
autopilot.rs | Altar 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.rs | Network mode: listening on port 47820, the Bonjour announcement, pairing, paired computers |
autopilot_log.rs | The decision log: one JSON line per event, a file per service and day |
autopilot_track.rs | Each kind's track record, and whether it has earned moving Live in Auto |
zustand stores
| Store | File | Responsibility |
|---|---|---|
useWorkspace | state/workspace.ts | Workspace info and caches: settings, themes, breakers, feeds, lower thirds, assets, Bible packs. renderVersion changes whenever render inputs change. |
usePresent | state/present.ts | Staging and selection, Preview and Live commands, the Enter gesture, live history, a mirror of the backend's live state, output-loss handling |
useService | state/service.ts | The open service and service list, schedule edits, 100-step undo/redo, autosave (700 ms debounce, saves run one at a time) |
useUI | state/ui.ts | Current page, section order, editor and dialog flags, live details open |
useAppearance | state/appearance.ts | Control-window colour scheme and interface font and size, kept in localStorage |
useScriptureHistory | state/scriptureHistory.ts | Passages sent live, saved in the workspace setting scripture-history |
useSpeech | state/speech.ts | Listen: status, models, input, and the Heard list of references found in what was said, from Listen or from Autopilot |
useAutopilot | state/autopilot.ts | Autopilot'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.jsonVersion 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.
| File | Field |
|---|---|
package.json | version |
package-lock.json | two places |
src-tauri/Cargo.toml | [package] version |
src-tauri/Cargo.lock | the altar-studio entry |
src-tauri/tauri.conf.json | version (what the app reports at runtime) |
src/control/settings/SettingsPage.tsx | fallback shown before the backend answers |
src/lib/mock-backend.ts | the browser preview's workspace_info |