Demo Mode
Demo mode lets anyone explore MealPal instantly without creating an account.
How It Works
Section titled “How It Works”- User clicks “Try Demo” on the login page
- Frontend calls
POST /api/v1/demo/session→ gets demo user info - All subsequent API calls include
X-Demo-Mode: trueandX-Demo-User-Idheaders - Backend validates demo user exists with correct
auth_idbefore serving data
Pre-Seeded Data
Section titled “Pre-Seeded Data”The demo account includes 2+ weeks of realistic meal data (4 meals/day) and 3 sample conversations with Swan.
ssh ubuntu@api.tiny-agents.kovacova.cacd ~/tiny-agentsdocker compose exec backend python scripts/seed_demo.pySecurity
Section titled “Security”- Server-side validation: demo user must exist in DB with
auth_id == "demo_user_mealpal_2024" - User isolation: demo user can only access their own data
- No admin access, no permanent data modification
Key Files
Section titled “Key Files”| File | Purpose |
|---|---|
backend/scripts/seed_demo.py | Creates demo user and data |
backend/app/api/v1/demo.py | Demo session endpoints |
backend/app/core/auth.py | get_current_user_or_demo() |
frontend/src/lib/api.ts | Auto-adds demo headers |