Session 4: Phase 1 MVP Build
Date: January 20, 2026 Duration: ~3 hours Goal: Build complete Phase 1 MVP per invoice addendum Status: ✅ LOCAL DOCKER RUNNING - READY FOR TESTING
Summary
All Phase 1 features have been written and local development environment is running.
Local Environment Status
| Service | URL | Status |
|---|---|---|
| Astro Dev Server | http://localhost:4321 | ✅ Running |
| Supabase Studio | http://127.0.0.1:54323 | ✅ Running |
| Supabase API | http://127.0.0.1:54321 | ✅ Running |
| Mailpit (email testing) | http://127.0.0.1:54324 | ✅ Running |
| PostgreSQL | localhost:54322 | ✅ Running |
Remaining for Production:
Environment setup (Supabase, Stripe, Claude API keys)- Local Docker setup complete- Deployment to Netlify with environment variables
- End-to-end testing
- Beta tester validation
Phase 1 Invoice Items → Build Status
| ID | Invoice Item | SP | Code | Tested | Deployed |
|---|---|---|---|---|---|
| P1-0 | Infrastructure Setup | 5 | ✅ | ❌ | ❌ |
| P1-1 | Book Creation | 4 | ✅ | ❌ | ❌ |
| P1-2 | Contributor Form | 5 | ✅ | ❌ | ❌ |
| P1-3 | AI Cleanup | 4 | ✅ | ❌ | ❌ |
| P1-4 | Owner Dashboard | 5 | ✅ | ❌ | ❌ |
| P1-5 | Stripe Integration | 4 | ✅ | ❌ | ❌ |
| P1-6 | PDF Generation | 6 | ✅ | ❌ | ❌ |
| P1-7 | Polish & Beta | 3 | 🔲 | ❌ | ❌ |
Total: 36 SP / $2,700
Build Order (Dependency-Aware)
1. P1-0: Infrastructure Setup (5 SP)
Supabase Project Setup:
- Create Supabase project
- Configure authentication (magic links)
- Create database schema:
-- Core tables books (id, owner_id, title, honoree_name, occasion, status, share_code, created_at) submissions (id, book_id, contributor_name, relationship, content, photo_urls, ai_suggestions, status, created_at) - Set up Row Level Security policies
- Create storage buckets (tribute-photos, generated-pdfs)
- Configure storage policies (authenticated upload, signed URL download)
Environment Setup:
- Add Supabase credentials to environment
- Create Supabase client utility
- Test auth flow locally
2. P1-1: Book Creation (4 SP)
Create Book Flow:
-
/createpage - book creation form- Honoree name
- Occasion (birthday, retirement, memorial, other)
- Optional: custom prompts selection
- Optional: cover photo upload
- Generate unique share code (6-char alphanumeric)
- Generate QR code for share link
- Redirect to owner dashboard after creation
Share Link:
-
/b/[code]- public contributor entry point - Display book info (honoree, occasion)
- Link to contributor form
3. P1-2: Contributor Form (5 SP)
Public Contribution Form:
-
/b/[code]/contribute- contribution form- Contributor name
- Relationship to honoree (dropdown + other)
- Photo upload (optional, max 5 photos)
- Tribute text (expandable textarea)
- Prompt questions (optional guidance)
- Photo upload to Supabase Storage
- Save submission to database
- Thank you confirmation page
Photo Handling:
- Client-side image resize before upload (max 2000px)
- Accept common formats (jpg, png, heic)
- Progress indicator during upload
4. P1-3: AI Cleanup (4 SP)
Grammarly-Style Suggestions:
- Integrate Claude API for text cleanup
- Generate suggestions for:
- Grammar/spelling fixes
- Clarity improvements
- (NOT: rewriting, combining, generating new content)
- UI to show suggestions inline
- Accept/reject individual suggestions
- Store original + final versions
API Endpoint:
-
/api/cleanup- POST with tribute text - Return array of suggestions with positions
- Rate limiting (prevent abuse)
5. P1-4: Owner Dashboard (5 SP)
Dashboard Page:
-
/dashboard- list of owner's books -
/dashboard/[bookId]- single book management- View all submissions
- Submission count / stats
- Edit book settings
- Preview book (read-only)
- Generate PDF button
- Copy share link / download QR
Submission Management:
- View individual submissions
- Apply AI cleanup to submissions
- Reorder submissions (drag-drop or arrows)
- Hide/show submissions from final book
6. P1-5: Stripe Integration (4 SP)
Checkout Flow:
- Stripe product setup (3 tiers)
- Basic: $19 - digital only
- Standard: $39 - digital + PDF download
- Premium: $69 - digital + PDF + future POD credit
-
/pricingpage showing tiers - Stripe Checkout session creation
- Webhook handler for payment confirmation
- Update book status on successful payment
- Beta coupon codes (100% off, limited use)
Payment States:
-
unpaid→paidon successful checkout - Gate PDF generation behind paid status
- Show upgrade prompts for unpaid books
7. P1-6: PDF Generation (6 SP) ⚠️ HIGHEST RISK
Technical Spike First:
- Evaluate approaches:
- @react-pdf/renderer (client-side)
- Puppeteer on serverless
- External service (DocRaptor, PDFShift)
- Build proof-of-concept with sample data
- Test with photos embedded
- Measure generation time and file size
PDF Template:
- Cover page (honoree name, occasion, date)
- Table of contents (optional)
- Each submission as a spread:
- Contributor name + relationship
- Photo(s) if present
- Tribute text
- Back cover / credits
Generation Flow:
-
/api/generate-pdfendpoint - Fetch book + submissions from DB
- Generate PDF
- Upload to storage
- Return signed download URL
8. P1-7: Polish & Beta Testing (3 SP)
Pre-Beta Checklist:
- Error handling throughout
- Loading states
- Mobile responsive
- Auth edge cases (expired links, etc.)
- Form validation
Beta Setup:
- Create 5 beta coupon codes
- Test full flow end-to-end
- Document known issues
- Create feedback form for testers
Technical Decisions
Database Schema (Full)
-- Users (managed by Supabase Auth)
-- profiles table for extended user info
create table profiles (
id uuid references auth.users primary key,
email text,
name text,
created_at timestamptz default now()
);
-- Books
create table books (
id uuid primary key default gen_random_uuid(),
owner_id uuid references profiles(id) not null,
title text,
honoree_name text not null,
occasion text not null, -- birthday, retirement, memorial, other
occasion_date date,
share_code text unique not null,
cover_photo_url text,
status text default 'draft', -- draft, active, paid, archived
tier text, -- basic, standard, premium
stripe_payment_id text,
pdf_url text,
created_at timestamptz default now(),
updated_at timestamptz default now()
);
-- Submissions
create table submissions (
id uuid primary key default gen_random_uuid(),
book_id uuid references books(id) not null,
contributor_name text not null,
contributor_email text,
relationship text not null,
content text not null,
content_cleaned text, -- after AI cleanup
photo_urls text[], -- array of storage paths
display_order int,
is_visible boolean default true,
created_at timestamptz default now()
);
-- RLS Policies
-- Books: owners can CRUD their own, public can read by share_code
-- Submissions: owners can read all for their books, contributors can insert
File Structure (Actual - Created This Session)
src/
├── components/
│ ├── TryItDemo.tsx (existing)
│ ├── AICleanupUI.tsx (new)
│ ├── PDFGenerator.tsx (new)
│ └── TributeBookPDF.tsx (new)
├── layouts/
│ └── Layout.astro (existing)
├── lib/
│ ├── supabase.ts (new)
│ ├── database.types.ts (new)
│ ├── stripe.ts (new)
│ ├── ai.ts (new)
│ ├── auth.ts (new)
│ └── utils.ts (new)
├── pages/
│ ├── index.astro (existing - landing)
│ ├── login.astro (new)
│ ├── create.astro (new - book creation)
│ ├── pricing.astro (new - tier selection)
│ ├── auth/
│ │ └── callback.astro (new - magic link handler)
│ ├── dashboard/
│ │ ├── index.astro (new - book list)
│ │ └── [bookId].astro (new - book detail)
│ ├── b/
│ │ └── [code].astro (new - contributor form)
│ ├── api/
│ │ ├── generate-tribute.ts (existing)
│ │ ├── cleanup.ts (new - AI cleanup)
│ │ ├── create-checkout.ts (new - Stripe)
│ │ └── stripe-webhook.ts (new)
│ ├── docs/ (existing)
│ └── signal.astro (existing)
├── .env.example (new)
└── supabase/
└── schema.sql (new - full RLS schema)
Out of Scope (Not in Phase 1 Quote)
Per invoice, these are explicitly excluded but may be needed for a complete experience. Work done on these items will be noted but not stop progress:
| Feature | Quote | Notes |
|---|---|---|
| Editorial Approval Workflow | $600 | Owner approves submissions before inclusion |
| Contributor Visibility Settings | $225 | Let contributors see each other's tributes |
| SMS Invitations | $300 | Send invites via text |
| Auto-Reminders | $225 | Nudge non-responders |
| Print-on-Demand Integration | $450 | Order physical books |
| Multiple Templates | $375 | Different PDF designs |
| Preview Before Publish | $225 | Preview full book before paying |
Unquoted work discovered during build:
- (To be logged as encountered)
Session Progress
Session 4a - January 20, 2026
- P1-0: Infrastructure Setup - Supabase types, client, auth, RLS schema
- P1-1: Book Creation -
/createform, 2-step wizard, QR code - P1-2: Contributor Form -
/b/[code]public form, photo upload - P1-3: AI Cleanup - Claude API integration, Grammarly-style UI
- P1-4: Owner Dashboard -
/dashboard, book list, detail view - P1-5: Stripe Integration - checkout, 3 tiers, webhook handler
- P1-6: PDF Generation - @react-pdf/renderer, client-side generation
All core features written in single session. Code committed and pushed to GitHub.
⚠️ Important: This code has NOT been tested or deployed yet. It builds successfully (npm run build passes) but requires environment setup before it can be tested.
Remaining Work (P1-7: Polish & Beta)
Environment Setup Required
Before deployment, need to configure:
Supabase Project
- Create project at supabase.com
- Run
supabase/schema.sqlin SQL Editor - Create storage buckets:
tribute-photos,generated-pdfs - Configure storage policies per schema comments
- Copy project URL and keys to
.env
Stripe Setup
- Create products/prices in Stripe Dashboard
- Configure webhook endpoint:
/api/stripe-webhook - Create beta coupon codes (100% off, limited redemptions)
- Copy keys to
.env
Claude API
- Get API key from Anthropic
- Add to
.envasANTHROPIC_API_KEY
Netlify Environment Variables
- Add all
.envvariables to Netlify project settings
- Add all
Testing Checklist
- Auth flow: magic link sign in/out
- Book creation: form validation, share code generation
- Contributor form: submission saves, photo upload works
- AI cleanup: suggestions appear, accept/reject works
- Dashboard: books list, submission management
- Stripe: checkout flow, webhook updates book status
- PDF: generates with all submissions and photos
- Mobile: responsive design works
Known Issues to Address
- PDF font loading may fail on some systems (using CDN fonts)
- Photo upload needs client-side resize for large images
- Need loading states for some async operations
Success Criteria
Phase 1 is complete when:
- ✅ User can sign up with magic link - Built
- ✅ User can create a tribute book - Built
- ✅ User can share link/QR with contributors - Built
- ✅ Contributors can submit tributes with photos - Built
- ✅ AI cleanup suggestions work on submissions - Built
- ✅ Owner can view/manage submissions in dashboard - Built
- ✅ Stripe checkout works with 3 tiers - Built
- ✅ Beta coupons work (100% off) - Built (needs Stripe config)
- ✅ PDF generates with all submissions - Built
- 🔲 5 beta testers can complete full flow - Needs testing
Next Steps
- Bert: Set up Supabase project and run schema
- Bert: Configure Stripe products and webhook
- Bert: Deploy to Netlify with environment variables
- Bert: Test full flow end-to-end
- Sheri: Complete Stripe account setup
- Sheri: Provide prompt options for contributor form
- Both: Recruit 5 beta testers
Code complete! Ready for environment setup, testing, and deployment.
Session 4b - January 21, 2026 (Continuation)
Work Completed
Local Docker Environment Setup
- Started local Supabase with Docker
- Applied migrations with RLS fixes (
TO publicper patterns doc) - Created storage buckets (tribute-photos, generated-pdfs)
- Configured
.envwith local Supabase credentials - Started Astro dev server at localhost:4321
Branding Updates
- Changed "SIN" logo placeholder to heart emoji (inappropriate acronym for target audience)
- Generated 11 logo options via Gemini AI
- Trimmed logos to remove watermarks
- Created
/logoreview page for Sheri to select preferred logo - Updated all pages to use actual logo image (
/logo.png)
Pricing Updates (per 01/19 meeting)
- Basic: $29 (was $19)
- Standard: $49 (was $39)
- Premium: $79 base + pass-through for print (was $69)
- Added "1 year active" to features
- Updated comments noting pass-through costs for premium
Documentation
- Added Supabase patterns doc to
docs/reference/supabase-patterns.md - Session document updated
- Added Supabase patterns doc to
Logo Files Created
Located in docs/assets/logos/ and public/logos/:
| File | Description | Use Case |
|---|---|---|
| 01-full-logo-twotone-beige-bg.png | Gold/teal with text | Print, marketing |
| 02-full-logo-teal-beige-bg.png | Single teal with text | Clean headers |
| 03-full-logo-embossed-paper.png | Letterpress style | Premium feel |
| 04-full-logo-twotone-transparent.png | Two-tone, web-ready | Headers |
| 05-full-logo-embossed-transparent.png | Embossed, web-ready | Premium headers |
| 06-icon-gradient-beige-bg.png | Gradient icon only | App icons |
| 07-icon-gradient-transparent.png | Gradient, web-ready | Favicon |
| 08-icon-embossed-paper.png | Embossed icon | |
| 09-icon-embossed-transparent.png | Embossed, web-ready | Light backgrounds |
| 10-icon-handdrawn-beige-bg.png | Brushstroke style | Warm, personal |
| 11-icon-twotone-transparent.png | SELECTED | Current site logo |
Reference Documents
- Supabase Patterns - RLS, auth, debugging
Session Output
- Commit:
20c32c4- "Build Phase 1 MVP - complete core feature set" - Files: 24 new files, 4,428 lines added
- Build: ✅ Passes (
npm run build) - Deployed: ❌ Not yet (needs env vars)
Session 4b Output
- Local environment: ✅ Running (Astro + Supabase + Mailpit)
- Logo review page: http://localhost:4321/logo
- Pricing: Updated to $29/$49/$79