1. Tuntau
  2. Learn
  3. Atrium

Atrium

Build a desktop app with a web interface and a Rust backend: create a project, call Rust commands from the page, and package it for every OS.

PreviewmacOS tested
On this page
  1. Create an app
  2. Call Rust from the page
  3. Permissions
  4. Built-in APIs
    1. Embedding web pages
  5. Configuration
  6. Build and ship
  7. CLI reference

Preview. Atrium is not on npm or crates.io yet; projects build against a Sola source checkout. The Windows and Linux packages haven't been run on those systems yet.

Create an app

atrium create "Hello" --dir hello          # plain TypeScript, no build step
atrium create "Notes" --template flare     # npm packages and TSX, bundled by Flare
cd hello
atrium dev                                 # run it; reloads as you edit

A project looks like this:

atrium.toml        app name, identifier, version, bundle settings
Cargo.toml
build.rs           packs the front end into the binary
icon.png           1024 × 1024
src/main.rs        your Rust code
frontend/          index.html, main.ts, style.css, bindings.ts (generated)

Call Rust from the page

Mark a function as a command, register it, and allow the window to call it:

use sola_atrium::{command, commands, App, WindowOptions};

#[command]
fn greet(name: String) -> String {
    format!("Hello, {name}!")
}

fn main() {
    App::new("Hello")
        .identifier("com.example.hello")
        .assets(sola_atrium::include_assets!())
        .commands(commands![greet])
        .export_bindings(concat!(env!("CARGO_MANIFEST_DIR"), "/frontend/bindings.ts"))
        .window(WindowOptions::new("main").title("Hello").allow(&["greet"]))
        .run();
}

Atrium writes typed bindings, so the page calls it like any async function:

import { commands } from './bindings';
const text = await commands.greet('world');
  • Plain fn commands run inside the call; async fn commands run on a small thread pool.
  • Values cross directly, with no JSON text. Binary data travels as ArrayBuffer without copying.
  • Events go both ways: atrium.listen / atrium.emit in the page, AppHandle::emit / listen in Rust.

Permissions

Everything is denied until you allow it. A window can only call the commands and built-in APIs in its allow list. Only your own pages (served at app://localhost) get the bridge; iframes never do, and links to other sites open in the user's browser.

Built-in APIs

Built-in APIs
APIWhat it does
atrium.windowopen, close, move, resize, title
atrium.dialogopen, save and message dialogs
atrium.clipboardread and write the clipboard
atrium.notification.sendsystem notifications
atrium.shell.openopen http(s) and mailto links in the default app
atrium.updatercheck(), download(), restart()

Embedding web pages

<atrium-view> shows any web page in your app, each with its own history and storage partition (persist:name), optional ad blocking and request interception. It has methods like loadURL, goBack, executeJavaScript and capturePage, and events like did-navigate and page-title-updated.

Configuration

[app]
name = "Hello"
identifier = "com.example.hello"
version = "1.0.0"

[frontend]
dir = "frontend"
compile = true                       # precompile pages to .sola
dev_url = "http://localhost:5173"    # optional: use your own dev server

[bundle]
icon = "icon.png"
url_schemes = ["hello"]

Build and ship

atrium build                               # this OS
atrium build --target all --arch all       # macOS, Windows and Linux from one Mac
atrium build --sign "Developer ID Application: …" --notarize --keychain-profile p
atrium update keygen                       # keys for signed updates
atrium update sign --key key.pem --url https://example.org/app.zip app.zip
Build and ship
OSOutput
macOSuniversal .app and .dmg
Windowsx64 / arm64 .zip and a per-user installer
Linuxx64 / arm64 .AppImage, .deb, .tar.gz

CLI reference

atrium create <name> [--template vanilla|flare] [--dir DIR] [--identifier ID]
atrium dev [--release]
atrium run [args…]
atrium build [--target macos|windows|linux|all] [--arch x64|arm64|all] [--no-dmg] [--sign ID] [--notarize]
atrium sign <App.app> [--sign ID] [--notarize --keychain-profile P]
atrium update keygen | atrium update sign …
atrium pack [-o out.atrium]
atrium info