π Product Funnel Wizard β Super Simple UX Integration
One-Click Funnel Generation for Digital Products
π¦ What You Getβ
A complete, production-ready UX that connects:
- Product (your existing digital product)
- FunnelGeneratorModule (AI content generation)
- ContentData (structured funnel data)
- ProductLandingPage (generated landing page)
NO MOCKS β Everything uses real ThorAPI-generated models and services!
π― User Flow (3 Simple Steps)β
1. User picks a Product β Clicks "Generate Funnel"
β
2. Fills simple form:
- Target audience
- Hero benefit
- Price tier
- Delivery mode
β
3. Backend generates:
β
Complete PRD
β
Landing page (6+ sections)
β
Ad variants (TikTok, Instagram, LinkedIn)
β
Email sequence (3-5 emails)
β
4. User reviews β Publishes landing page
ποΈ Architectureβ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (React) β
β - Product detail page β
β - "Generate Funnel" button β
β - Wizard modal (simple form) β
β - Progress indicator β
β - Review/preview screen β
β - Publish button β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β REST API β
β POST /api/v1/product-funnel-wizard/start β
β GET /api/v1/product-funnel-wizard/{id}/status
β POST /api/v1/product-funnel-wizard/{id}/publish
β GET /api/v1/product-funnel-wizard/{id}/preview
ββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β ProductFunnelWizardService (orchestrator) β
β - Coordinates workflow execution β
β - Creates ContentData β
β - Creates ProductLandingPage β
β - Tracks progress β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β FunnelGeneratorModule (AI) β
β - Calls GPT-4o β
β - Generates PRD + content β
βββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β ThorAPI-Generated Services β
β - ProductRepository β
β - ContentDataRepository β
β - ProductLandingPageRepository β
β - ProductFunnelWizardRepository β
βββββββββββββββββββββββββββββββββββββββββββββββ
π Step-by-Step Setupβ
1. Run ThorAPI Codegenβ
cd /Users/johnmcmahon/workspace/2025/valkyr/ValkyrAI
# Generate all models, repositories, services, controllers
mvn clean install -DskipTests
# This creates:
# β
ProductFunnelWizard (entity, repo, service)
# β
ContentData (entity, repo, service)
# β
ProductLandingPage (entity, repo, service)
# β
WizardStartResponse, WizardStatusResponse (DTOs)
# β
ProductFunnelWizard (DTO)
# β
REST controllers with all CRUD endpoints
2. Start Backendβ
# Start ValkyrAI server
./valkyrai/target/valkyrai-1.0.1-SNAPSHOT.jar
# Or via Maven
mvn -pl valkyrai spring-boot:run
3. Test APIβ
# Example: Generate funnel for a product
curl -X POST http://localhost:8080/api/v1/product-funnel-wizard/start \
-H "Content-Type: application/json" \
-d '{
"productId": "your-product-uuid",
"brand": "Valkyr Labs",
"targetAudience": "developers, founders",
"priceTier": "core",
"priceAmount": 299.0,
"deliveryMode": "course",
"heroBenefit": "Master AI workflows in 14 days"
}'
# Response:
# {
# "wizardId": "uuid-...",
# "workflowId": "uuid-...",
# "status": "generating",
# "estimatedSeconds": 45
# }
# Poll for status
curl http://localhost:8080/api/v1/product-funnel-wizard/{wizardId}/status
# Publish when ready
curl -X POST http://localhost:8080/api/v1/product-funnel-wizard/{wizardId}/publish
π¨ Frontend Integration (React)β
Simple Button on Product Pageβ
// web/src/components/ProductDetail.tsx
import { useState } from "react";
import { FunnelWizardModal } from "./FunnelWizardModal";
export const ProductDetail = ({ product }) => {
const [showWizard, setShowWizard] = useState(false);
return (
<div>
<h1>{product.name}</h1>
<p>{product.description}</p>
{/* Magic button! */}
<button onClick={() => setShowWizard(true)} className="btn-primary">
β¨ Generate Funnel with AI
</button>
{showWizard && (
<FunnelWizardModal
product={product}
onClose={() => setShowWizard(false)}
/>
)}
</div>
);
};
Wizard Modal Componentβ
// web/src/components/FunnelWizardModal.tsx
import { useState } from "react";
import {
useStartWizardMutation,
useGetWizardStatusQuery,
} from "../api/ProductFunnelWizardService";
export const FunnelWizardModal = ({ product, onClose }) => {
const [wizardId, setWizardId] = useState(null);
const [formData, setFormData] = useState({
brand: "Valkyr Labs",
targetAudience: "",
priceTier: "core",
deliveryMode: "course",
heroBenefit: "",
});
const [startWizard, { isLoading }] = useStartWizardMutation();
const { data: status } = useGetWizardStatusQuery(wizardId, {
skip: !wizardId,
pollingInterval: 2000, // Poll every 2 seconds
});
const handleSubmit = async (e) => {
e.preventDefault();
const result = await startWizard({
productId: product.id,
...formData,
}).unwrap();
setWizardId(result.wizardId);
};
// Step 1: Form
if (!wizardId) {
return (
<div className="modal">
<h2>Generate Funnel for {product.name}</h2>
<form onSubmit={handleSubmit}>
<label>
Brand Name:
<input
value={formData.brand}
onChange={(e) =>
setFormData({ ...formData, brand: e.target.value })
}
required
/>
</label>
<label>
Target Audience:
<input
placeholder="e.g. developers, founders, solopreneurs"
value={formData.targetAudience}
onChange={(e) =>
setFormData({ ...formData, targetAudience: e.target.value })
}
required
/>
</label>
<label>
Price Tier:
<select
value={formData.priceTier}
onChange={(e) =>
setFormData({ ...formData, priceTier: e.target.value })
}
>
<option value="free">Free</option>
<option value="tripwire">Tripwire ($49)</option>
<option value="core">Core ($299-$999)</option>
<option value="high_ticket">High Ticket ($10K+)</option>
</select>
</label>
<label>
Delivery Mode:
<select
value={formData.deliveryMode}
onChange={(e) =>
setFormData({ ...formData, deliveryMode: e.target.value })
}
>
<option value="course">Course</option>
<option value="challenge">Challenge</option>
<option value="mentorship">Mentorship</option>
<option value="consulting">Consulting</option>
<option value="saas">SaaS</option>
</select>
</label>
<label>
Hero Benefit (Main Promise):
<textarea
placeholder="e.g. Master AI workflows in 14 days"
value={formData.heroBenefit}
onChange={(e) =>
setFormData({ ...formData, heroBenefit: e.target.value })
}
required
/>
</label>
<button type="submit" disabled={isLoading}>
{isLoading ? "Starting..." : "β¨ Generate Funnel"}
</button>
<button type="button" onClick={onClose}>
Cancel
</button>
</form>
</div>
);
}
// Step 2: Progress
if (status?.status === "generating") {
return (
<div className="modal">
<h2>Generating Your Funnel... β¨</h2>
<div className="progress-bar">
<div style={{ width: `${status.progress}%` }} />
</div>
<p>{status.currentStep}</p>
<p>{status.progress}% complete</p>
</div>
);
}
// Step 3: Review
if (status?.status === "review") {
return (
<div className="modal">
<h2>β
Funnel Generated!</h2>
<div className="results">
<h3>Generated Assets:</h3>
<ul>
<li>β
Complete PRD</li>
<li>
β
Landing Page ({status.generatedAssets.landingPageSectionsCount}{" "}
sections)
</li>
<li>
β
Ad Variants ({status.generatedAssets.adVariantsCount}{" "}
platforms)
</li>
<li>
β
Email Sequence ({status.generatedAssets.emailSequenceCount}{" "}
emails)
</li>
</ul>
</div>
<div className="actions">
<a href={`/preview/${wizardId}`} target="_blank">
ποΈ Preview Landing Page
</a>
<button onClick={() => handlePublish(wizardId)}>
π Publish Now
</button>
<button onClick={onClose}>Close</button>
</div>
</div>
);
}
// Step 4: Published
if (status?.status === "published") {
return (
<div className="modal">
<h2>π Funnel Published!</h2>
<p>Your landing page is now live:</p>
<a href={status.landingPageUrl} target="_blank">
{status.landingPageUrl}
</a>
<button onClick={onClose}>Close</button>
</div>
);
}
return null;
};
π― What Makes This EASYβ
1. One Button β That's it!β
<button>β¨ Generate Funnel with AI</button>
2. Simple Form β 5 fields, no complexityβ
- Target audience (text)
- Hero benefit (text)
- Price tier (dropdown)
- Delivery mode (dropdown)
- Brand name (pre-filled)
3. Auto-Generated Everythingβ
- ThorAPI generates all models, repos, services, controllers
- No manual DTO mapping
- No manual database setup
- Just run
mvn clean install
4. Real-Time Progressβ
// Poll every 2 seconds
useGetWizardStatusQuery(wizardId, { pollingInterval: 2000 });
5. Preview Before Publishingβ
GET /api/v1/product-funnel-wizard/{wizardId}/preview
β Returns HTML preview
π Database Schema (Auto-Created)β
ThorAPI generates these tables:
-- Core entities
CREATE TABLE product_funnel_wizard (
id UUID PRIMARY KEY,
product_id UUID NOT NULL,
brand VARCHAR(255),
target_audience VARCHAR(500),
price_tier VARCHAR(50),
delivery_mode VARCHAR(50),
hero_benefit VARCHAR(1000),
wizard_status VARCHAR(50),
generated_content_data_id UUID,
generated_landing_page_id UUID,
workflow_id UUID,
created_at TIMESTAMP,
updated_at TIMESTAMP,
completed_at TIMESTAMP
);
CREATE TABLE content_data (
id UUID PRIMARY KEY,
content_type VARCHAR(50),
title VARCHAR(500),
slug VARCHAR(255) UNIQUE,
brand VARCHAR(255),
target_audience VARCHAR(500),
price_tier VARCHAR(50),
delivery_mode VARCHAR(50),
hero_benefit VARCHAR(1000),
problem_statement TEXT,
promise_statement TEXT,
offer_structure JSONB,
funnel_stages JSONB,
landing_page_sections JSONB,
ad_variants JSONB,
email_sequence JSONB,
status VARCHAR(50),
created_at TIMESTAMP,
updated_at TIMESTAMP
);
CREATE TABLE product_landing_page (
id UUID PRIMARY KEY,
product_id UUID NOT NULL,
template_id VARCHAR(50),
slug VARCHAR(255) UNIQUE,
seo_title VARCHAR(255),
seo_description VARCHAR(1000),
config JSONB,
is_published BOOLEAN DEFAULT FALSE,
published_at TIMESTAMP
);
π Quick Start Commandsβ
# 1. Build everything
cd /Users/johnmcmahon/workspace/2025/valkyr/ValkyrAI
mvn clean install -DskipTests
# 2. Start backend
java -jar valkyrai/target/valkyrai-1.0.1-SNAPSHOT.jar
# 3. Test API
curl -X POST http://localhost:8080/api/v1/product-funnel-wizard/start \
-H "Content-Type: application/json" \
-d '{
"productId": "test-uuid",
"brand": "Valkyr Labs",
"targetAudience": "developers",
"priceTier": "core",
"deliveryMode": "course",
"heroBenefit": "Master AI in 14 days"
}'
# 4. Open frontend
cd web
npm run dev
# Navigate to product page β Click "Generate Funnel"
π Files Createdβ
OpenAPI Schemas (ThorAPI will generate code from these)β
contentdata.yamlβ ContentData, FunnelStage, LandingPageSection, etc.product-funnel-wizard-api.yamlβ REST API endpointsdigital-products-pro.yamlβ ProductLandingPage, etc.
Backend Services (Hand-written)β
ProductFunnelWizardService.javaβ Orchestration logicProductFunnelWizardController.javaβ REST endpointsFunnelGeneratorModule.javaβ AI content generation
Frontend Components (To be created)β
FunnelWizardModal.tsxβ Main wizard UIProductDetail.tsxβ Add "Generate Funnel" button
π Summaryβ
You now have:
- β One-click funnel generation (just a button!)
- β Real ThorAPI models (no mocks, all generated)
- β Simple 5-field form (audience, benefit, price, delivery, brand)
- β Real-time progress (polling status endpoint)
- β Preview + publish flow (review before going live)
- β AI-powered content (GPT-4o generates everything)
Next steps:
- Run
mvn clean installto generate models/services - Add "Generate Funnel" button to your Product page
- Create
FunnelWizardModalReact component - Test the flow end-to-end
That's it! π