Skip to content

architecture

this page is a contributor-facing overview of how wis is built. the full, authoritative architecture document is WIS.md at the repository root; read it before making changes. subsystem deep dives live in docs/architecture/, and where they disagree, WIS.md wins.

wis is a Cargo workspace with a React and TypeScript chrome, wired together with Tauri 2. the guiding principle is a functional core, imperative shell: pure, dependency-light logic lives in the core crates and is fully testable, while Tauri commands and React components stay thin.

dependencies flow strictly downward; upper layers import lower ones, never the reverse.

wis-browser (crates/shell/src-tauri) Tauri shell, IPC commands, native glue
| \
| wis-import (crates/import) reads other browsers' profiles
|
wis-network (crates/network) privacy decision engine, proxy, DoH, Tor
|
wis-storage (crates/storage) Storage trait + SQLite
| \
wis-core (crates/core) wis-secrets (crates/secrets) vault crypto + key store
(pure data model, no I/O)

code is grouped by feature. a Rust folder’s mod.rs holds only its mod lines and platform gates, and its main file is named for what it holds.

  • wis-core: the pure data model, no I/O. the root BrowserState holds workspaces, the containers they link to, a flat list of tabs, settings, and typed IDs. the rest sits in feature folders: tabs, workspaces, navigation, sites, privacy, vault, extensions, library, canvas, ai, appearance, and settings (which holds the default keymap), with the common types re-exported at the crate root. every mutation is a pure with_* builder that returns a new value.
  • wis-secrets: vault cryptography, master-key storage, and the password generator, isolated from the rest. entries are sealed with ChaCha20-Poly1305 under a random master key held in the OS secure store (the macOS Keychain, or a Windows DPAPI-sealed blob), released only after Touch ID or Windows Hello and zeroized on drop. Linux has no key store, so there the key is sealed in a file under a key derived from a vault password with Argon2id.
  • wis-storage: persistence. a Storage trait with a single SQLite implementation (bundled SQLite in WAL mode): normalized tables, append-only migrations, VACUUM INTO backups, and a resilient open that sets a profile aside only when it fails an integrity check. a profile from a newer build, or saved state that does not read, stops the launch instead of being discarded.
  • wis-import: finds Chromium- and Firefox-family profiles on this machine and reads their bookmarks and history with size caps, copying each SQLite database before opening it. profile files are untrusted input. it depends on wis-core only.
  • wis-network: the privacy decision engine. tracker and ad blocking (the adblock crate, plus the rule lists WebKit compiles on macOS), HTTPS-First, DNS over HTTPS, request policy, and a per-container loopback proxy that forwards directly, through a SOCKS5 host, or through the built-in Tor client (Arti, behind the default-on tor feature).
  • wis-browser: the Tauri shell. AppState, the IPC commands, and feature folders: vault, ai, canvas, protection, pages, tabs, chrome, platform (the per-platform seams described below), system, and data, beside extensions, video_popout, and translation. translation reaches Apple’s Swift-only Translation framework through a Swift bridge that build.rs compiles with swiftc and weak-links, so older macOS still launches.

every mutating command goes through mutate: take the state lock, snapshot for rollback, compute the next state through a pure wis-core transition, persist it, and roll back in memory if the write fails. on success the command emits a browser-state-changed event and the frontend re-fetches state through React Query, which is the single source of truth on the JavaScript side. read-only commands hold the lock only long enough to clone what they need.

the security boundary is local versus remote content, not just the window. Tauri’s command-granting capability covers only wis’s own local webviews (the chrome and its overlay-* webviews) in the main and win-* windows. tab pages (tab-<uuid>) and the peek preview load remote URLs and match no command-granting capability, so a web page can never call a command, without exception. wry’s window.ipc global and Tauri’s own scripts are kept off remote pages too. a canvas tab is wis’s own page on the wis-canvas scheme, also without Tauri IPC: it reads and writes only its workspace’s canvases over a narrow page channel.

native tab webviews composite above the chrome, so any floating UI that must sit over a page (the find bar, command palette, address-bar suggestions, peek, and so on) is a separate per-window overlay webview, positioned natively.

wis runs one OS window per workspace. the chrome bundle is window-agnostic: it reads its own window label at runtime and routes tabs, overlays, peek, and widgets to that window, so a secondary window behaves exactly like the main one over its own workspace. every webview disables wry’s drag-and-drop handler so pages keep native HTML5 drag and drop and file drops, and hidden child webviews are parked off-window so they never intercept a drag meant for the visible page.

on macOS 15.4 and later, extensions run through WebKit’s extension controller, one per container, whose storage and background traffic follow that container’s proxy.

wis is macOS-first, with Windows and Linux ports. each macOS capability reaches the other platforms through a per-feature seam, verified per platform, rather than a lowest-common-denominator abstraction.

  • page to chrome messages. the page scripts are identical on every platform; only the receiving plumbing differs. macOS gives each feature its own WKScriptMessageHandler. Windows has a single WebView2 message pipe, so a document-start shim recreates window.webkit.messageHandlers and one dispatcher (win_dispatch) routes each message to the same per-feature logic. Linux registers native WebKitGTK handlers (gtk_dispatch), no shim needed.
  • a private script world. on macOS and Linux, the channels whose messages make the browser act, and their scripts, run in wis’s own script world, so a page can neither post to them nor reach their globals. WebView2 has no isolated world, so on Windows those scripts post through a private sender carrying a per-tab token, and the dispatcher drops any acting message without it.
  • keyboard shortcuts. native menu accelerators on macOS, where a focused tab is offered every non-reserved shortcut first. on Windows and Linux, native accelerators never fire behind a focused webview, so shortcuts are dispatched in JavaScript: by the chrome and overlays, and by a forwarder injected into each tab.
  • native UX ports. clipboard, file dialogs, downloads, click-to-focus, find, print, and capture each have a per-platform implementation in the same module.
  • the feature-availability toast. a user-invokable feature with no backend on the running platform raises a notice instead of a silent no-op. lib/platformSupport.ts is the single source of truth; wiring a feature up on a platform means deleting its entry there.

wis vendors patched copies of wry, tao, and tauri-runtime-wry under vendor/, applied through [patch.crates-io]. the patches cover what upstream does not yet: compositing positioned child webviews on Linux (a full-window gtk::Fixed overlay plus show and map fixes), key events and page-first menu shortcuts for focused child webviews on macOS, load-failure reporting, download progress and cancel, keeping Tauri’s scripts off remote pages, navigation hooks for clean links and per-site preferences, autoplay policy on Linux, and, on macOS, credential challenges, page dialogs, and the ask before a page with unsaved changes is left. each patch is documented in its WIS-PATCH.md, and feature code never patches them.

the user-facing result is summarized in platform support.

the chrome lives in crates/shell/src, in React and TypeScript. imports always use @/... aliases, never relative paths across modules. code is grouped under features/<feature>/ (vault, tabs, ai, canvas, settings, site, workspaces, extensions, bookmarks, and more); larger features split into components/, hooks/, lib/, and surfaces/. only shared code stays at the top: components/ for the app frame and primitives, hooks/ for browser state, overlays, and tab webviews, lib/ for helpers such as the theme, URLs, toasts, keybindings, and platform support, and bindings/ for the typed IPC wrappers that mirror wis-core. a feature never imports another in a cycle, and lib/ never imports a feature; a test enforces both.

  • app: Rust (toolchain pinned in rust-toolchain.toml) and Tauri 2, with vendored, patched wry, tao, and tauri-runtime-wry.
  • rendering: the system WebView: WKWebView on macOS, WebView2 on Windows, WebKitGTK on Linux.
  • interface: React 18, TypeScript, Vite, and TanStack Query.
  • storage: SQLite via rusqlite.
  • network: a per-container loopback proxy on tokio and hyper, Brave’s adblock engine, DNS over HTTPS via hickory, and Tor via Arti.
  • vault: ChaCha20-Poly1305, with the key held in the macOS Keychain or Windows DPAPI, or on Linux sealed under a vault password (Argon2id).
  • translation: a Swift bridge to Apple’s Translation framework (macOS 26.4 or later).

production-grade or it does not ship. every change is judged on correctness, performance, security, UI/UX, and architecture together, not just “it works”. performance is the product: ask what a change costs in RAM, IPC round-trips, re-renders, and dependencies, and keep unused features at zero cost. a change to a core subsystem (browser state, storage, network) needs a test that locks the invariant, and WIS.md is updated in the same change; it is the source of truth other contributors and agents read first.

before claiming a change done, run:

Terminal window
cd crates/shell
pnpm build # tsc type check, then vite build
pnpm lint # ESLint: React hooks rules and no-console
pnpm test # node:test, with an 80% coverage gate on the plain modules
cd ../..
make lint # clippy with warnings as errors, then ESLint
make test # Rust tests, then the frontend tests
make fmt-check # Rust formatting, which make lint does not check

CI runs on every push and pull request to main and preview, on a matrix of macOS, Windows, and Ubuntu 22.04. each leg builds the frontend, runs ESLint and the frontend tests, then cargo fmt --check, clippy with warnings as errors, and cargo test. it is the only place the Windows (WebView2) and Linux (WebKitGTK) code is fully compiled, since a macOS host cannot cross-compile it.

the macOS leg builds for macOS 14, the oldest version wis supports, then checks that every non-Swift symbol the binary binds strongly is exported by macOS 14.0 (crates/shell/scripts/macos-symbols.mjs, against a list recorded from the macOS 14 SDK). this static check stands in for running on a macOS 14 machine. Rust extern statics always bind strongly, so any API newer than macOS 14 is weak-linked (Swift, frameworks) or looked up at run time with dlsym.

releases build on a v* tag, one platform at a time, and attach everything to one draft release: a universal .dmg for macOS, .msi and NSIS .exe installers for Windows, and .deb, .rpm, and .AppImage packages for Linux.

  • macOS signing. the app is signed with a Developer ID certificate under the hardened runtime, with only the camera and microphone entitlements, and notarized with an App Store Connect API key. a later step notarizes and staples the .dmg as well. the release fails if a signing secret is missing, and the Windows and Linux legs get none of them. Windows and Linux builds are not code-signed, and local builds stay unsigned. the setup is in docs/contributing/macos-signing.md.
  • the Tauri updater. each platform’s build is signed for the updater (the macOS .app.tar.gz, the Windows installers, and the Linux packages), and the legs merge their entries into one latest.json. the Linux leg strips the bundled libwayland libraries from the AppImage (they break EGL on hosts with newer Mesa) and re-signs it, and a final job patches the AppImage’s signature in latest.json.
  • in the app, system/updates.rs checks latest.json shortly after launch and every 6 hours, downloads a newer build into the cache folder, and offers “Restart to update”. restarting installs the cached package, which the updater checks against the release key again first. debug builds never check.

read the contributing guide for branch names, commit style, and the review checklist, and build from source to get a local build running.