Sammy Build Plan (Stakeholder)
Phase A: Minimal MVP
Current focus — Real auth, real DB, real emails. Free tier only.
What We're Building
Replace all mocked/demo components with production infrastructure. Users get real email briefings.
All mocked — Clerk not connected, Postgres not connected, Loops not connected, Stripe not connected.
/auth
Real email-code
User stored
Phase A Task List
| Task | What | Status |
|---|---|---|
| Real Clerk Auth | Create Clerk app, swap MockClerkProvider for @clerk/nextjs | TODO |
| PostgreSQL Setup | Create sammy_users table with email, persona, frequency, clerk_id | TODO |
| Preference API | Build /api/user/preferences endpoint for CRUD | TODO |
| n8n Subscriber Fetch | Workflow queries Postgres for users by cadence (daily/weekly) | TODO |
| n8n → Loops.so | Personalized email composition and send via Loops API | TODO |
| Email Deep Links | Magic links in email footer for /tune?token=xxx auto-auth | TODO |
| Hide Premium UI | Remove /pro page and premium upsells until Phase B | TODO |
- User signs up with real email verification
- Preferences persist in database
- User receives actual email briefing daily or weekly
- User can update settings via email link
Phase B: Stripe Payments
After MVP validated — Add premium tier with real billing.
What We're Adding
Re-enable premium UI and wire Stripe for real payments. Premium users get more content per email.
Phase B Task List
- Create Stripe account + Premium product ($49/mo)
- Integrate Stripe Checkout on /pro page
- Set up webhook endpoint (n8n or API route)
- Handle checkout.session.completed → set premium
- Handle invoice.payment_failed → notify user
- Add Stripe Customer Portal link
- Add DB fields: stripe_customer_id, subscription_status, premium_expires_at
- Re-enable premium UI (upsell card, /pro page)
Why Stripe comes second: Validate that users want and engage with the free product before investing in billing infrastructure. If the email experience doesn't retain users, payments won't matter.
Phase C: Enhanced Features
Future — Based on user feedback and product-market fit.
- Advanced personalization controls (topics, regions)
- Cross-role context in Premium emails
- Annual billing option (discount)
- Team/enterprise plans
- Email archive access for Premium
- Custom briefing times
System Flow — How Sammy Works
/auth
Email verification
User stored
Daily 6am
Finds articles
Scores & summarizes
Articles stored
Sources: Vogue Business, BoF, WWD, FT, McKinsey, Bain, etc. Tiered by credibility.
by cadence
Sent to Loops: recipient email, subject line, personalized article list (titles, summaries, links), unsubscribe link, manage preferences link. Loops handles deliverability and bounce management.
"Update" link
Auto-auth
Users change persona, frequency, or unsubscribe — no support tickets.
Integration Summary
| When | System | What Happens | Phase |
|---|---|---|---|
| User subscribes | Clerk → PostgreSQL | Email verification → user record created | A |
| User saves preferences | PostgreSQL | Persona + cadence stored | A |
| Daily scheduled run | n8n → Perplexity → Gemini | Articles discovered, scored, stored | A |
| Email send time | n8n → Loops.so | Personalized digest delivered | A |
| User clicks email link | Clerk → PostgreSQL | Auto-login → preference update | A |
| Premium purchase | Stripe → PostgreSQL → Loops | Payment processed, tier upgraded | B |
MVP Data Model
| Field | Example | Purpose | Phase |
|---|---|---|---|
| id | uuid | Primary key | A |
| partner@brand.com | User identity | A | |
| clerk_id | user_2xxx | Auth linkage | A |
| persona | CMO | Role-based targeting | A |
| frequency | daily / weekly | Delivery cadence | A |
| subscription_tier | free | Entitlement (free only in Phase A) | A |
| stripe_customer_id | cus_xxx | Stripe linkage | B |
| subscription_status | active / cancelled | Billing state | B |
Decisions Needed
- Email platform: Confirm Loops.so vs alternative (needed for Phase A)
- Email template: Design briefing layout (needed for Phase A)
- Send time: Confirm 8:00 AM EST or allow user selection
- Premium scope: Define exactly what Premium includes (for Phase B)
- Pricing: Confirm $49/mo or alternative (for Phase B)
Page intent: Internal clarity for stakeholders. Updated 2026-02-22.