Draft-my-Velocity
The flagship acquisition feature. A short 3-step form generates an AI-written, branded Velocity draft for the visitor’s business and emails them a live link within 5 minutes.
Hybrid delivery: an instant dynamic preview now, with a real Netlify build triggered later only when they show interest.
Live page: /draft · demo: /components/draft-my-velocity
form → /.netlify/functions/draft-create → AI/template copy → Supabase row → /draft/preview?id=<id>The lead enters at status='preview'; “I want this” on the preview flips them to interested (the real-build trigger hook).
| File | Role |
|---|---|
src/components/growth/DraftMyVelocity.tsx | 3-step form (name+email / industry+one-liner / logo+colour). Fires draft_requested + trackLead. |
src/pages/draft.astro | Landing page. |
src/lib/draft-generate.ts | generateDraft() → Anthropic claude-opus-4-8 (key from ANTHROPIC_API_KEY), deterministic template fallback (never hard-fails). Returns a brand.json-shaped brand + copy. |
netlify/functions/draft-create.mjs | Validate → generate → insert velocity_drafts → return previewUrl. Email + real-build are stubbed (TODO(creds)). |
src/components/growth/DraftPreview.tsx + src/pages/draft/preview.astro | ?id=-driven per-lead preview (noindex). |
Go-live (owner action)
Section titled “Go-live (owner action)”- Create the Supabase
velocity_draftstable + RLS. - Set env:
ANTHROPIC_API_KEY,RESEND_API_KEY,NETLIFY_BUILD_HOOK_URL,SUPABASE_SERVICE_ROLE_KEY,SITE_URL. - Wire
draftReadyintodraft-create.mjs(replace the email stub) and add Supabase Storage for real logo uploads. - For true SSR previews at
/draft/<id>, add@astrojs/netlify+output: 'server'.
See TODO.md at the repo root for the full checklist. Pairs with the nurture email sequence for abandoned-draft follow-up.