Case Study · Personal / Full Stack

AI Sales Craft: a dual-LLM sales page generator

The Stack

Next.jsTypeScriptTailwindExpress.jsPostgreSQL (Neon)Groq (Llama 3.3 70B)Gemini
warning

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.

lightbulb

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.

Groq APIarrow_forwardFailure Detectedarrow_forwardGemini Fallback
AI Sales Craft: generated sales page rendered in one of three templates

Key Features

  • schema
    Schema-first generationThe LLM returns validated JSON, so output renders predictably across templates instead of dumping markdown.
  • sync_alt
    Automatic provider fallbackGroq → Gemini failover with a shared output contract, no user-visible difference.
  • history
    Generation historyJWT-authenticated CRUD with search and pagination over past generations.
school

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.