feat(site): Live Demo — the real console, mocked, in the browser - #669
Merged
Conversation
Adds a /demo section: the actual cozystack-ui SPA running entirely client-side with MSW-mocked Kubernetes API, so visitors can browse the real marketplace and console without a cluster, signup, or install. Data fixtures are captured from a live cluster (27 catalog apps + demo instances), so it looks real rather than invented. Also adds a Live Demo top-menu entry (weight 15) and a promo block on the home page linking to it. The mock layer lives in cozystack-ui behind VITE_DEMO=1; the built static output is vendored here under static/demo. A follow-up PR should land the demo-mode source in cozystack-ui so CI can reproduce the build. Known limitation: deep links / refresh on /demo/<subpath> fall through to the site 404 on GitHub Pages (SPA served from a subpath). Entering at /demo/ works; a hash-router or SPA-fallback is the follow-up. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: tym83 <6355522@gmail.com>
Timur Tukaev (tym83)
requested review from
Andrei Kvapil (kvaps),
Timofei Larkin (lllamnyp) and
myasnikovdaniil
as code owners
August 30, 2026 06:05
✅ Deploy Preview for cozystack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Mock every k8s route the console actually calls so no sidebar link or form lands on a broken page: namespaced backup resources, tenant modules, cluster tenants and resource quotas, CRD schemas for the backup create/edit forms, and the form option source that drives every dropdown (storage class, image, instance type, backup class). Add fieldSelector filtering so the External IPs page only lists load balancers. Serve the SPA under its base path by setting the router basename from BASE_URL, so deep links and in-app navigation keep the /demo/ prefix instead of escaping to the site root. Replace the captured tenant secrets, node addresses and storage endpoint with demo placeholders. The fixtures were snapshotted from a live cluster and still carried real credentials (S3 keys, a service-account token, a kubeconfig, database passwords) and public node IPs; none of that should ship in a public demo bundle. Signed-off-by: tym83 <6355522@gmail.com>
The Admin capacity screens query the cozystack "info" module (apps.cozystack.io/infos/info); it was unmocked and 404'd. Add a handler serving a captured Info snapshot. Caught by the new demo smoke check. Signed-off-by: tym83 <6355522@gmail.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.
Summary
Adds a Live Demo — the real
cozystack-uiconsole running entirely in the browser, so a visitor can explore the actual marketplace and console without a cluster, signup, or install./demo— the real SPA with a mocked Kubernetes API (MSW). Fixtures are captured from a live cluster: 27 catalog apps (ApplicationDefinition), demo instances, node metrics. It's the actual UI, just with demo data — not screenshots or a scripted tour./demo/.Live Demoentry (weight 15, between GitHub and Community).How the mock works
The mock layer lives in
cozystack-uibehindVITE_DEMO=1: a single MSW router intercepts everyfetchink8s-clientand serves fixtures. No backend, no auth. Built to static and vendored here understatic/demo.Follow-ups (not blocking a look)
cozystack-uiso CI reproduces the build instead of vendoring the artifact./demo/<subpath>falls through to the site 404 on GitHub Pages (SPA from a subpath). Entering at/demo/works; a hash-router or SPA-fallback is the fix.