The web UI served by weaver serve. It's a React +
TypeScript single-page app built with
Vite, routed by
TanStack Router, and styled with
Tailwind CSS + daisyUI.
At release time the production build (ui/dist) is embedded directly into the
weaver binary (see src/serve/ui.rs), so the running server serves the UI and
its /api/v1/* endpoints from the same origin.
- Node.js — version pinned in
.nvmrc(usenvm usefrom this directory). - pnpm — version pinned via the
packageManagerfield inpackage.json(enable withcorepack enable). - Rust toolchain — only needed to run the backend (
weaver serve).
pnpm installRun the backend and the Vite dev server side by side. The dev server proxies
/api to http://localhost:8080 (see vite.config.ts), so the backend must be
running:
# Terminal 1 — backend API (any registry; the bundled live_check model is handy)
cargo run -- serve -r crates/weaver_live_check/model
# Terminal 2 — hot-reloading UI dev server (prints its local URL, e.g. :5173)
pnpm devpnpm build # outputs to ui/dist, which is embedded into the weaver binary
pnpm preview # serve the built assets locally to sanity-checkcargo run -- serve also rebuilds-check the UI via build.rs and warns if
ui/dist is stale.
pnpm lintPlaywright tests in e2e/ load the UI and
exercise a few core flows (search renders, click into a detail page, stats page
counts and links). They're intentionally minimal — a foundational signal that
the UI is built and interactive.
pnpm install
pnpm exec playwright install chromium # browser only
# or: pnpm test:e2e:install # browser + OS dependencies (CI)pnpm test:e2eHow the server is provided depends on what's already running:
- Nothing on
:8080— Playwright'swebServer(inplaywright.config.ts) bootscargo run -- serve -r crates/weaver_live_check/modeland waits for/health. The first run may compile, so allow some time. - A server is already on
:8080— it's detected and reused (locally only), which makes the suite run in ~1s.
Target an externally managed server (e.g. a Docker container) and skip the auto-start:
WEAVER_EXTERNAL_SERVER=1 WEAVER_BASE_URL=http://127.0.0.1:8080 pnpm test:e2e| Env var | Default | Purpose |
|---|---|---|
WEAVER_BASE_URL |
http://127.0.0.1:8080 |
URL of the UI under test. |
WEAVER_EXTERNAL_SERVER |
(unset) | When set, don't auto-start a server. |
The suite finishes in about a second, so --headed just flashes by. To actually
watch it:
pnpm exec playwright test --ui # UI mode: step through, time-travel, replay
pnpm exec playwright test --debug # Playwright Inspector: pause on each action
pnpm exec playwright show-report # open the HTML report from the last runTo slow a headed run down, add launchOptions: { slowMo: 1000 } under use in
playwright.config.ts (don't commit it — it would slow CI).
ci.yml(ui-testjob) builds the UI and binary, then runs the suite againstcargo run -- serve.publish-docker.ymlstarts the freshly builtotel/weavercontainer with the live_check model mounted and runs the same suite withWEAVER_EXTERNAL_SERVER=1.