mix ex_tauri.install (ex_tauri v0.2.0)

View Source

Installs and configures Tauri in your Phoenix project.

Uses Igniter for safe, AST-aware modifications to your Elixir project files, then sets up the Tauri project structure with Rust code, capabilities, and a JS bridge.

Usage

$ mix ex_tauri.install

What It Does

  1. Sets default config (via Igniter) — app_name, host, port, version in config/config.exs (only if not already configured)

  2. Configures Elixir project (via Igniter):

  3. Installs Tauri CLI — Downloads via Cargo

  4. Initializes Tauri project — Creates src-tauri/ structure

  5. Generates integration code:

    • Rust main.rs with heartbeat and graceful shutdown
    • Tauri V2 capabilities and permissions
    • LiveView JS hook for Tauri bridge
  6. Auto-injects hooks:

    • Imports TauriHook in assets/js/app.js
    • Registers the hook in the LiveSocket constructor
    • Adds <div id="tauri-bridge"> to the root layout

Next Steps

After installation, just run:

$ mix ex_tauri.dev

Review the generated config in config/config.exs to customize your app name, port, or window settings.

For more information, see: https://github.com/filipecabaco/ex_tauri