Skip to content

feat(demo): add interactive public demo and try routes with role switcher - #32

Merged
arsalan-arshad merged 1 commit into
mainfrom
feat/public-demo-route
Nov 10, 2026
Merged

arsalan-arshad merged 1 commit into
mainfrom
feat/public-demo-route

Conversation

@arsalan-arshad

Copy link
Copy Markdown
Owner

Summary

Adds an interactive public showcase accessible at /demo and /try so prospective clients, beta testers, and outside users can explore and test-drive the application on Railway without requiring a Shopify development store or credentials.

What's Included

  1. Interactive Demo Hub (/demo and /try):
    • A sticky, responsive top navigation bar (.demo-showcase-bar) with role switching between:
      • Practitioner Portal (/demo?view=portal / default) — View active protocols, contacts, starter templates, and open the protocol builder.
      • Client Landing Page (/demo?view=client) — View recommendations, instructions, and retail pricing.
      • Printable Handout (/demo?view=handout) — View printable US Letter / A4 routine with QR code (demo bar auto-hides during printing).
      • Merchant Admin (/demo?view=admin) — View the embedded Polaris admin dashboard across Practitioners, Starters, Attribution, and Settings tabs.
  2. Mock Catalog & Builder Search:
    • Exposes mock /search/suggest.json with product resources for the protocol builder search dropdown.
    • Exposes mock /products/:handle.js for storefront client-side hydration.
    • Handles protocol saves (POST /apps/protocols?action=create) from the demo page with a clean success response.
  3. Shopify Reviewer & Production Safety:
    • Injected with X-Robots-Tag: noindex, nofollow.
    • Shopify reviewer endpoints (/, /admin, /api/proxy, webhooks) remain fully guarded and untouched.
    • In production mode (DATABASE_URL set), unauthenticated internal preview routes (/portal, /handout/demo) still return 404 as expected by existing compliance tests.

Verification

  • npm test: 606 passing / 0 failing (7 new tests added).
  • Verified GET /demo and GET /try return 200 with showcase bar and portal.
  • Verified all 4 view modes (portal, client, handout, admin).
  • Verified /search/suggest.json and /products/:handle.js.
  • Verified mock protocol creation from demo referer.

@arsalan-arshad
arsalan-arshad merged commit fe531d8 into main Nov 10, 2026
1 check passed
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