QA Guide
How to verify Syntropy-Journals features against a seeded local development environment.Prerequisites
| Requirement | Check | Install |
|---|---|---|
| Docker | docker --version | docker.com |
| Python 3.11+ | python3 --version | Via pyenv or system |
| uv | uv --version | curl -LsSf https://astral.sh/uv/install.sh | sh |
| PostgreSQL client (optional) | psql --version | apt install postgresql-client |
Integration setup: Before running a full demo, complete the Integration Setup Guide to configure Clerk, Stripe, and optional services.
Environment Setup
Starting the Dev Server
Full Reset (Clean Slate)
When you need a pristine environment:QA Checklist: Seed Data Migration
Verify that the Alex Rivera → Sarah Chen migration is complete and all demo data renders correctly.1. Database Verification (CLI)
Run before starting the app to confirm seed data is present:| id | first_name | last_name | user_type | |
|---|---|---|---|---|
| N | sarah@test.syntropyhealth.bio | Sarah | Chen | USER |
| M | sarah+shopify@test.syntropyhealth.bio | Sarah | Chen | USER |
2. Seeding Idempotency
0 loaded, N skipped for every loader. No errors.
3. Landing Page (/)
- Open http://localhost:3000
- Verify the landing page loads without console errors
- Verify no references to “Alex Rivera” appear anywhere
4. Individual User Dashboard (/shrine-checkins)
Note: Clerk auth is required for protected routes. In dev mode with mock auth, you may need to configure a test user in Clerk’s dev dashboard matching sarah@test.syntropyhealth.bio.
- Navigate to the dashboard
- Verify 8 check-ins display in the list:
- 3 text, 2 voice, 1 chat, 1 phone, 1 pending
- Sorted by recency (most recent first)
- Each shows correct type icon, summary, and status badge
- Verify check-in detail view:
- Click any processed check-in
- Raw content / transcript is visible
- Health topics tags render correctly
- Sentiment badge shows (positive/neutral/negative)
- Verify no “Alex Rivera” appears in any UI element
5. Health Data Views
Medications
- Navigate to the medications view/tab
- Verify 4 medication entries visible:
- Metformin 500mg (twice daily)
- Vitamin D3 5000 IU (daily)
- Magnesium Glycinate 400mg (nightly)
- Ibuprofen 400mg (as needed)
Food Logs
- Navigate to the food tracking view/tab
- Verify 4 food entries with calorie data:
- Oatmeal with blueberries (350 cal)
- Green tea (2 cal)
- Grilled chicken salad (520 cal)
- Green protein smoothie (310 cal)
Symptoms
- Navigate to the symptoms view/tab
- Verify 3 symptom entries:
- Knee discomfort (mild, right knee)
- Insomnia (moderate)
- Headache + Fatigue (moderate)
6. Profile Page (/profile)
- Verify display name shows “Sarah Chen”
- Verify bio: “Health-conscious entrepreneur exploring integrative wellness.”
- Verify location: “San Francisco, CA”
- Health profile shows:
- Conditions: Type 2 Diabetes, Vitamin D Deficiency
- Supplements: Vitamin D3, Magnesium, Omega-3, Probiotic
- Goals: sleep quality, blood sugar, vitamin D, exercise
- Allergies: Shellfish
- Diet: Mediterranean
7. Settings Page (/settings)
- Verify subscription plan shows “Free”
- Verify herbal supplement toggle is ON
- Verify notification frequency = 2
8. Catalog (/catalog)
- Verify 4 products render in the catalog grid
- Verify 4 protocols are visible
- Verify filtering by category works (supplements, nutrition, fitness, wellness)
- Verify protocol detail view shows instructions, duration, linked product
9. Protocol Pipeline
Catalog Protocols
- Navigate to
/catalog - Verify 4 protocols display with partner name “Sarah Chen” (or Chen Wellness Co)
- Each protocol shows: name, description, duration, usage type, linked product
User Protocol Adoption
- Log in as individual user (Sarah Chen)
- Navigate to the Lounge / adopted protocols view
- Verify 2 adopted protocols: Vitamin D3 Supplementation, Magnesium for Sleep
- Each shows: status “active”, started ~14 days ago, share data enabled
Adherence / Streaks
- For each adopted protocol, verify adherence heatmap:
- 14 days of history
- Days 1-7 ago: all “taken” (green) — 7-day current streak
- Day 0 (today): “pending”
- Days 8-13 ago: mix of taken/missed/skipped
- Verify PDC (Proportion of Days Covered) calculation:
- 10 taken / 14 days = ~71% (below 80% adherence threshold)
Partner Portal Protocols
- Log in as partner user (sarah+shopify)
- Navigate to
/partner/portal - Verify 4 protocols listed in management view
- Verify protocol detail shows: adopter count, adherence stats
Database Verification
10. ShrineAI Chat (/longevitian/shrine-chat)
- Open the chat interface
- Type a message and submit
- In
make run dev-mockmode: verify mock response renders - In
make run devmode: verify LLM response streams correctly - Verify no stale “Alex” references in system prompts or greeting
QA Checklist: Regression
Run after any significant change to verify nothing is broken.Automated Checks
Manual Smoke Test
| Step | Route | What to Check |
|---|---|---|
| 1 | / | Landing page loads, no console errors |
| 2 | /sign-in | Clerk sign-in form renders |
| 3 | /shrine-checkins | Dashboard loads with check-ins (requires auth) |
| 4 | /longevitian/shrine-chat | Chat interface loads, input works |
| 5 | /catalog | Product grid renders with images |
| 6 | /profile | Profile data displays correctly |
| 7 | /settings | Settings form is interactive |
| 8 | /partner/portal | Partner dashboard loads (requires partner auth) |
QA Checklist: Seeding Pipeline
For verifying changes toscripts/seed/ or data/seed/.
Unit Tests
- Sarah Chen as individual user (email, name, type)
- Partner user exists with org name
- All seed data is internally consistent (checkin linkages, no Alex Rivera references)
- Protocol pipeline: adoptions reference valid protocols, 7-day streak, valid statuses
- Subscription plans: 3 tiers, Free first, Pro is popular
- UserType validity: all seed users use valid enum values (ADMIN/USER/GUEST)
- SeedResult dataclass works correctly
Integration Test
loaded > 0, errors = 0.
Edge Cases
| Scenario | How to Test | Expected |
|---|---|---|
| Empty DB | make db-reset && make db-migrate && make run seed | All records inserted |
| Re-seed | Run make run seed twice | Second run: all skipped |
| Missing DB | Stop Docker, run seed | Clear connection error (not a crash) |
QA Checklist: Store Referral Attribution
Verify the full referral pipeline: link click → cookie capture → signup → DB record → portal display.Prerequisites
0. Generate QA Referral Link
1. Landing Page Cookie Capture
- Open
http://localhost:3000/?ref=store-chen-well-a1b2 - Open DevTools → Application → Cookies →
localhost - Verify cookie
refexists with valuestore-chen-well-a1b2and max-age ~30 days - Verify browser console:
document.cookie.match(/ref=([^;]*)/)returns the code
2. Sign Up via Referral Link
- From the landing page (with cookie set), click Sign Up / Get Started
- Complete Clerk sign-up with a new test email (not the seeded demo users)
- After sign-up completes, the auth callback fires
handle_referral_cookie
3. Database Verification
status = 'signed_up', referred_clerk_user_id matching the new user’s Clerk ID, and signed_up_at populated.
total_clicks >= 4 (3 seeded + 1 new), total_signups >= 2 (1 seeded + 1 new).
4. Partner Portal Verification
- Log in as the partner user (
partner@syntropyhealth.com/ Clerk dev) - Navigate to
/partners/dashboard - Verify the “Referrals” tab shows:
- Referral link containing
store-chen-well-a1b2 - Total signups count matches DB
- Recent signups (30d) count matches DB
- Referral link containing
- Copy referral link button works (check clipboard)
5. Edge Cases
| Scenario | How to Test | Expected |
|---|---|---|
| Invalid referral code | Visit /?ref=!!!invalid!!! | Cookie not set (sanitized to empty) |
| Non-store referral | Visit /?ref=friend-code | Cookie set, but no StoreReferral row — only User.referral_source |
| Expired cookie | Clear cookies, sign up without ?ref= | No referral attribution at all |
| Duplicate signup | Sign up same user twice with same ref | Only one StoreReferral row per user |
| Partner without Store | Log in as partner before seeding store | Portal falls back to User.referral_code |
6. PostHog Verification (if configured)
IfPOSTHOG_PROJECT_API_KEY is set, check PostHog dashboard for:
referral_link_clickedevent withref: store-chen-well-a1b2referral_signup_completedevent withreferral_source: store-chen-well-a1b2store_referral_signupevent withreferral_code: store-chen-well-a1b2
Protocol Extraction — User Journey
The protocol extraction pipeline createsProtocol records from external data sources. With PRD-17’s integration architecture, protocol sources are divided into two categories:
SDK-Integrated Sources (API-driven)
Partners using e-commerce platforms push protocols via the Integration API:Non-SDK Sources (Extraction-driven)
For protocols that don’t come through an SDK integration, the protocol extractor parses unstructured data:| Source | Status | How It Works |
|---|---|---|
| Shopify orders (consumer) | Implemented | protocol_extractor.py — regex-based dosage parsing from order line item titles |
| Email forwarding | Future | User forwards practitioner email → LLM extracts protocol details |
| Manual entry | Implemented | Protocol form (partner portal on hold; will move to Shopify app) → create_protocol_sync(source="manual") |
| ShrineAI chat | Future | Agent tool creates protocol from conversation context |
Consumer Shopify Extraction Flow (Current)
functions/consumer/protocol_extractor.py— dosage regex, protocol builderfunctions/consumer/shopify_orders.py— supplement keyword filterfunctions/consumer/db_utils.py:save_protocols_from_sync— DB persistence with dedup
Extraction vs SDK Decision Matrix
| Signal | Use Extraction | Use SDK API |
|---|---|---|
| Partner has Shopify/Amazon/WooCommerce app | No | Yes |
| Consumer connected personal Shopify store | Yes | No |
| User forwards an email with protocol info | Yes (future) | No |
| Partner creates protocol manually | No (form-based, no extraction) | No |
ProtocolCreateRequest payloads. Extraction only runs for unstructured sources where the system must infer protocol details from raw text, product titles, or email content.
Verifying Data via psql
Quick-reference queries for inspecting seeded data:Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
make run seed shows connection error | PostgreSQL not running | make docker-db |
| Seed shows 0 loaded, 0 skipped | Tables don’t exist | make db-migrate first |
| Duplicate key error | Stale data from previous schema | make db-reset && make db-migrate && make run seed |
| App shows blank dashboard | No seeded data for current user | Verify Clerk user ID matches user_demo_sarah_chen |
| ”Alex Rivera” still appears | Browser cache or stale state | Hard refresh (Ctrl+Shift+R), clear local storage |
Related Documentation
- Integration Setup Guide — Clerk, Stripe, Shopify, Amazon setup for demo
- User Stories — End-to-end journeys for individual and partner roles (includes seed data reference)
- Development — Full development setup
- Environment Variables — All required env vars
- Debug Guide — Common debugging techniques