File size: 3,011 Bytes
cb43fbd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Demo Mode

Demo mode lets you run a public "try before you install" instance of TREK. A shared demo account is available for visitors, write operations are blocked for that account, and the database resets automatically every hour so the instance stays in a known state.

<!-- TODO: screenshot: demo mode banner or try-demo button on login page -->

## Enabling demo mode

Set `DEMO_MODE=true` in your environment and restart TREK. See [Environment-Variables](Environment-Variables) for how to set environment variables.

When demo mode is active, the login page shows a one-click **"Try the demo"** button. Clicking it logs the visitor in as the demo user immediately β€” no credentials need to be entered and no registration is required.

**Demo account (auto-created on first start):**

| Field | Value |
|---|---|
| Email | `demo@trek.app` |
| Password | `demo12345` |

## What the demo user can and cannot do

The demo user account has read access to the shared trip data but the following operations are permanently blocked:

- **Password change** β€” returns 403.
- **Account deletion** β€” returns 403.
- **MFA enrollment or removal** β€” returns 403.
- **File uploads** β€” avatar uploads, trip cover uploads, and document/photo file attachments are blocked and return 403.
- **All MCP write tools** β€” create, update, and delete operations via the MCP API are blocked for the demo user.

Registration is also disabled while demo mode is active β€” visitors cannot create new accounts.

The admin account is unaffected and retains full access.

## Hourly reset

TREK schedules an automatic hourly reset of the demo database. At each reset:

1. The current `travel.db` is replaced with the saved baseline (`travel-baseline.db`).
2. The admin account's credentials (`password_hash`, API keys, avatar) are re-applied on top of the restored baseline, so admin API keys and password changes survive the reset.

If no baseline has been saved yet, the reset is skipped and a message is logged.

## Saving a baseline

The baseline is the snapshot the hourly reset restores to. The admin can update it at any time:

**Endpoint:** `POST /admin/save-demo-baseline`

This is available in the admin panel. The baseline captures the current state of the database β€” including trip data, settings, and encrypted API keys β€” so demo features (maps, photos, weather) continue to work after each reset.

On first start with demo mode active, TREK seeds three example trips (Tokyo & Kyoto, Barcelona Long Weekend, New York City) owned by the admin and shared with the demo user, then saves the initial baseline automatically.

## Limitations

- Demo mode is not for production use with real user data. The hourly reset deletes all visitor-created content.
- All demo visitors share a single account β€” there is no isolation between sessions.
- File uploads (photos, documents, trip covers, avatars) are disabled for the demo user.

## See also

- [Environment-Variables](Environment-Variables)
- [Backups](Backups)