Engineering notes · Updated

How Ultra Explorer is built

Ultra Explorer is a file manager for more than 40 kinds of storage, reached through rclone. It runs as a desktop app on macOS, Windows and Linux, and as a self-hosted web app on a server or a NAS. This page explains how it is designed: the decisions, the boundaries and the measurements behind them. The source is closed; the engineering doesn't have to be.

  • 230k

    lines of product code, Rust, TypeScript and Svelte

  • 250k

    lines of tests

  • 7,700+

    automated tests

  • 16

    Rust crates in one workspace

  • 12,500

    lines of design documentation

  • 11

    interface languages

01 · The founding decision

One interface, two shells, one core

From the first commit, the app has been one SvelteKit interface, one Rust core, and two thin shells around them. The desktop app reaches the core through Tauri; the server version reaches the same core over HTTP. Features call one client and rarely need to know which shell they run in; when they must, they read its mode.

  • A Tauri 2 window around the system WebView
  • Commands and events over IPC
  • Native dialogs, imports read in place
  • One rclone process per app, supervised
Svelte 5 interfacesame interface codeBackendClientTauriBackendClientTauri IPCcommands · eventsHttpBackendClientHTTP + SSEAxum · session · CSRFAppService · app-coresame corerclone-adapterpersistenceenginesrclone rcd · 40+SQLite · WAL
  • Why a web interface and Tauri 2

    Ultra Explorer had to run as a desktop app and on a server from one codebase. A Rust UI toolkit, native or compiled to WebAssembly, could have covered both targets, but none comes close to what HTML, CSS and the JavaScript ecosystem offer for a polished, accessible interface. Tauri 2 removes the trade-off: the desktop app shows the same web interface in the WebView the system already has (WebKit on macOS and Linux, WebView2 on Windows) instead of shipping a browser, and its backend is the same native Rust core the server runs. The WebView remains the app's largest memory consumer, so the interface gets the strictest budgets.

  • Why Svelte 5

    Svelte compiles each component at build time into direct DOM updates: there is no virtual DOM to diff on every change, and what remains at runtime is small, mostly the signals behind $state and $derived. That fine-grained reactivity suits an interface that keeps transfer progress, selections and virtualized lists of large folders up to date. Large collections, and objects replaced whole, use $state.raw, which skips deep proxies: more than 200 places in the interface. It is also a framework we enjoy working in, which counts on a codebase this size.

  • One BackendClient

    Features call one TypeScript interface. TauriBackendClient maps it to commands and events, HttpBackendClient to authenticated routes and SSE. Transport code lives in one folder: feature code never calls fetch, IPC or rclone.

  • Same rules on both sides

    Both shells call the same AppService methods, so validation, conflict rules and cancellation cannot drift between desktop and web. A new operation goes through every layer: contract, core, both shells, both clients, interface and tests.

02 · Ports and adapters

A Rust core that knows nothing about its transport

Business rules live in app-core: validation, use cases, orchestration, transfer states, concurrency limits. It depends on no web framework, no database driver and no rclone transport. What it needs from the outside world it declares as ports, and adapters implement them.

The workspace drawn the way Space Analysis draws a disk: each crate's area is its lines of Rust, tests included. Point at a crate to see its role and its dependencies.

Core

app-core

Validation, use cases, orchestration, transfer states, path claims and its ports.

lines
110,948 · 46.5 %
Depends on
contracts, entitlements, image-derivatives, licensing, media-metadata
Used by
rclone-adapter, persistence, diagnostics, server, desktop, preview-delivery, license-client, feedback-client
  • Delivery shells

  • Core

  • Pure engines

  • Adapters

  • Platform and services

One source of truth for every message

Requests, responses, events and errors are Rust types in contracts. ts-rs generates their TypeScript twins, about 2,750 lines, and the generated file is never edited by hand: both sides read one definition of every field.

Rustcrates/contracts

#[derive(Serialize, Deserialize, TS)]#[serde(rename_all = "camelCase")]pub struct DirectoryListingWindow {    pub listing_id: String,    /// The view the entries were read in.    pub view: DirectoryListingView,    pub total_count: u32,    pub visible_count: u32,    pub hidden_count: u32,    pub offset: u32,}

TypeScriptapps/ui

// types.generated.tsexport type DirectoryListingWindow = {  listingId: string;  /** The view the entries were read in. */  view: DirectoryListingView;  totalCount: number;  visibleCount: number;  hiddenCount: number;  offset: number;};
  • Thin shells

    Apart from their platform duties (sign-in on the server; tray, updates and windows on the desktop), the Tauri and Axum crates only translate: they parse a request, call the service and map the result. Neither holds a business rule.

  • Pure engines

    Thumbnails and media analysis are pure CPU crates: bytes in, results out, no storage, cache or setting. They are tested without a network or a real storage.

  • Errors that keep their meaning

    The error contract keeps cancelled (the user's intent, never retried), timeout (retryable), invalid_input and internal_error apart. No transport may collapse them into one generic message.

  • Strict by default

    unsafe is forbidden in every crate but one reviewed bridge to macOS notifications. Clippy runs with every default lint denied and the pedantic set enabled.

03 · The engine underneath

rclone, supervised like a database

rclone speaks to dozens of storage services and protocols, and Ultra Explorer offers more than 40 of them. It runs rclone as a managed child process and treats it the way a server treats its database: started, checked, replaced and stopped by its owner, and never exposed.

Step 1/6 The app takes an exclusive lock on its runtime folder and writes a non-secret lease before it starts anything.

  • The typed SDK where it is right

    Calls go through rclone's generated Rust SDK wherever its schema matches what rclone really returns. Where it doesn't (job IDs modelled as floats and sent as 6.0, which rclone refuses; quota fields wrongly required; configuration continuations), a narrow, tested compatibility layer handles those few calls.

  • A small public fork

    Ultra Explorer ships rclone 1.76.0-ultra.1: the official 1.76.0 plus streamed listings (operations/liststream), storage renaming (config/rename), a fix for job outputs and a home command for SFTP and FTP. The fork is public, and every binary is checked against committed SHA-256 sums.

  • Never exposed

    The remote-control listener accepts loopback connections only and requires its per-launch credential. The browser never reaches it, and there is no generic rclone proxy.

rclone v1.76.0-ultra.1 · GitHub

04 · Large folders

A million files in a folder, 30,000 in the interface

A cloud folder can hold hundreds of thousands of entries. Ultra Explorer streams the listing into the Rust backend, keeps it there, and lets the interface read only the pages it shows. Try it below: this list has a million rows, and only a few dozen exist in the page.

Sort

Showing the first 416,665 of 1,000,000 items. Filter or reverse the sort to see the others.

Scroll fast, drag the scrollbar, change the sort.

  • Streamed, then kept

    rclone streams the listing in chunks. Up to 50,000 entries, a folder comes back whole. Past that, entries go to a private spool file and memory keeps a 16-byte location per entry: 16 MB for a million entries.

  • Sorted where the data is

    A new sort or filter is computed in Rust, with the same ICU collation as the interface. The last four orders are cached at 4 bytes per entry, so going back is immediate, and an order nobody waits for any more stops while the listing is read back, checked every 4,096 entries.

  • Three pages around the screen

    The scrollbar spans the folder, up to the browser's height cap, and positions not loaded yet are placeholders. The interface holds one run of at most three 10,000-entry pages around what is visible, reads the next page 500 entries ahead and lets the farthest go.

  • Selections by id

    A selection is a set of ids checked against the current view, so it can span pages the interface no longer holds without loading them back. Select all is the exception: it reads each page once, the one case where the interface's memory grows with the folder.

  • Even the browser's limits

    Engines cap the height of an element: about 17.9 million pixels in Firefox, 33.5 million in Chromium and WebKit. The app measures the real cap with a probe instead of guessing from the browser name. The details table stops there (about 830,000 rows in Chromium and WebKit) and says how to reach the rest; tile views add columns so their last entries stay reachable.

05 · Budgets

Memory first, then speed

A file manager stays open all day. Every structure that grows with the data has a written bound, and when a speed-up costs memory that stays, memory wins.

A few of the bounds

WhatBoundWhere
One entry of a large listing16 bytesRust
A cached sort order4 bytes per entry, last 4 viewsRust
Large listings kept8 listings, 1 GiB of spoolDisk
Rows held for one folder3 pages of 10,000WebView
Rows held for one search5 pages of 10,000WebView
Results of one search1,000,000, spooledDisk
Thumbnail decodes in flight256 MiB, weightedRust
One media analysis128 MiB of sandbox memoryRust
Media analyses kept16 MiBRust
Thumbnail cache1 GB by defaultDisk
Transfer events shown to viewsone update per 100 msWebView

The cache we removed

A cache kept the previous Space Analysis map, drawn and ready, so that going back was instant. Measured on release builds, it left the WebView near 800 MB after use, against 300 to 400 MB without it. It was removed, and a transition now covers the short wait.

250 MB500 MB750 MB1,000 MBA Space Analysis session →≈ 1 GB · peak≈ 800 MB · at rest≈ 800 MB · peak300–400 MB · at rest
With the cache Without it Approximate values the developer measured on release builds; the curves are illustrative.
  • Raw state for big collections

    Listings, results and hierarchies live in $state.raw and are replaced rather than mutated, so Svelte never wraps thousands of rows in proxies.

  • Events coalesced

    The transfer state applies every event at once but lets views read it at most every 100 ms: a selection of thousands of items costs a few renders, not one per item.

  • No giant payloads in the WebView

    A drag of more than 1,000 entries carries no entry list. WebKit's macOS pasteboard decodes custom drag data at every pointer move, and a 300,000-entry payload kept the app's main process busy.

  • Measured, not assumed

    Memory claims are checked on release builds. Debug builds exaggerate backend latency several times and would argue for caches nobody needs.

06 · Freshness

Caches that know when they are wrong

Caches make the interface feel instant, but a stale cache is worse than none. Every cache has a size bound, and every entry either carries a revision or is keyed by the file version it describes, so a result that started before a change can never land after it.

Step 1/5 The left pane opens Photos. Nothing is cached yet, so it waits for one read from the backend, tagged with the storage revision: 7.

  • Single flight

    Equal requests share one provider operation, which stays alive until its last consumer leaves. The same rule makes one thumbnail generation serve every view waiting for it.

  • Bounded and aged

    The Space Analysis results cache holds at most 12 analyses and 100,000 entries, for five minutes. The web folder picker keeps 32 folders for 30 seconds. Resolved thumbnail keys: 4,096, least recently used out first.

  • Keys that cannot go stale

    A thumbnail's key is derived from the storage, the path, the size, the modification time and the pipeline version. A new version of the file gets a new key, so thumbnails are never revalidated, only evicted, least recently used first.

  • Versioned results

    Hashes and media analyses are reused only while the storage reports the same size, exact modification time and object id. Ultra Explorer's own writes forget them at once.

07 · Space Analysis

Tens of thousands of shapes on one canvas

Space Analysis draws a storage as a sunburst, a treemap, a pack or a tree. Tens of thousands of DOM or SVG nodes would choke a WebView, so the map is one canvas with a retained scene. The demo below applies the same ideas in your browser and measures them on your device.

Shapes

One hue per top-level folder, quieter with depth

Point at the map

Shapes
10,000
Layout
0.0 ms
Paint
< 0.1 ms
Hit test
0 shapes checked · 0 without the grid
Fill changes per paint
0
  • A retained scene

    Geometry is computed once per layout and kept as draw commands; a frame replays them. Commands are batched by depth and colour, so a paint changes the fill style a few dozen times, not once per shape.

  • A grid under the pointer

    In the treemap, pack and tree, hit testing goes through a uniform grid of 8 to 64 cells a side, sized from the number of shapes; the sunburst searches sorted angle ranges ring by ring. Either way a pointer move checks a few shapes, not all of them. At deep zoom, shapes outside the view are culled.

  • Sharp, and bounded

    The backing store follows the device pixel ratio, capped at 33.5 million pixels, so a large window on a dense screen cannot allocate without limit. Zooming redraws the vector paths into that same store; it never enlarges it.

  • Motion never delays state

    Navigation, selection and chart state apply synchronously; animation only presents what already happened, and reduced motion is honoured. Frame times are benchmarked in WebKit and Chromium at 125 % and 1,000 % zoom.

08 · Previews and media

Every file is hostile until proven small

Thumbnails and media details read files nobody checked: a 48-megapixel photo, a truncated TIFF, a song with an oversized cover image. Each decode gets a memory estimate before it starts and a budget it cannot exceed.

01

Probe the first 128 KiB

format, dimensions, a plan and its memory estimate

icon.png256 × 256
  1. 02

    Serve the original

    Under 256 KiB and 1 megapixel: nothing decoded, nothing stored.

  2. 03

    Embedded thumbnail

    A JPEG's EXIF thumbnail is enough for 128 px.

  3. 04

    Embedded preview

    A camera RAW: one range read of its JPEG preview.

  4. 05

    Decode at scale

    JPEG at 1/2, 1/4 or 1/8 of its size; other formats under strict limits.

The original bytes, as they are

Peak memory of one thumbnail or preview, measured against its estimate

Measured Estimated before decoding Decode cap, 256 MiB

JPEG 12 MP → 128 px

2.9 / 4 MB

JPEG 48 MP → 512 px

6.7 / 11 MB

JPEG 48 MP → 2560 px

95.4 / 166.5 MB

PNG 12 MP → 512 px

43.8 / 56.1 MB

TIFF 24 MP → 512 px

81.5 / 102.8 MB

HEIC 12 MP → 512 px

59.8 / 85.7 MB

Release build on Apple silicon, worst-case noise images. Tests pin every estimate between 1.25 and 2.6 times its measurement.

MediaInfo in a sandbox

Media details come from MediaInfoLib compiled to WebAssembly and run in the wasmi interpreter: one artefact for every platform, and no unsafe code in the crate. The parser asks for the byte spans it needs; a large file is never downloaded whole.

A 40 GB video on a cloud storage

start index · ≤ 32 MiB

at most 48 MiB read · 0.12 % of the file

bytes, 1 MiB at a time

MediaInfoLib.wasm

wasmi

  • own instance and memory, at most 128 MiB
  • fuel limit
  • 2-minute deadline
  • five analyses at once
text · JSON · XML reports
  • Full size only when needed

    A JPEG is decoded at the IDCT scale that still reaches the target size. At full size a 48 MP photo is 144 MB of pixels; its 512 px thumbnail peaks at 6.7 MB.

  • Weighted admission

    Each decode reserves its estimate in a 256 MiB semaphore before reading the file, four jobs at most, and a very large job runs alone. One generation per thumbnail serves every view waiting for it.

  • The web engine does the rest

    Previews reach the interface as plain URLs that support range requests, so the engine itself lazy-loads, decodes and caches what is on screen. Nothing is base64-encoded through IPC.

  • Measured before refused

    JPEG XL is not supported: the permissive pure-Rust decoder we measured peaked at 325 MiB for a lossy 12 MP image, over the budget before any margin.

  • Spans, not files

    An analysis reads at most 24 MiB in 16 jumps (48 MiB for an MP4 or QuickTime file, whose index alone may take 32 MiB), then stops with a result marked partial rather than guessing durations from what it read.

09 · Operations

Transfers that never overwrite in silence

Copies, moves, imports, renames and deletions run through one durable engine, and streamed uploads share its records, path reservations and conflict checks. Work is checked, reserved and written to SQLite before the app says it is queued, and a conflict is never settled in silence: a copy, a move or an upload asks, a rename to a name already taken is refused.

Parallel operations 4

Admission

  1. inspect
  2. reserve
  3. recheck
  4. write

SQLite · WAL

FIFO queue 0

Running 0/4

  • —
  • —
  • —
  • —

Done 0

Every row is committed to SQLite before it is acknowledged.

  • Atomic admission

    A batch is inspected, every final path is reserved at once, the destination is checked again and the batch is written durably. Only then is the work acknowledged.

  • Selections of any size

    Path claims are indexed by storage and case-folded path (the path, the folders above it and, for a folder, everything inside) instead of comparing every pair.

  • One job per item

    Each copy or move is its own rclone job, so cancelling one never stops another. File deletions of one request on one storage run together, in batch jobs of up to 100, each member keeping its own record.

  • A crash is not a success

    A transfer is written as queued before rclone starts. Work still queued or running when the app stopped is marked interrupted at the next start, never completed.

  • Explicit conflicts

    Overwrite, skip, keep both (for a folder) or cancel the whole batch: the choice is typed, and the backend checks the destination again at launch.

10 · Platforms and security

Desktop and server, one set of rules

The two shells differ in what their platform offers, not in what the app allows. In both, the backend is the security boundary.

Desktop · macOS, Windows, Linux

  • Tauri 2 around the system WebView
  • Native imports read in place by rclone, without a copy
  • Keeps working in the background, with a tray icon
  • Signed updates
  • A single instance, one supervised rclone process

Server · Docker, NAS

  • Axum, HTTP and Server-Sent Events
  • Session cookies, CSRF tokens and sign-in throttling
  • A Content Security Policy and security headers
  • An unprivileged container; the supplied Compose file adds a read-only root filesystem and drops every Linux capability
  • Uploads streamed to the storage without touching the server's disk
  • Installable as an app on a phone, over HTTPS

Security principles

  1. 01

    The backend decides

    Names and paths are normalised and validated in Rust even when the interface already checked them. Traversal, destructive root operations and local paths outside the allowed folders are refused.

  2. 02

    Secrets stay put

    Storage credentials and tokens stay in rclone's configuration file. Apart from the password-encrypted export you ask for, they never appear in events, logs, responses or browser storage.

  3. 03

    rclone stays private

    Loopback only, a credential per launch, and no route to it from the browser.

  4. 04

    Untrusted bytes are bounded

    Decoders run under memory estimates and caps; MediaInfo runs in a WebAssembly sandbox.

  5. 05

    No overwrite by surprise

    Conflicts are explicit, destructive actions are confirmed by default, and the backend enforces the same rules as the interface.

  6. 06

    A minimal surface

    Tauri permissions and CSP allowlists hold only what a feature needs; unsafe Rust is forbidden outside one reviewed module.

This page describes principles, not mechanisms an attacker could use. To report a security issue: support@ultra-explorer.app.

11 · How it is checked

Tested like infrastructure

There are about as many lines of tests as lines of product code. Tests run against real SQLite, a real browser and, when asked, a real rclone in throwaway folders: never against someone's data or a developer's own configuration.

  1. 3,450

    Rust tests

    Unit and integration tests of the core, the adapters and both shells, with real SQLite.

  2. 4,250

    Interface tests

    Unit and component tests; components render in a real Chromium, and in WebKit on demand.

  3. 9

    End-to-end suites

    The real Rust server, rclone and a browser, driven by Playwright.

  4. +

    Opt-in suites

    Real rclone in temporary folders, canvas frame times, provider request counts.

Gates every change passes

  • ✓ rustfmt
  • ✓ clippy -D warnings
  • ✓ clippy::pedantic
  • ✓ unsafe_code = forbid
  • ✓ ESLint
  • ✓ svelte-check
  • ✓ Prettier
  • ✓ i18n audit · 11
  • ✓ cargo test
  • ✓ Vitest

22 releases since 1.0

1.0.0 · Sep 22

First public release

1.1.0 · Oct 12

Five folder views, Space Analysis for millions of files

1.2.0 · Oct 17

Clean up straight from the Space Analysis map

1.3.0 · Oct 29

MediaInfo, storage history and forecasts

1.4.0 · Nov 8

Batch rename, up to 10,000 items

1.5.0 · Nov 18

Image previews and thumbnails

The rule is that a change of behaviour updates the design documents in the same change: 12,500 lines on architecture, security, rclone integration, testing, distribution and releases.

Built with

Interface
Svelte 5SvelteKitTypeScriptTailwind CSS 4bits-ui · shadcn-svelteTanStack VirtualParaglide JS
Core
Rust 2024TokioAxumSQLx · SQLite WALts-rswasmi
Platform
Tauri 2rclone 1.76Docker
Images and media
jpeg-decoderimagetifffast_image_resizelibwebpMediaInfoLib → WASM
Tests
VitestPlaywrightChromium · WebKit

Closed source. Open about how it is made.

If a question here needs an answer before you or your team adopt Ultra Explorer, write to us.