Set in .env:
DEMO_MODE="true"
DEMO_HINT="1" # optional: shows the owner login on the sign-in page
and restart.
What changes
- Every dashboard request that changes something answers
403with{"error": {"code": "demo_mode"}}: creating, editing or deleting listings, uploads, inquiry and viewing changes, notes, areas, team, settings, own profile, and the AI tools (so a public demo cannot spend your AI credits). - A banner at the top of the dashboard explains that changes are switched off, and every refused action shows the same message.
- Reading is not affected: visitors of the demo can open every dashboard page.
- Signing in and out still works.
- The public website is not affected: visitors can still send inquiries and viewing requests (they land in the demo inbox). To stop that too, remove the two public
POSTroutes or put the whole demo behind a reset job.
How it works
requireStaff({ write: true }) in src/lib/api.ts throws ApiError(403, "demo_mode") when DEMO_MODE is true, 1, yes or on. Every changing route passes write: true; scripts/e2e_api.py has a check for it when run against a demo.
Resetting a demo every night
npm run db:reset # wipes and re-seeds the database
Run it from cron, for example at 03:00. Never use DEMO_MODE or DEMO_HINT on a real agency.