Skip to content

voltkithq/Volt

Volt

Volt

CI npm License: BSL 1.1

Build desktop apps with TypeScript and web technologies, powered by a Rust runtime.

Volt is a TypeScript-first desktop framework for teams that want a smaller, safer, more native stack than Electron without forcing app developers to write Rust. Main-process TypeScript handles orchestration, windows, plugins, and background workflows, while performance-sensitive work runs through Rust-backed Volt APIs.

Quick Start

npx @voltkit/create-volt my-app
cd my-app
npm install
npm run dev

Or if you already have @voltkit/volt-cli installed:

volt new my-app

Supports Vanilla, React, Vue, Svelte, and Enterprise templates out of the box. Pass --framework react (or vue, svelte, enterprise) to skip the prompt.

Build and package for distribution:

npm run build
npm run package

Why Volt over Electron or Tauri?

Electron Tauri Volt
Runtime Chromium + Node.js Rust + system webview Rust + system webview
Binary size ~150 MB+ ~3-10 MB ~21 MB (includes Boa JS engine)
Backend language JavaScript Rust TypeScript orchestration + Rust-backed APIs
Learning curve Low (all JS) Steep (must write Rust) Low (all TypeScript)
Permission model None by default Capability config Capability config + grant delegation
Plugin system None built-in None built-in Process-isolated, 15ms cold start
API style require('electron') Rust commands ipcMain, BrowserWindow, data, workflow

Volt sits between Electron and Tauri. You get Electron-style TypeScript app authoring with a Rust-backed runtime, capability-based permissions by default, and native fast paths for heavy operations. Volt's binary is larger than Tauri because it embeds the Boa JavaScript engine for backend TypeScript execution — the tradeoff for not requiring app developers to write Rust. Volt is not trying to be a drop-in Electron replacement for arbitrary main-process JavaScript workloads.

What Volt Is

  • TypeScript-first for app developers -- frontend and backend code stay in TypeScript
  • Rust-powered under the hood -- heavy work can run through native Volt APIs without exposing Rust to app authors
  • Orchestration-first in the main process -- Boa runs lifecycle, IPC coordination, plugins, and background workflows
  • Native-backed where it matters -- use data and workflow APIs when work should not stay in interpreted JS

What Volt Is Not

  • Not a full Electron compatibility layer -- Volt keeps familiar patterns, but it does not aim to run every Electron/Node desktop package unchanged
  • Not a "write Rust to do anything serious" framework -- that is the tradeoff many teams want to avoid
  • Not a general high-performance JS compute runtime -- heavy main-process operations should use Volt's Rust-backed APIs

What's Included

  • Familiar APIs -- ipcMain.handle(), BrowserWindow, Menu, Tray, globalShortcut, dialog, clipboard, shell, nativeTheme
  • Capability-based permissions -- declare what your app can access in volt.config.ts, everything else is denied
  • Native-backed fast paths -- data and workflow APIs for heavy queries and pipeline execution without writing Rust
  • Built-in updater -- Ed25519 signed updates with SHA-256 verification, no third-party services required
  • Embedded SQLite -- volt:db module for local storage without external dependencies
  • Secure file access -- scoped volt:fs with grant tokens, ScopedFs handles, and file watching
  • Plugin system -- process-isolated plugins with 15ms cold start, capability-based grants, lifecycle events, and CLI tooling (volt plugin init/build/test/doctor)
  • Dev experience -- Vite-powered frontend HMR, backend hot-reload on save, plugin watch/reload, inline sourcemaps for stack traces
  • Cross-platform -- Windows, macOS (Intel + Apple Silicon), Linux

Prerequisites

  • Node.js >= 20
  • Rust stable toolchain
  • Windows: WebView2 Runtime (pre-installed on Windows 10/11)
  • Linux: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev

Project Structure

A Volt app has a frontend (any web framework) and a backend (src/backend.ts) that handles orchestration and IPC:

my-app/
  src/
    main.ts          # frontend entry
    backend.ts       # backend IPC handlers
  volt.config.ts     # app config + permissions
  vite.config.ts     # Vite config
  package.json

Example backend:

import { ipcMain } from 'volt:ipc';

ipcMain.handle('get-users', async () => {
  return [
    { id: 1, name: 'Ada', role: 'admin' },
    { id: 2, name: 'Linus', role: 'member' },
  ];
});

Example frontend:

const users = await window.__volt__.invoke('get-users');

Sandboxed File Access (grant flow)

Let users pick a folder, then read/write files within it — no hardcoded paths, no escape:

// backend.ts
import { showOpenWithGrant } from 'volt:dialog';
import { bindScope } from 'volt:fs';
import { ipcMain } from 'volt:ipc';

ipcMain.handle('open-folder', async () => {
  const result = await showOpenWithGrant({ title: 'Open Folder' });
  if (!result.grantIds.length) return { ok: false };

  const fs = await bindScope(result.grantIds[0]);
  const files = await fs.readDir('');
  return { ok: true, files };
});

See the file-explorer example for a complete app with folder picking, file listing, and live file watching.

Plugins

Extend your app with process-isolated plugins. Each plugin runs in its own sandboxed process with a 15ms cold start:

# Scaffold a plugin
volt plugin init my-plugin

# Build, test, and validate
cd my-plugin
volt plugin build
volt plugin test
volt plugin doctor

Plugin code:

// plugins/my-plugin/src/plugin.ts
import { definePlugin } from 'volt:plugin';

export default definePlugin({
  async activate(context) {
    context.commands.register('greet', async (args) => {
      return { message: `Hello, ${args?.name ?? 'World'}!` };
    });

    context.ipc.handle('search', async (args) => {
      return { results: [] };
    });
  },

  async deactivate(context) {
    context.log.info('Plugin shutting down');
  },
});

App config:

// volt.config.ts
export default defineConfig({
  plugins: {
    enabled: ['my-plugin'],
    grants: { 'my-plugin': ['fs'] },
    pluginDirs: ['./plugins'],
  },
});

Plugins get capability-based permissions (intersection of manifest, host grants, and app permissions), revocable filesystem grants, durable key-value storage, and lifecycle event observability. After 3 consecutive failures, a plugin is automatically disabled without affecting the host app.

Status

Pre-1.0 release (0.1.x). Core APIs are stable enough to build against, but Volt is still defining its exact product boundaries. The current direction is clear: TypeScript-first app authoring, Rust-backed performance for heavy paths, and capability-based desktop APIs with a smaller footprint than Electron.

Documentation

Contributing

pnpm install
pnpm build
cargo test --workspace
pnpm test

See the architecture docs for an overview of the codebase.

License

Business Source License 1.1. You can use Volt to build and ship any application, including commercial ones. The only restriction is you cannot offer Volt itself as a competing product or service.

All code converts to Apache-2.0 on 2030-03-07.

See LICENSE for full terms.

About

Lightweight desktop app framework. TypeScript API, Rust runtime. Electron-style ergonomics without the bloat.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors