Skip to content

feat(web): add web:remote for hot-reload UI against a remote backend#108

Merged
cevian merged 1 commit into
mainfrom
feat/web-remote-dev
Jun 26, 2026
Merged

feat(web): add web:remote for hot-reload UI against a remote backend#108
cevian merged 1 commit into
mainfrom
feat/web-remote-dev

Conversation

@cevian

@cevian cevian commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What

Adds a one-command dev loop for the web UI (packages/web) running with hot reload against a remote backend (production by default):

./bun run web:remote                        # vs. https://api.memory.build
ME_SERVER=https://… ./bun run web:remote    # any other backend

Open http://localhost:5173 — UI edits hot-reload, data is live.

Why

me serve and 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 + /healthz to a backend and injects no credentials. Previously, pointing it at prod meant a hand-rolled two-terminal setup (me serve on a free port + ME_DEV_RPC_TARGET=… ./bun run web).

Changes

  • packages/web/vite.config.ts — proxy target now reads ME_DEV_RPC_TARGET (default http://localhost:3000), so the dev server can point at a non-3000 backend.
  • scripts/web-remote.ts + web:remote npm script — spawns me serve (the credentialed /rpc proxy that injects your OAuth token + active space) on an auto-picked free port, wires Vite to it via ME_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 ✅ and biome check
  • Smoke test: ./bun run web:remote brought up me serve against https://api.memory.build on an auto-picked port (3100) and Vite on 5173; the proxy chain works end-to-end (GET /healthz through Vite → me serve → prod returned {"ok":true}). Ctrl+C tore both down.

⚠️ web:remote against prod is live production data — writes/deletes from the dev UI are real.

🤖 Generated with Claude Code

`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>
@cevian cevian requested a review from jgpruitt as a code owner June 26, 2026 14:08
@cevian cevian merged commit 4a7fc70 into main Jun 26, 2026
5 checks passed
@cevian cevian deleted the feat/web-remote-dev branch June 26, 2026 14:10
Sign up for free to 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.

1 participant