feat(deploy): single-origin path-based deployment + project site #34
Reference in New Issue
Block a user
Delete Branch "feature/deploy-single-origin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
Serve the whole stack behind one host (path-based) instead of the two-host
www/apisplit, so the built artifact is domain-agnostic — the same bundle runs under any domain with no rebuild./→ project site (new VitePress)/game/→ game UI (SvelteKit, base/game)/api/*,/healthz→ gateway public REST (galaxy-api:8080)/rpc/*→ gateway Connect/gRPC-web (galaxy-api:9090,/rpcstripped by the edge Caddy)The UI talks to the gateway same-origin via relative URLs (origin resolved at runtime), so CORS is disabled (empty allow-list) and one host needs one cert. The auth model has no cookies/CSRF, so subdomain isolation would buy nothing.
Highlights
galaxy.gateway.v1.EdgeGateway→edge.v1.Gateway(public path/rpc/edge.v1.Gateway/<Method>); Go + TS regenerated./game/via envBASE_PATH(empty by default so dev/CI stay at root); manifest, service-worker scope, WASM loader, and all navigation made base-aware via awithBasehelper.site/, VitePress): i18n en/ru with the built-in switcher, LaTeX math, a minimal monospace theme; built + served at/.dev-deploy,prod-build, newsite-build) build and seed the site; probes hit/,/game/,/healthz.FUNCTIONAL/FUNCTIONAL_rureviewed (no user-visible-URL change needed).Tests (feature push — all green)
go-unit✓ ·ui-test✓ (Vitest 761/761, Playwright 224 passed + 3 flaky/passed, PWA 3/3) ·site-build✓.buf generateclean, gatewaygo build/vet/test,BASE_PATH=/gameUI build (assets/game-prefixed),vitepress build,caddy validate.integrationruns on this PR (covers the proto rename end-to-end throughtestenv/connect_client.go).🤖 Generated with Claude Code
- The app root ("/", i.e. /game/) rendered a dev "workspace skeleton" stub, and the layout guard only redirected anonymous users off it, so an authenticated visitor stayed on the stub. Redirect "/" to /lobby (authenticated) and /login (anonymous), and replace the stub with a minimal loading placeholder. Drop the obsolete landing-stub unit test (root redirect is covered by the auth-flow e2e). - Ship a tombstone /service-worker.js on the project site so any old root-scoped PWA worker (from when the game lived at the origin root) unregisters itself instead of serving a stale cached page at the site origin. The game now registers its worker only under /game/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>