feat(web): add web:remote for hot-reload UI against a remote backend#108
Merged
Conversation
`me serve` and the hosted server both serve the built UI, so neither shows in-progress source edits. The Vite dev server gives hot reload but is only a frontend — it proxies `/rpc` + `/healthz` to a backend and injects no creds. - `packages/web/vite.config.ts`: read the proxy target from `ME_DEV_RPC_TARGET` (default `http://localhost:3000`) so it can point at a non-3000 backend. - `scripts/web-remote.ts` + `web:remote` script: one command that spawns `me serve` (the credentialed proxy to a remote server, default prod) on an auto-picked free port, wires Vite to it via `ME_DEV_RPC_TARGET`, and tears both down together on Ctrl+C or if either exits. - DEVELOPMENT.md: document the hot-reload dev loop under "Hosted web UI". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a one-command dev loop for the web UI (
packages/web) running with hot reload against a remote backend (production by default):Open http://localhost:5173 — UI edits hot-reload, data is live.
Why
me serveand the hosted server both serve the built UI, so neither reflects in-progress source edits. The Vite dev server gives hot reload but is only a frontend — it proxies/rpc+/healthzto a backend and injects no credentials. Previously, pointing it at prod meant a hand-rolled two-terminal setup (me serveon a free port +ME_DEV_RPC_TARGET=… ./bun run web).Changes
packages/web/vite.config.ts— proxy target now readsME_DEV_RPC_TARGET(defaulthttp://localhost:3000), so the dev server can point at a non-3000 backend.scripts/web-remote.ts+web:remotenpm script — spawnsme serve(the credentialed/rpcproxy that injects your OAuth token + active space) on an auto-picked free port, wires Vite to it viaME_DEV_RPC_TARGET, and tears both processes down together on Ctrl+C or if either exits.DEVELOPMENT.md— documents the hot-reload dev loop under "Hosted web UI".No shipped/runtime code changes — only dev tooling, the dev-only Vite config, and docs.
Testing
./bun run typecheck✅ andbiome check✅./bun run web:remotebrought upme serveagainsthttps://api.memory.buildon an auto-picked port (3100) and Vite on 5173; the proxy chain works end-to-end (GET /healthzthrough Vite →me serve→ prod returned{"ok":true}). Ctrl+C tore both down.🤖 Generated with Claude Code