Configurable quiz funnel engine with conditional branching, multi-axis scoring, personalized results, and email capture. Built for conversion.
React 19 + TypeScript Β· Conditional Branching Β· 40%+ Lead Conversion Β· PDF Reports
- Configurable Questions β Define questions, options, and flow via config files
- Conditional Branching β Show/skip questions based on previous answers
- Multi-Axis Scoring β 4-axis assessment engine (Phase, Severity, Impact, Readiness)
- 5 Result Personas β Personalized results mapped to severity brackets
- Personalized Email Reports β HTML email with results, modules, and next steps
- Email / Lead Capture β Gated results with consent-aware lead collection
- Mobile-First Design β Touch-optimized, 48px targets, iOS zoom prevention
- GA4 + Meta Pixel Ready β Pre-built event tracking for full funnel analytics
- A/B Testing β Built-in variant support via URL parameter (
?variant=b) - Exit Intent Modal β Re-engagement for desktop users about to leave
- Framer Motion Animations β Smooth page transitions and micro-interactions
flowchart LR
A[Landing Page] --> B[Q1: Multi-Select]
B --> C[Q2: Severity Slider]
C --> D{2+ selected?}
D -->|Yes| E[Q3: Severity 2]
D -->|No| F[Interstitial 1]
E --> F
F --> G[Q5-Q7b: Profile]
G --> H[Interstitial 2]
H --> I[Q8-Q9: Goals]
I --> J[Email Gate]
J --> K[Loading Screen]
K --> L[Result Page]
L --> M[Thank You + CTA]
subgraph Scoring Engine
S1[Phase Score] --> SR[Result Router]
S2[Severity Score] --> SR
S3[Impact Index] --> SR
S4[Readiness Score] --> SR
SR --> P[Persona Match]
end
J -.->|Webhook + Email| N[CRM / Resend API]
# Clone the repository
git clone https://github.com/your-username/growth-quiz-engine.git
cd growth-quiz-engine
# Install dependencies
npm install
# Start development server
npm run devOpen http://localhost:5173 to see the quiz.
growth-quiz-engine/
βββ src/
β βββ lib/ # Business logic & configuration
β β βββ constants.ts # Brand config, quiz timing, A/B titles
β β βββ questions.ts # Question definitions (9 questions)
β β βββ scoring.ts # Multi-axis scoring engine
β β βββ results.ts # Result type configs (5 personas)
β β βββ analytics.ts # GA4 + Meta Pixel event tracking
β β βββ webhook.ts # CRM webhook + email API
β βββ types/ # TypeScript type definitions
β βββ context/ # React Context (quiz state management)
β βββ pages/ # Screen components (18 screens)
β β βββ hero/ # Landing page sections
β β βββ Q1Concerns.tsx # Multi-select concerns
β β βββ Q2Severity1.tsx # Severity slider + frequency
β β βββ ResultScreen.tsx # Personalized result page
β β βββ ...
β βββ components/
β β βββ ui/ # shadcn/ui components
β β βββ quiz/ # Quiz-specific components
β β βββ layout/ # Layout components
β βββ hooks/ # Custom React hooks
β βββ router/ # Screen routing logic
βββ api/
β βββ send-email.ts # Vercel serverless email function
βββ config/ # Example configuration files
β βββ questions.json # Question definitions
β βββ scoring.json # Scoring rules
β βββ personas.json # Result type configurations
βββ docs/
β βββ customization.md # Detailed customization guide
βββ public/ # Static assets
βββ package.json
Edit src/lib/questions.ts to modify questions, options, and flow:
export const QUESTIONS: QuestionConfig[] = [
{
id: 'primaryConcerns',
screenId: 'q1-concerns',
question: 'Which areas affect you the most?',
type: 'multi',
options: [
{ id: 'energy-fatigue', label: 'Energy & Fatigue', icon: 'Zap', emoji: 'β‘' },
// ... add your own options
],
},
// ... add more questions
]Edit src/lib/scoring.ts to modify the 4-axis scoring engine:
- Phase Score (0-10) β Based on age + lifecycle phase
- Severity Score (0-44) β Weighted concern severity with frequency multipliers
- Impact Index β Raw average of severity sliders (low/medium/high)
- Readiness Score (0-14) β Assessment status + action readiness + current approach
Edit src/lib/results.ts to customize the 5 result types:
export const RESULT_TYPES: Record<ResultType, ResultTypeConfig> = {
'mild-concerns': {
headline: 'Mild Concerns Detected',
subtitle: 'Your body is sending early signals...',
actionModules: [
{ moduleRange: 'Module 1-3', title: 'Foundations', ... },
],
},
// ...
}Edit src/lib/constants.ts to change brand name, colors, and links:
export const BRAND = {
name: 'YourBrand',
company: 'Your Company',
tagline: 'Your tagline here.',
// ...
}Colors are configured in tailwind.config.js and src/index.css.
See docs/customization.md for the full customization guide.
- Push to GitHub
- Import in Vercel
- Set environment variables:
RESEND_API_KEYβ For email sending (resend.com)VITE_WEBHOOK_URLβ (Optional) CRM webhook endpoint
npm run build
# Deploy the `dist/` folder to any static hostNote: The email API (
/api/send-email) requires a serverless runtime (Vercel, Netlify Functions, etc.)
| Variable | Required | Description |
|---|---|---|
RESEND_API_KEY |
For emails | Resend API key for sending result emails |
VITE_WEBHOOK_URL |
Optional | CRM webhook endpoint for lead data |
Copy .env.example to .env and fill in your values.
| Technology | Purpose |
|---|---|
| React 19 | UI framework |
| TypeScript 5.9 | Type safety |
| Vite 7 | Build tool |
| Tailwind CSS 3.4 | Styling |
| Framer Motion 12 | Animations |
| Radix UI | Accessible primitives |
| Resend | Email delivery |
| Zod 4 | Schema validation |
| Vercel | Hosting + serverless |
See CONTRIBUTING.md for guidelines.
MIT β Dominik Tsatskin