Skip to content

Add /demo: live demos of every product on sample data - #27

Merged
levrow merged 1 commit into
mainfrom
feat/live-demos
Nov 17, 2026
Merged

levrow merged 1 commit into
mainfrom
feat/live-demos

Conversation

@levrow

@levrow levrow commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Overview

Scope public/demo/<slug>/ (24 demo builds, about 113 MB), /demo gallery in 3 languages, header/footer/product-page links, deploy/Caddyfile, site checks, privacy notice
Deploy Normal Actions deploy on merge; the Caddyfile change ships with the release (receive.sh validates and reloads it)
Source PRs demo builds come from the merged demo PRs in each product repo (teletwin-web #57 is still open)

What changes

  • Gallery /demo/, /uz/demo/, /ru/demo/: 24 demos in 4 groups plus xnosir.io as a live site. Each card: cover, tagline in the page language, sign-in if any, Open demo / Source (public repos only) / Product page.
  • Navigation: "Demos" in the header from 1400px (it is also in the Products menu, the mobile menu and the footer); "Live demo" buttons on 15 product pages.
  • Caddy: routes inside /demo/<slug>/ without a file extension fall back to that demo's index.html; a separate CSP for /demo/<slug>/ only; X-Robots-Tag: noindex; hashed demo chunks immutable, routes/html/service workers no-cache. The gallery and the rest of the site keep the current strict CSP (the deploy smoke test still checks connect-src 'self'; on /).
  • Checks: check-site / check-links / check-art skip demo internals (the token / private-key / WM_FORBIDDEN scan still runs on them); Pagefind ignores them; Lighthouse CI also audits /demo/.
  • Privacy: new "Product demos" section (Google Fonts and map tiles inside demos, demo storage and service workers), summary and lede updated.

Verification (local, Caddy 2.11.9 with this Caddyfile + edge X-Frame-Options: DENY)

  • npm run build: check-site ok (256 pages, 1297 demo files secret-scanned), check-links ok, check-art ok, Pagefind 252 pages (no demo pages).
  • Headless Chromium on all 24 demos: every one renders, no CSP violations, no failed requests; MSW service workers register under their own scope (attendo, fam, primus-library); map tiles load (masjid-map, uz-open-data).
  • Crawl of up to 15 in-demo routes per demo: 0 issues, except teletwin-web: upstream Telegram Web A logs undefined and tries t.me/_websync_ (blocked by the demo CSP on purpose).
  • Lighthouse /demo/: performance 0.93, accessibility 1, best practices 1, SEO 1. No horizontal overflow at 390px.

Notes

  • Base-path patches in the copied output: oilaviy hero imagesrcset entry, teletwin favicon link.
  • Header in Russian at 1100-1399px already overlaps "Obyazatelstva" with "Studiya" on main; not changed here.

- public/demo/<slug>/: static demo builds of 24 products (dtwinuz and
  wonmortech repos), each served under its own base path, plus WebP
  covers in public/demo/_covers/.
- /demo, /uz/demo, /ru/demo gallery (src/components/demos/DemosPage.astro,
  data in src/data/demos.ts): cover, tagline per language, demo sign-in,
  Open demo / Source (public repos only) / Product page. xnosir.io is
  listed as a live site.
- "Demos" in the header (from 1400px; also in the Products menu, the
  mobile menu and the footer) and "Live demo" buttons on product pages.
- deploy/Caddyfile: SPA fallback for /demo/<slug>/ routes without a file
  extension, a separate CSP only for /demo/<slug>/ (inline boot scripts,
  wasm, blob workers, MSW service workers, Google Fonts, OpenFreeMap and
  OpenStreetMap tiles, Telegram WebApp SDK, frame-ancestors 'self'),
  X-Robots-Tag noindex, immutable cache for hashed demo chunks and
  no-cache for routes, html and service workers. The rest of the site
  keeps its strict CSP.
- check-site/check-links/check-art skip demo internals (secret scan still
  runs on them); Pagefind ignores them (no data-pagefind-body);
  Lighthouse CI also audits /demo/.
- Privacy notice: new "Product demos" section and the one exception
  noted in the summary and page lede.
- Patched in the copied output (base path only): oilaviy hero srcset
  entry without /demo/oilaviy/, teletwin admin and PWA pages without a
  favicon link (browser fell back to /favicon.ico).

Signed-off-by: xnosir <283333996+xnosir@users.noreply.github.com>
@levrow
levrow requested a review from a team as a code owner November 17, 2026 06:09

@xnosir xnosir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked locally: build and checks pass, all 24 demos render under the demo CSP.

Comment thread public/demo/design-system/app.js Resolved
Comment thread public/demo/design-system/app.js Resolved
Comment thread public/demo/design-system/app.js Resolved
Comment thread public/demo/design-system/app.js Resolved
Comment thread public/demo/design-system/app.js Resolved
Comment thread public/demo/halvet/app.en.js Resolved
Comment thread public/demo/halvet/app.js Resolved
Comment thread public/demo/halvet/app.js Resolved
Comment thread public/demo/halvet/app.ru.js Resolved
Comment thread public/demo/halvet/app.ru.js Resolved
@xnosir

xnosir commented Nov 17, 2026

Copy link
Copy Markdown
Member

CodeQL alerts here are all inside public/demo/<slug>/, which are byte copies of demo builds from the product repos (minified three.js / Telegram Web A / temml chunks, and the halvet, design-system, uz-open-data, gateway demo scripts). I checked the XSS ones: the sinks take values from static files (tokens.json, data attributes) or from the user's own input, none from the URL. Fixes belong in the source repos; resolving the threads here. The tools/gen-og.mjs alert is pre-existing on main.

@levrow
levrow merged commit 2853313 into main Nov 17, 2026
3 of 4 checks passed
@levrow
levrow deleted the feat/live-demos branch November 17, 2026 06:14
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.

3 participants