Skip to main content

Demo Mode

Let visitors tour the admin panel without breaking your data.

Demo mode is a special setting that lets anonymous visitors access every page, including /admin and /dashboard — but silently blocks all writes to the database. Perfect for live demos on your marketing site, or sharing a preview with a client.

Turn it on

Set one env var:

.env.local
NEXT_PUBLIC_APP_MODE=demo

Restart the dev server (or redeploy on Vercel).

Don't enable on your real production site

Demo mode exposes the admin panel to the public. Use it on a separate environment (e.g. demo.mydirectory.com) that's pointed at a sandbox Supabase project.

What demo mode does

Opens up every route

  • /admin/* is reachable without auth
  • /dashboard/* is reachable without auth
  • The "Sign in" flow still works, but isn't required

Blocks all writes

  • POST, PUT, DELETE API requests return an explanatory "demo mode: write blocked" response
  • Attempting to submit a project / approve something / delete a row succeeds visually then reverts
  • Real users can't pollute your demo data

Adds visual cues

  • A banner at the top reading "Demo mode — changes are not saved"
  • Subtle watermarks in the admin panel

A typical demo setup

main.mydirectory.com          → production, NEXT_PUBLIC_APP_MODE unset
demo.mydirectory.com          → demo, NEXT_PUBLIC_APP_MODE=demo,
                                points at a separate Supabase project
                                seeded with sample data

Seed the demo DB with fake users, projects, ratings — run the project once locally against the demo Supabase, submit examples, approve, comment. That becomes your demo content.

Turning it off

Remove or unset the env var → redeploy. That's it. All routes re-lock and writes re-enable.

See also