AI Sales Craft: a dual-LLM sales page generator
The Stack
The Problem
Turning raw product details (name, features, audience, pricing, USP) into a structured, persuasive sales page is slow manual work. I wanted a generator that produces consistent, structured output (not free-form LLM text) that can render across multiple visual templates.
The Approach
The backend prompts the LLM to return strict JSON matching a defined schema, then validates it before storing. Groq (Llama 3.3 70B) is the primary engine for speed; when Groq is unavailable or errors, the request automatically falls back to Gemini with the same schema contract. The frontend maps the structured output onto three distinct templates (Modern, Minimal, and Bold) from a single generation.

Key Features
- schemaSchema-first generationThe LLM returns validated JSON, so output renders predictably across templates instead of dumping markdown.
- sync_altAutomatic provider fallbackGroq → Gemini failover with a shared output contract, no user-visible difference.
- historyGeneration historyJWT-authenticated CRUD with search and pagination over past generations.
What I Learned
This project started on Laravel 11 + MySQL. When I moved deployment to Vercel, I rewrote the backend in Express + TypeScript with PostgreSQL on Neon, a full rewrite that taught me more about the two ecosystems than either version alone. The fallback mechanism came from real pain: free-tier LLM APIs fail often, and handling that gracefully matters more than the happy path.