Session 17: Contributor Limits, Premium Hardcover, Spine Color, Admin Orders
Date: 2026-03-27 Focus: Contributor/photo limits, Premium tier hardcover credit, spine color, order notifications, admin order management
Work Completed
Contributor & Photo Limits
- Owner-configurable
max_contributorsandmax_photos_per_contributoron books table - Defaults: 25 contributors, 5 photos each
- Enforced on contributor form — shows "book is full" when limit reached
/api/check-limitsendpoint for real-time validation- Book-full notification email sent to owner when someone is turned away
- Word limits on tribute responses with dynamic photo limits per tier
Premium Tier = Physical Book Included
- Premium ($69) includes a hardcover printed copy
- Non-premium tiers can order but pay full price (no credit)
- Print credit only applied for Premium tier (
bookTier === 'premium') - Renamed section from generic to "Plan Your Book"
Hardcover Spine Color
- 6 color presets (Midnight, Teal, Navy, Burgundy, Forest, Gold) + custom color picker
spine_colorcolumn added toprint_orderstable- Spine color shown in admin orders table with color swatch
- 3D book preview on order card shows spine with selected color
Order Notifications
sendPrintOrderNotification()inemail.ts— emails admin via ACS when order is placed- Includes: book title, honoree, owner email, size, cover type, interior, spine color, pages, pricing, credit, status
- Triggered on both $0 orders (covered by credit) and Stripe webhook completion
Admin Order Management
- Print Orders section on
/adminpage - Table: book ID, cover type, interior, spine color, pages, amount, status, date
- Status dropdown per order: pending → paid → processing → shipped → cancelled
- Status filter dropdown
Cover Preview on Order Card
- 3D book preview proportional to selected book size
- Shows cover photo, title, background color from cover design
- Hardcover shows spine with selected color
Files Modified/Created
src/components/PrintOrderCard.tsx— Spine color picker, cover preview, Premium logicsrc/pages/api/order-print.ts— Store spine color, trigger notificationsrc/pages/api/stripe-webhook.ts— Trigger notification on paymentsrc/lib/email.ts—sendPrintOrderNotification(),sendBookFullNotification()src/pages/admin/index.astro— Print orders table with status managementsrc/pages/api/check-limits.ts— Contributor/photo limit enforcementsupabase/migrations/— spine_color column, max_contributors/max_photos columns