Demo mode and the removal scripts
The public-demo switch the template ships with, why a normal install never sees it, and the scripts that delete it, and the mock API, from the code.
For the Full Stack package
What demo mode is
Demo mode is the switch behind the template's own public demo: every visitor gets a throwaway admin account of their own, the shared sample data cannot be changed, and the assistant pays for a few messages per visitor before asking for their own key.
- It is off by default:
falsein both.env.examplefiles, and kept off bydocker-compose.ymland both Dockerfiles. A normal install never sees it. - Turn it on only to show the template publicly, on the API and the dashboard together.
- When you ship your own product, the removal scripts below delete it from the code.
Remove demo mode and the mock API
| Command | Run in | What it deletes |
|---|---|---|
yarn remove:demo | The API's folder and the dashboard's folder | The demo-only files, every block marked #region demo-mode (in the code and in .env.example and .env), and the demo's texts. What is left is an ordinary app: one sign-in form, no demo notice, and the assistant's own key dialog for providers the server has no key for. |
yarn remove:mock | The dashboard's folder | src/lib/mock, the "Sample data" notice and every block marked #region mock-api. The dashboard then needs NEXT_PUBLIC_API_BASE_URL set. public/assets/ stays: the API's sample rows use the same pictures. |
yarn remove:demoBoth scripts rewrite files and cannot be undone without version control. Commit first. Running one twice is safe: the second run reports there was nothing left to do.
On the API, the demo_owner_id columns go with the code. With SQLite in development the schema sync drops them at the next start; a database that is not synchronised keeps an unused, empty column, which nothing reads.
How demo mode works
Included with your purchase. Sign in to read, or open it in your download.
The demo switches, what visitors can and cannot change, their own accounts, and the free assistant messages per visitor.
Free assistant messages per visitor
Included with your purchase. Sign in to read, or open it in your download.
How a public demo limits what the server's AI keys pay for, by country and by address.
The dashboard in demo mode
Included with your purchase. Sign in to read, or open it in your download.
What the dashboard changes in a demo build.