Caspian Native
Package a Caspian application for Windows and Android with Tauri 2, while keeping the same Python routes, PulsePoint UI, and RPC model.
WebView-native, not widget-native. The package places the rendered Caspian application in the operating system WebView. It does not convert HTML controls into WinUI, Jetpack Compose, or other platform widgets.
Install
Install the published Python package, then install the Tauri CLI separately so it can match the Tauri 2 version selected by the generated Rust project.
$ python -m pip install caspian-native $ cargo install tauri-cli --version "^2" --locked
Requires Python 3.11 or newer, Rust and Cargo, and the Tauri platform prerequisites. Android additionally needs a JDK, Android SDK, NDK, and ADB.
Platform support
| Target | Backend | Support | How it runs |
|---|---|---|---|
| Windows | Embedded Python | Supported | PyInstaller sidecar on loopback |
| Windows | Remote server | Supported | WebView loads a deployed Caspian URL |
| Android | Remote server | Supported | Thin client loads a deployed Caspian URL |
| Android | Embedded Python | Not supported | Python wheels are not bundled per Android ABI |
Android production builds require network access to the configured remote Caspian server. Embedded Android Python is intentionally refused because a project may depend on ABI-specific wheels such as cryptography, Pillow, or database drivers.
Create and run a native project
Windows
caspian-native init \ --identifier com.example.app \ --windows caspian-native doctor --target windows caspian-native backend build caspian-native dev --target windows caspian-native build --target windows
Android
caspian-native init \ --identifier com.example.app \ --android \ --remote-url https://app.example.com caspian-native doctor --target android caspian-native dev --target android caspian-native build --target android
Run these commands from the Caspian project root—the directory containing
caspian.config.json. Generated files
live under native/, while
caspian.native.json is the source of
truth for the product name, identifier, targets, window, backend, and security.
Development refresh
Your normal Caspian dev stack stays in charge
Native development reuses an existing npm run dev
stack, or starts one for the session. The WebView loads BrowserSync's
reload client, so Python, component, and public-file changes follow the
coordinated Caspian restart and reload flow without rebuilding the
production sidecar.
Android local development also runs adb reverse
for the active BrowserSync port. Add
--android-backend remote when you
intentionally want to test the configured deployment instead.
Runtime and security model
Embedded loopback
Windows starts the packaged Caspian ASGI app on an operating-system-assigned 127.0.0.1 port.
Protected launch
A per-launch token becomes an HttpOnly, SameSite=Strict cookie before app content is accepted.
Per-install secret
The desktop sidecar restores its authentication secret from the application data directory.
Project .env files are never embedded.
Provision remote database and third-party credentials outside the package.
Installer signing and Android store signing remain application-owned steps.
Native bridge
A packaged page can capability-check window.caspianNative
before calling a bridge command. The allowlist is intentionally narrow:
platform, app version, app data directory, external HTTP/HTTPS/mail links,
and a user-driven file picker.
const native = window.caspianNative; if (native?.has("open-external")) { await native.invoke("open_external", { url: "https://example.com", }); }
Treat every bridge command as reachable after an XSS. Keep commands narrowly scoped and safe even when the calling page is compromised.
Deploy the backend
Prepare the remote server used by Android or remote Windows mode.
caspian-native on PyPI
Open release files, history, and package metadata for v0.0.7.