# Introduction

> What Kurogane is, what it's for and when another tool fits better.

Kurogane is a composable Chromium runtime for Rust. It embeds Chromium in your application through [CEF](https://github.com/chromiumembedded/cef) and leaves your application in charge.

Your interface is a web page. Your backend is Rust. Kurogane runs the page in Chromium and connects it to your Rust code.

## What you get

* **One engine everywhere.** Your app renders with the same Chromium on Linux, Windows and macOS. No system WebView decides how your page looks or which GPU path it takes.
* **Your own architecture.** Kurogane can run the event loop and the windows for you. Your app can also own both and drive Chromium from its own loop.
* **A clear boundary to native code.** A page reaches Rust only through the commands, events and streams you register. Each request is checked against the page's origin before your handler runs.
* **Tooling.** The `kurogane` CLI creates projects from starters, runs them during development and bundles them for distribution.

## How an app is put together

Your app's binary is Chromium's browser process. Chromium starts its renderer, GPU and utility processes from the same binary. Your Rust code runs in the browser process. Your page runs in a renderer. [IPC](https://kurogane-rs.org/docs/concepts/ipc.md) connects the two.

You describe the app with [`App`](https://kurogane-rs.org/docs/api/app/app.md). It names the frontend, the commands the page may call, the windows to open and how Chromium behaves. Starting it gives you an [`AppInstance`](https://kurogane-rs.org/docs/api/app/appinstance.md), the running application. An [`AppHandle`](https://kurogane-rs.org/docs/api/app/apphandle.md) reaches it from any thread.

An app runs one of two ways:

* **Kurogane runs the loop.** [`App::run`](https://kurogane-rs.org/docs/api/app/app.md#method.run) opens the windows and runs Chromium's message loop until the app ends.
* **Your app runs the loop.** [`App::start_embedded`](https://kurogane-rs.org/docs/api/app/app.md#method.start_embedded) starts the runtime without Chromium's loop. Your event loop drives Chromium and owns the windows Chromium draws into.

> [!NOTE]
> Chromium's helper processes run your binary again. Code before the call that starts the runtime runs once in every process. See [`App`](https://kurogane-rs.org/docs/api/app/app.md) for what belongs there.

## When to use Kurogane

* **Your app already has an architecture.** It has its own event loop, window hierarchy or GUI framework. Kurogane adds Chromium as one component of it.
* **Rendering has to match across platforms.** WebGL, Canvas and WASM-heavy visualizations behave the same on every OS.
* **You want Chromium without Electron.** There is no bundled Node.js and no process model imposed on your app.
* **You're building a custom shell or engine.** You need the browser's lifecycle, renderer-side extension points or fine-grained IPC between Rust and JavaScript.

## When to use something else

* You want the smallest binary: use [Tauri](https://tauri.app).
* You want Node.js APIs: use [Electron](https://www.electronjs.org).
* You're building a standard CRUD interface: use either.

Kurogane favors control over convenience and breadth. It isn't a replacement for Tauri or Electron.

## What Kurogane is not

Kurogane is a platform foundation and not an application framework. It has none of these:

* A DOM abstraction layer
* A widget toolkit
* Opinionated state management
* A bundled JavaScript runtime

## Status

Kurogane supports Linux, Windows and macOS. It is in early development. Its API may change between releases.
