Remove Demo Mode

Demo mode (NUXT_PUBLIC_DEMO_MODE) turns a deployment into a disposable public demo with shared demo accounts, a reset on every start, no emails to seeded users and simulated billing. This guide removes all of it, including the simulated billing provider and its checkout, and keeps Lemon Squeezy. It follows the shared removal loop.

Entry points

  • src/server/demo/: seed, reset, lifecycle and demo checkout, with their specs.
  • src/server/tasks/demo-lifecycle.ts
  • src/shared/demo/: the public demo credentials.
  • src/shared/utils/demo-mode.ts and src/shared/utils/demo-mode.spec.ts
  • src/server/services/use-demo-billing-provider-service.ts and src/server/services/use-demo-billing-provider-service.spec.ts
  • src/server/api/workspaces/[id]/billing/demo-checkout.post.ts and src/server/api/workspaces/[id]/billing/demo-checkout.post.spec.ts
  • src/app/pages/workspaces/[workspaceId]/demo-checkout/
  • src/app/components/domain/workspace/WorkspaceDemoCheckout/
  • src/app/components/domain/auth/DemoLogin/
  • .agents/knowledge/adr/0008-demo-mode.md
  • The env variable NUXT_PUBLIC_DEMO_MODE in .env-example.
  • The runtime config key demoMode in nuxt.config.ts.
  • The Prisma field User.isDemo.
  • The i18n namespaces DemoLogin and WorkspaceDemoCheckout and the keys pages.workspaces.demoCheckout.*.

Not found by the compiler

  • Billing branches: simplify them by hand, because the compiler only reports the deleted import. In src/server/services/use-billing-provider-service.ts, keep only the provider selection.
  • Remove the demo guard and keep the real handling in src/server/api/workspaces/[id]/billing/checkout.post.ts and both webhook routes lemonsqueezy.post.ts and stripe.post.ts in src/server/api/webhooks/.
  • Remove the demo-lifecycle entry from src/server/plugins/run-startup-tasks.ts. The other startup tasks stay.
  • In src/app/pages/index.vue, remove DemoLogin and isDemoMode, and keep AuthForm.
  • In src/app/pages/workspaces/[workspaceId]/settings.vue, remove isDemoMode, the simulated prop and the redirect to the demo checkout. Checkout always goes to the provider.
  • Remove the simulated prop and its branches from src/app/components/domain/workspace/WorkspaceBilling/WorkspaceBilling.vue and from its spec and stories.
  • Remove completeWorkspaceDemoCheckout from src/app/store/workspace.ts. Remove completeWorkspaceDemoCheckout and isCompletingWorkspaceDemoCheckout from src/app/composables/actions/use-workspace-actions.ts. Remove their specs.
  • Users with isDemo: delete the checks and their tests in src/server/domain/user/user.policy.ts (canChangeUserIdentity) and src/server/domain/user/use-user-service.ts (the check that throws DemoIdentityProtectedError).
  • Delete DemoIdentityProtectedError from src/server/utils/errors.ts.
  • In src/server/services/use-email-transport-service.ts, delete hasDemoRecipient and the mock-email branch for demo recipients.
  • In src/server/api/auth/github/index.get.ts, delete the redirect github-demo-account.
  • Remove isDemo from the omit of src/shared/types/domain/User.ts and src/shared/types/domain/WorkspaceInvitation.ts.
  • Prisma: remove isDemo from prisma/schema/user.prisma, then create a new migration with npm run db:migrate. Never edit the existing init migration. The generated client and the OpenAPI output src/public/swagger/openapi.json are regenerated by the scripts, never edited by hand.
  • Text: AuthDialog.title ("Welcome to the Vuesion Demo App") is used by src/app/pages/index.vue and src/app/pages/workspace-invitations/[id]/index.vue. Replace the text and update e2e/fixtures.ts and e2e/specs/login.spec.ts, which look the dialog up by this name.
  • Marketing: if you keep it, replace the demo wording in FoundationSection.platform.demoMode, ConversionSection.included.admin, HeroSection.cta, MonetizationSection.cta, NextStepsSection.description, NextStepsSection.tile.demo.* and FaqSection.demo.*, and the sentence about the live demo in FaqSection.refund.answer.
  • The privacy policy and terms pages (src/app/pages/privacy-policy/index.vue, src/app/pages/terms/index.vue) contain "Demo Application" sections and demo mentions. These are legal texts: replace them with your own, do not just delete them.
  • i18n: the extractor never removes keys. Delete unused keys by hand from en-US.json and de-DE.json in i18n/locales.
  • Docs: delete the section "Demo mode" (with "Demo lifecycle", "Vuesion demo fixture" and "Simulated billing") in content/docs/03.development/04.configuration.md, and the demo mentions elsewhere in that page (test mode note, seed, emails). Also adjust "Customize the seed": it names src/server/demo/seed-demo-data.ts, the Pro and Business plans from the fixture and the list item "demo users and workspaces, if you use demo mode". Only the Free plan from prisma/seed.ts remains. Also adjust the paragraph about fictional demo External IDs (such as demo_variant_pro_monthly) in that section. Links to #demo-mode in the same page break.
  • Docs: adjust the demo mentions in content/docs/02.core-concepts/06.plans-and-entitlements.md, content/docs/02.core-concepts/07.billing-and-subscriptions.md (provider selection, webhooks, runbook, "Keep the demo branch") and content/docs/02.core-concepts/10.incidents.md (context value demo).
  • Agent knowledge: in .agents/knowledge/domain.md, delete the stack line "simulated billing provider for demo mode", the product rule "Demo mode: isDemo users, no emails (ADR 0008)" and the glossary term "Demo mode", together with the ADR.
  • Test databases: src/server/test/global-setup.ts creates testdb_demo and testdb_demo_fixture (env variables DEMO_TEST_DATABASE_URL, DEMO_FIXTURE_TEST_DATABASE_URL). testdb_demo is the template for testdb_reconciliation, testdb_trial_expiry and testdb_trial_reminders. Delete testdb_demo_fixture and its variable. Rename testdb_demo (for example testdb_template) together with the -T template references of the other databases, and rename or inline DEMO_TEST_DATABASE_URL. Keep the template step for the others.
  • In src/server/domain/subscription/use-subscription-service.ts, the comment "Provider subscriptions outlive disposable workspaces, e.g. after a demo reset." becomes outdated: reword it without the demo reset or delete it if the code needs no explanation.

Coding-agent prompt

Read this guide and the shared removal loop. Delete every entry point of this guide, handle every item under "Not found by the compiler", and run the loop until lint, test and build pass.