Skip to content

cycle-sync-ai/lead-magnet

Repository files navigation

AI-Driven Lead Magnet Generator

🚀 Setup Instructions

Environment Variables

Create a .env.local file in the root directory with the following variables:

# Database
DATABASE_URL="postgresql://username:password@localhost:5432/lead_magnet_db"

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key

# OpenAI API
OPENAI_API_KEY=your_openai_api_key

# Next.js
NEXTAUTH_SECRET=your_nextauth_secret
NEXTAUTH_URL=http://localhost:3000

Installation

  1. Install dependencies:
npm install
  1. Set up the database:
npx prisma generate
npx prisma db push
  1. Start the development server:
npm run dev

🤖 AI-Powered Magnet Generation

This application uses OpenAI's GPT-4 to generate interactive calculators and forms from natural language prompts. Admins can describe what they want, and the AI will create a fully functional magnet with:

  • Dynamic form fields (numbers, text, selects, checkboxes, sliders)
  • Calculation logic
  • Custom styling
  • Lead capture functionality

Example Prompts

  • "Create a mortgage calculator with loan amount, interest rate, and term fields"
  • "Build a BMI calculator that takes height and weight"
  • "Make a ROI calculator for marketing campaigns"
  • "Create a quiz to determine personality type"

📁 Project Structure

  • /admin/create-magnet - AI magnet generator interface
  • /magnet/[id] - Public magnet usage page
  • /api/ai/generate-magnet - OpenAI integration
  • /api/templates - Magnet management
  • /api/leads - Lead capture and analytics

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors