Skip to content

web(shell): embedded SvelteKit interface for setup, sign-in, recovery, and status - #7

Merged
TusanHomichi merged 1 commit into
mainfrom
claude/repo-setup-complete-y2qmmk
Aug 28, 2026
Merged

web(shell): embedded SvelteKit interface for setup, sign-in, recovery, and status#7
TusanHomichi merged 1 commit into
mainfrom
claude/repo-setup-complete-y2qmmk

Conversation

@TusanHomichi

@TusanHomichiTusanHomichi commented Aug 28, 2026

Copy link
Copy Markdown
Member

Primary Issue

Closes#6

Problem And Outcome

Authentication was API-only; initializing an installation took curl. After merge, a browser pointed at a fresh installation completes the whole Milestone 1 shell — setup, sign-in, status, reset-code issuance, password reset, sign-out — served from the single executable with no Node.js at runtime.

Changes

  • web/: SvelteKit 2 + Svelte 5 TypeScript SPA (adapter-static, SSR off): first-run setup wizard, sign-in, password reset, and a status view (agency, user, capabilities, session expiry, database health, version) with manage_users-gated reset-code issuance and sign-out; accessible baseline (labels, alerts, focus styles, light/dark)
  • New unauthenticated GET /api/instance ({initialized, version, agency}) drives the client routing guard; authorization stays entirely server-side
  • rust-embed embeds web/build (release) or reads it from disk (debug); the router fallback serves assets, hands unknown non-API paths the SPA entry, keeps unknown /api/* as JSON 404s, and sets immutable cache headers for content-hashed files
  • A cargo-only build still compiles (build-script placeholder folder) and serves an honest 503 notice + startup warning instead of an interface
  • pr-gate now runs npm ci / npm run check / npm run build before the Rust gates, with an npm cache
  • ADR 0005: toolchain, embedding, build order, and verification decisions

Scope

Verification

  • Listed the exact verification commands run below
  • Added or updated tests when behavior changed — 3 new Rust integration tests (asset/fallback/API-404 semantics, instance state) plus a Playwright E2E spec
  • Added or updated an ADR when a durable decision changed — ADR 0005
  • All fixtures and examples are invented; no real agency data
- (web) npm ci && npm run check (0 errors, 0 warnings)
- (web) npm run build
- cargo fmt --check
- cargo clippy --workspace --all-targets -- -D warnings
- cargo test --workspace (28 passed across 6 targets)
- (web) npx playwright test — full browser lifecycle against the compiled
binary: setup → failed login → sign-in → status → issue reset code →
sign out → reset password → old password refused → new password in →
/setup permanently bounces home (1 passed)

Review And Merge Notes

  • Review focus: ADR 0005's build-order/honesty decision (cargo-only builds serve a 503 notice rather than failing to compile), and the fallback handler's API/SPA split in web_assets.rs
  • User or operator impact: operators get a real interface; contributors touching web/ need Node.js at build time only

…, and status
Implement the Milestone 1 web shell (docs/architecture.md User
interface):
- web/: SvelteKit 2 + Svelte 5 single-page app (adapter-static, SSR
off) with pages for first-run setup, sign-in, password reset, and a
signed-in status view showing agency, user, capabilities, session
expiry, health, and version, plus manage_users-gated reset-code
issuance and sign-out
- client routing guard driven by new unauthenticated GET /api/instance
({initialized, version, agency}); authorization stays server-side
- rust-embed serves the built assets from the executable (disk-backed
in debug builds); unknown non-API paths fall back to the SPA entry,
unknown /api/* paths stay JSON 404s; immutable cache headers for
content-hashed assets
- a cargo-only build still compiles via a build-script placeholder and
serves an honest 503 notice plus a startup warning instead of an
interface
- pr-gate builds and checks web/ before the Rust gates so CI proves the
embedded interface
- Rust integration tests for asset serving, SPA fallback, and instance
state; Playwright E2E (web/e2e) drives the compiled binary through
setup, sign-in, failed-login, reset-code issuance, password reset,
and sign-out in a real browser
- ADR 0005 records the toolchain and embedding decisions
Closes#6
@TusanHomichi
TusanHomichi merged commit 401e4cc into mainAug 28, 2026
1 check passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Milestone 1: embedded SvelteKit shell for setup, sign-in, recovery, and status

2 participants

@TusanHomichi@claude