Zweistein Admin Local Runtime Slice
Date: 2026-05-05
Objective
Make the imported legacy zweistein/admin frontend reproducible locally and prove that it can reach the local Zweistein server through the Vite proxy.
This is a frontend runtime proof, not a full authenticated product flow.
What Was Added
configs/local/zweistein-admin.env.exampleLocal-only Vite values for the admin base path, feature flags, and mkcert behavior.scripts/zweistein-admin-local.mjsSmall helper for install, Dockerfile-near build, strict legacy typecheck, local dev, and health checks.package.jsonscripts:zweistein-admin:installzweistein-admin:buildzweistein-admin:typecheckzweistein-admin:devzweistein-admin:health
legacy-src/zweistein/admin/vite.config.tsLocal dev now only enablesvite-plugin-mkcertwhenVITE_ENABLE_MKCERT=true.
The helper prefers Homebrew node@20 when available, because the legacy Dockerfile uses Node 20.
Local Commands
Start the local Zweistein server first:
npm run zweistein-server:start
Install admin dependencies:
npm run zweistein-admin:install
Build the admin app with the same practical build path used by the legacy Dockerfile:
npm run zweistein-admin:build
Start the admin dev server:
npm run zweistein-admin:dev
In another terminal, check the admin HTML route:
npm run zweistein-admin:health
Expected result:
Zweistein admin dev server responded on http://127.0.0.1:5176/ai/
Check the Vite proxy to the local backend:
curl -fsS http://127.0.0.1:5176/ai/api/authz/config
Expected current response uses local placeholders:
{
"auth0_domain": "local.invalid",
"auth0_clientId": "local-client",
"auth0_audience": "local-audience",
"featureFlags": {}
}
Verification Evidence
npm run zweistein-admin:installcompleted with Yarn 1.22.22 and warnings only.npm run zweistein-admin:buildpassed through the Vite build path.npm run zweistein-admin:devlaunched the app onhttp://127.0.0.1:5176/ai/.npm run zweistein-admin:healthreturned HTTP 200 for the admin HTML route.curl -fsS http://127.0.0.1:5176/ai/api/authz/configreturned the backend Auth0 placeholder config through the Vite proxy.
Important Findings
The legacy package has two different build meanings:
npm run zweistein-admin:buildin this rebuild project runs the Dockerfile-nearvite buildpath and passes.npm run zweistein-admin:typecheckruns the package's stricttsc -b && vite buildpath and currently fails on legacy TypeScript debt.
The strict typecheck failure is not caused by the local wrapper. It reflects existing code health issues in the imported snapshot, including:
- a non-exported
StripeProviderimport inRootProviders.tsx; - many unused imports and variables reported by TypeScript;
- missing
@types/file-saver; - missing or mismatched
ModelTokenDetailsenum values; - missing
plans/interfaces/QuotaDefinition; - type mismatches in chat, agentic apps, plans, and controls code.
This means the frontend can be locally served and bundled, but the codebase is not yet clean enough for strict TypeScript-gated CI.
Why mkcert Was Disabled By Default
vite-plugin-mkcert tried to install a local trusted certificate during dev startup. On this machine that requires an interactive sudo password prompt, which is not suitable for the local rebuild helper.
The new local default is:
VITE_ENABLE_MKCERT=false
For a developer who wants local HTTPS and can approve the certificate prompt manually, it can be enabled with:
VITE_ENABLE_MKCERT=true
Not Yet Done
- Auth0 login was not exercised with real tenant credentials.
- Authenticated admin pages were not walked in the browser.
- Stripe, LLM, storage, document, and workflow flows were not tested from the admin UI.
- Strict TypeScript cleanup is still outstanding.
- The admin app is not containerized in the new project yet.
- The admin app is not wired to the future Hetzner public domain yet.