The Velrix client: the web console and the native desktop app for a Velrix realm. Open source, MIT.
  • TypeScript 35.4%
  • Vue 32.7%
  • JavaScript 30.9%
  • CSS 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Emilio 20215ea06f
Some checks failed
ci / image (push) Successful in 28s
ci / desktop (push) Failing after 22s
ci / check (push) Failing after 30s
ci / e2e (push) Failing after 32s
spec: announce views 7.6 and host 6.1, the versions the platform now keeps
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-12-05 07:52:22 +01:00
.forgejo/workflows fix: DP2 r5 drift CI, shipped pin contract and schema defaults 2026-11-28 16:18:10 +01:00
.zed docs: client hazard audit, and Zed project settings for the Vue language server 2026-11-22 20:54:31 +01:00
brand/default CL1: brand build config, inline splash, desktop splash window, About with Powered by Velrix 2026-11-20 00:26:52 +01:00
ci fix: refuse a test run at preload unless it is bun run test 2026-11-30 22:25:14 +01:00
docs test(desk-context): prove the desk label and the current-card switch 2026-12-05 02:16:12 +01:00
e2e feat: replace installer pairing flow with generic device connection 2026-11-28 16:18:10 +01:00
electron fix: keep extension asks, slot actions and update IPC inside their realm 2026-12-01 18:36:26 +01:00
proof IX3 client: adapted to the merged setup contract (starting {waiting, since} with own backoff, field traits read from the server, tz/lang sent when well formed, server-rendered refusal texts, views 7.4) 2026-11-20 17:04:35 +01:00
public fonts: ship Inter's weight-only files so the fallback matches headings too 2026-11-23 18:56:00 +01:00
scripts fix: close DP2 r3 client drift, fingerprint widths and RC-44 guard 2026-11-28 16:18:10 +01:00
spec spec: announce views 7.6 and host 6.1, the versions the platform now keeps 2026-12-05 07:52:22 +01:00
src test(desk-context): prove the desk label and the current-card switch 2026-12-05 02:16:12 +01:00
.gitignore The Velrix client: the console, on its own 2026-11-05 01:32:45 +01:00
.prettierignore fix: DP2 r5 drift CI, shipped pin contract and schema defaults 2026-11-28 16:18:10 +01:00
.prettierrc The Velrix client: the console, on its own 2026-11-05 01:32:45 +01:00
bun.lock types: add @types/bun so editors resolve Bun globals in the client 2026-11-22 20:46:15 +01:00
bunfig.toml test: refuse non-isolated test runs instead of statically proving mock restores 2026-11-30 19:35:24 +01:00
index.html fonts: ship Inter's weight-only files so the fallback matches headings too 2026-11-23 18:56:00 +01:00
LICENSE The Velrix client: the console, on its own 2026-11-05 01:32:45 +01:00
package.json fix: make the mock-restore guard parse every file bun runs; fail the drift test loudly 2026-11-30 19:24:09 +01:00
README.md fix: refuse late --no-isolate, --config and bunfig rerunEach in the isolated preload 2026-11-30 22:58:27 +01:00
tsconfig.json Move SFC type exports into sibling modules 2026-11-22 20:53:15 +01:00
tsconfig.vize.json Move SFC type exports into sibling modules 2026-11-22 20:53:15 +01:00
vite.config.ts fix: DP2 r5 drift CI, shipped pin contract and schema defaults 2026-11-28 16:18:10 +01:00

Velrix client

The console for a Velrix realm: one codebase, two artifacts.

  • The web client is a static bundle. Serve it from any web server, or download a release and point it at your realm.
  • The desktop app is the same bundle in Electron: a native window, its own icon, and no browser in the way.

It is not part of the Velrix platform. A realm serves the API; this client is what you point at one.

A machine being installed with Velrix OS is installed from here too: Install a machine on the sign-in screen takes the address and the certificate pin its console shows, connects over WebTransport with that pin (serverCertificateHashes), and draws the installer's own windows. A browser without WebTransport is told to use the desktop app, which checks the pin itself and may then fall back to WebSocket; a browser never connects unpinned.

The console's QR is a link: …/#install=<address>&pin=<pin>&code=<code>. The page reads the fragment and removes it from the address bar and the history at once (also when the link is opened as a hash-only change in a tab that is already loaded), then asks "Connect to <address>?" with the address and the first groups of the pin, to be compared with the server screen; nothing is sent, and the phone's own sign-in is kept, until Connect. The browser still keeps the original address: performance.getEntriesByType('navigation')[0].name holds the code and the pin until the page is reloaded. That is acceptable because the code is single-use and short-lived (the server screen replaces it after use, after a few wrong tries and on a timer), and the pin is no secret (the console shows it too); only the code is, and only for its short life.

Pointing it at a realm

The client asks the realm it is served from first. When it is not served by one — a bundle on your own web server, or the desktop app — it asks you:

  • type the realm's address (https://velrix.example.com) into the field, or
  • open the client with ?realm=https://velrix.example.com in the address, or
  • start the desktop app with --realm=https://velrix.example.com.

The realm you choose is remembered in that browser (or that desktop app). The client reads the realm's address, its certificate hash and its brand from the realm's own /api/connect, so no address is written into the bundle and one bundle serves every realm.

Self-hosting the web client

bun install
bun run build:standalone

dist/standalone/ is the whole client: static files, relative paths, no server-side anything. Serve it as you would any other static site:

python3 -m http.server --directory dist/standalone 8080

Then open http://localhost:8080 and point it at your realm.

A bundle served by a realm works the same way: the client finds the realm at its own address and connects without being told anything.

The desktop app

bun run build:desktop

The brand (name, mark, colours, splash, attribution) is build configuration: see docs/desktop.md.

That builds the renderer, the Electron main process and the packages (dist/desktop/): an AppImage and a .deb on Linux, a .dmg on macOS, an NSIS installer on Windows. The app id is com.velrix.client.

To run it from the source tree:

bun run build:desktop
./dist/desktop/linux-unpacked/velrix --realm=https://velrix.example.com

Development

bun install
bun run dev        # the console on 127.0.0.1:5180
bun run check      # types and formatting
bun run test       # unit tests, each file in its own process
bun run a11y       # the accessibility pass over the running console

Run the unit tests with bun run test. Module mocks outlive their file, so src/testing/isolated.ts reads bun's real flags from /proc/self/cmdline and refuses, before any test file loads, a run without --isolate, with --no-isolate, --rerun-each, -c/--config, BUN_OPTIONS or a rerunEach in bunfig.toml, or on a system without /proc (only Linux runs the tests). Bun reads bunfig.toml only from the directory it runs in, so bun test started from another directory, or with -c/--config naming another config file, loads no preload at all: no refusal, no isolation, and mocks can leak between files. This is a bun limitation, accepted on 2026-11-30; revisit it if bun adds a project-wide config lookup.

e2e/ holds the browser tests. They drive a real realm, so they need one to point at.

The spec file

spec/field-defaults.json holds the realm's form field defaults and page size, copied from the platform's schema so the client can be built without it. The platform's CI compares the copy with the original and fails when they drift.

spec/specs.json holds the view contract and the spec versions the client calls by name. The hello announces them with the client's own block (id, kind, version, the node kinds it draws, its features; docs/client-contract.md in the platform), and the platform's CI checks them the same way. The block and the page origin are advisory: the realm counts and renders by them, but never grants anything because of them.

The download action and receive run only after a person's own click and save under a cleaned file name; they are left unconfirmed on purpose.

The version in package.json is the client's release (2026.11.29), sent in every hello and compared as dotted numbers by the realm's client.min-version policy: bump it with every release.

Licence

MIT. See LICENSE.