Petunia Demo Mode
Complete guide for demo mode configuration, data isolation, and demonstration workflows.
Demo Portal Identifier
The official Petunia ID for the demo portal is:
PID-DEMO-001
This identifier is the single source of truth for demo portal detection.
Identifiers Explained
| Field | Value | Purpose |
|---|---|---|
petuniaID | PID-DEMO-001 | Canonical, human-readable identifier (PRIMARY) |
id | Auto-generated CUID | Internal database primary key |
isDemoPortal | true | Boolean flag for quick checks |
Usage in Code
import { DEMO_PETUNIA_ID, isDemoPortalByPetuniaID } from '@/lib/demo';
// Check if a portal is the demo portal (preferred)
if (portal.petuniaID === DEMO_PETUNIA_ID) {
// Demo-specific logic
}
// Or use the helper function
if (isDemoPortalByPetuniaID(portal.petuniaID)) {
// Demo-specific logic
}
Available Exports from @/lib/demo
| Export | Type | Description |
|---|---|---|
DEMO_PETUNIA_ID | string | The canonical PID ('PID-DEMO-001') |
isDemoPortalByPetuniaID() | function | Check petuniaID against demo portal |
isDemoPortal() | function | Check either id or petuniaID |
demoCompany | object | Demo portal object for fallback responses |
Quick Start
Copy the pre-configured .env.demo file:
cp .env.demo .env.local
npm run dev
Open http://localhost:3000 in your browser.
Environment Variables
Core Demo Flags
| Variable | Value | Description |
|---|---|---|
NEXT_PUBLIC_MODE | demo | Sets application mode to demo |
NEXT_PUBLIC_SKIP_ONBOARDING | true | Bypasses onboarding flow |
NEXT_PUBLIC_ENABLE_DEMO_MODE | true | Enables demo-specific UI elements |
Required Variables
For basic demo functionality:
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/petunia
# Authentication
SESSION_SECRET=your-session-secret
# Supabase (required)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
Self-Contained Demo (No External APIs)
USE_DEMO_SERVICES=true
Data Isolation Guarantees
Demo vs Test Doubles
- Demo data: Curated portal seeded by
prisma/seed.ts(demo@example.com). The only non-production tenant surfaced in the UI. - Test doubles ("mocks"): Exist only inside
tests/**andjest.setup.js. Never imported by runtime code.
Production Guarantees
app/api/payments/**/*talks directly to Stripe using the live Prisma clientlib/auth/server.tsreads real user rows (including billing fields)- Seeds only provision the dedicated demo tenant. Normal signups start with empty billing fields.
Checklist Before Shipping
- Production files do not import from
tests/** - Demo seed accounts are clearly labeled as demo-only in the UI
- Automated tests that rely on test doubles stay under
tests/**
Demo Seed Workflow
Run the seed after configuring environment variables:
pnpm prisma db seed
Prerequisites
- Clean repo: Stash or commit pending work
- Supabase credentials:
SUPABASE_URL,SUPABASE_SERVICE_ROLE_KEY,SUPABASE_ANON_KEY - Database access:
DATABASE_URLpointing at your Supabase project - pnpm + Node 22: Required to execute
tsx prisma/seed.ts
Offline Mode
If running without network access:
SEED_SKIP_SUPABASE=true pnpm prisma db seed
Demo-Ready Features
Fully Working (Demo with confidence)
Authentication
- Email/password signup and signin
- Google OAuth signin
- Password reset flow
- Session persistence and logout
Onboarding
- Welcome animation
- Business information collection
- Portal creation and dashboard redirect
Dashboard
- Portal dashboard loads
- Navigation and settings accessible
- Multi-account support
Yelp Integration
- Connect Yelp account
- View Yelp reviews and messages
- Real-time sync
AI Features
- Generate AI responses
- Edit and send responses to Yelp
- Context-aware replies with brand voice
Communication
- Unified inbox with message threading
- Multi-channel support and search
Known Issues (Don't demo these)
- Some advanced analytics features in progress
- Phone integration in development
- Google Business and Facebook integrations in progress
Demo Script (10 minutes)
Step 1: Show Signup (2 min)
"Let me show you how easy it is to get started..."
- Go to signup page
- Enter email/password OR click Google OAuth
- Complete onboarding wizard
- Land on dashboard
Highlight: Clean interface, fast onboarding, professional design
Step 2: Connect Yelp (3 min)
"Now let's connect your Yelp Business account..."
- Go to Settings → Connections
- Click "Connect Yelp" and authorize
- View synced reviews and messages
Highlight: Simple OAuth, instant sync, secure authorization
Step 3: View Messages (2 min)
"All your Yelp reviews and messages in one place..."
- Go to Inbox
- Show message list with filters
- Click on a specific message
- Demonstrate search functionality
Highlight: Unified inbox, clean organization, fast search
Step 4: Generate AI Response (3 min)
"This is where the magic happens..."
- Select a review or message
- Click "Generate AI Response"
- Edit the response if needed
- Send to Yelp
Highlight: Context-aware AI, brand voice consistency, time savings
Security Considerations
- Never use demo mode in production environments
- The
.env.demofile contains placeholder credentials only - Replace all placeholder values with real credentials before deploying
- Never commit
.env.localfiles to version control
Troubleshooting
Demo mode features not working
- Verify
.env.localcontains the demo flags - Restart development server after changing environment variables
- Clear browser cache and cookies
- Check browser console for errors
Database connection errors
- Verify
DATABASE_URLis correct - Ensure PostgreSQL is running
- Check that the database exists
- Run migrations:
npx prisma migrate dev
Last Updated: December 2025