Demo mode and seed data generation.

Demo mode replaces real PII with sample data for safe previewing. Seeds populate the database with realistic test events and attendees.

Functions

f
applyDemoOverrides(
form: FormParams,
mapping: DemoFieldMap
): FormParams

Replace form field values with demo data when demo mode is active. Only replaces fields that are present and non-empty in the form. Mutates and returns the same URLSearchParams for chaining.

f
createSeeds(
eventCount: number,
attendeesPerEvent: number
): Promise<SeedResult>

Create seed events and attendees using efficient batch writes. Encrypts all data before inserting, matching production behavior. Assigns random ticket quantities (1-4) per attendee without overselling.

f
isDemoMode(): boolean

Check if demo mode is enabled

f
randomChoice<T>(arr: readonly T[]): T

Pick a random element from an array

f
resetDemoMode(): void

Reset cached demo mode value (for testing and cache invalidation)

f
setDemoModeForTest(enabled: boolean): void

Explicitly set demo mode on or off (for testing). Bypasses Deno.env to avoid races between parallel test workers.

Type Aliases

Variables

v
DEMO_EVENT_DESCRIPTIONS: readonly string[]

Demo event descriptions — rock-themed gig blurbs assembled from word pools. Like the names above, the list is procedurally generated but seeded so it stays deterministic across runs.

v
DEMO_EVENT_LOCATIONS: readonly string[]

Demo event locations — pretend rock-venue / festival listings. Procedurally generated from the venue word pools using a seeded PRNG.

v
DEMO_EVENT_NAMES: readonly string[]

Demo event names — pretend rock/heavy-metal band listings. Generated procedurally from a seeded PRNG so the list stays deterministic across runs (tests rely on this) but offers far more variety than a hand-curated list while staying on-theme.

v
EVENT_DEMO_FIELDS: DemoFieldMap

Event metadata fields

v
GROUP_DEMO_FIELDS: DemoFieldMap

Group name and description fields

v
SEED_MAX_ATTENDEES: 100000

Max attendees per seeded event

v
v
TERMS_DEMO_FIELDS: DemoFieldMap

Terms and conditions field