- TypeScript 35.4%
- Vue 32.7%
- JavaScript 30.9%
- CSS 0.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| .zed | ||
| brand/default | ||
| ci | ||
| docs | ||
| e2e | ||
| electron | ||
| proof | ||
| public | ||
| scripts | ||
| spec | ||
| src | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc | ||
| bun.lock | ||
| bunfig.toml | ||
| index.html | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsconfig.vize.json | ||
| vite.config.ts | ||
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.comin 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.