readme
Archived: AI ceremony script generation (Astro)
Salvaged from apps/adventure-weddings/ before that app was deleted on 2026-08-07.
This is reference material, not wired to anything. Nothing imports it.
Why the app was deleted
apps/adventure-weddings/ was an Astro site that had been superseded by the
Lovable React site at ~/Projects/adventure-weddings
(repo veganpolice/adventure-weddings), which is what actually serves
adventureweddings.love. The Astro app was still deploying, but only to
adventure-weddings.pages.dev, and its Supabase project
(piyugutiwimbsfkvfnpc) had already been deleted — the hostname NXDOMAINs.
So the app was live-but-orphaned with no working backend.
Two codebases sharing the name “adventure weddings” also caused repeated
tooling confusion: PR numbers, gh targets, and content paths resolved
against whichever repo a session started in.
Why this part was kept
Everything else in the app was static: 365 of its 509 admin pages were the
generated social-media content planner, and only 3 pages touched Supabase at
all. This ceremony generator was the one piece with real logic, and it was the
newest code in the app — merged 2026-07-03 as PR #6
(651c339), followed by 9f0c969 which fixed the tslib bundling that had been
500ing every SSR route.
What’s here
| Path | Was |
|---|---|
api/generate.ts | src/pages/api/ceremony/generate.ts — questionnaire → Claude → draft |
api/drafts.ts | src/pages/api/ceremony/drafts.ts — save/list/PATCH draft status |
api/responses.ts | src/pages/api/ceremony/responses.ts — questionnaire responses |
lib/ceremony-prompt.ts | src/lib/ceremony-prompt.ts — prompt construction |
admin/ceremony.astro, admin/ceremony-library.astro, admin/ceremony-pages/[id].astro | the admin UI |
supabase/001_initial_schema.sql | the schema, including ceremony_drafts |
Known defects, if this is ever revived
A code review on 2026-08-07 found these. They were never hit in production because the database was already gone.
- Truncated drafts saved as complete (
api/generate.ts). Onlystop_reason === 'refusal'is handled. Amax_tokenscut-off yields a non-empty fragment that passes the empty-draft guard and is stored as a normalstatus: 'draft'version, indistinguishable from a finished one. Checkstop_reason === 'max_tokens'and fail loudly. - Version collisions poison PATCH.
ceremony_draftshas no unique constraint on(client_id, version), and two write paths both do read-max-then-insert. Two rows at version N make the.single()in the PATCH path error, so every later status change on that version 404s permanently with no UI recovery. Addunique (client_id, version). - All DB errors reported as 404 (
api/drafts.ts) — connection and permission failures are collapsed into “Draft version not found”. max_tokens: 16000is a hard cap covering thinking plus output onclaude-sonnet-5. Verify current thinking-default behaviour against the API docs before reusing these numbers.
If reviving this against the live Lovable Supabase
(blksxqiqivuwfvwjzpmi), it needs new schema, auth, and UI work regardless —
the Astro/service-role model here does not carry over.