• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
andiebuk

andiebuk

Leadmagmagic

Public
Like
Leadmagmagic
Home
Code
5
backend
3
frontend
2
shared
1
README.md
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
1
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://andiebuk--b05aa7123a9611f08a999e149126039e.web.val.run
README.md

PDF Lead Magnet Generator

An AI-powered application that analyzes PDF products and generates compelling lead magnets to drive sales.

Features

  • PDF Upload & Analysis: Upload your full product PDF for AI analysis
  • Smart Lead Magnet Generation: AI creates targeted 3-5 page lead magnets based on your content
  • Customizable CTAs: Add your product link for seamless conversion
  • Professional Output: Generate polished lead magnets ready for distribution

How It Works

  1. Upload your product PDF (book, course, guide, etc.)
  2. Provide your product purchase link
  3. AI analyzes your content and identifies key value propositions
  4. Generates a compelling lead magnet with strategic excerpts and insights
  5. Includes strong call-to-action directing to your full product

Tech Stack

  • Backend: Hono.js API with Together AI integration
  • Frontend: React with TypeScript
  • AI: Together AI for content analysis and generation
  • Storage: Val Town Blob for file handling
  • Styling: TailwindCSS

Project Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ index.ts           # Main API server
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ upload.ts      # PDF upload handling
β”‚   β”‚   β”œβ”€β”€ analyze.ts     # AI content analysis
β”‚   β”‚   └── generate.ts    # Lead magnet generation
β”‚   └── utils/
β”‚       β”œβ”€β”€ pdf.ts         # PDF processing utilities
β”‚       └── ai.ts          # Together AI integration
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html         # Main application
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ App.tsx        # Main app component
β”‚   β”‚   β”œβ”€β”€ Upload.tsx     # File upload interface
β”‚   β”‚   β”œβ”€β”€ Analysis.tsx   # Content analysis display
β”‚   β”‚   └── Generator.tsx  # Lead magnet generator
β”‚   └── style.css          # Custom styles
└── shared/
    └── types.ts           # Shared TypeScript types

Environment Variables

  • TOGETHER_API_KEY: Your Together AI API key

Usage

  1. Set your Together AI API key in environment variables
  2. Upload your product PDF (ensure it has selectable text)
  3. Enter your product purchase link
  4. Let AI analyze and generate your lead magnet
  5. Download and distribute your new lead magnet

PDF Requirements

For best results, ensure your PDF:

  • Contains selectable text (test by trying to copy text from the PDF)
  • Is created from text documents (Word, Google Docs, etc.) rather than scanned images
  • Has substantial content (10+ pages recommended)
  • Is under 10MB in size
  • Is not heavily encrypted or password-protected

Troubleshooting

"Could not extract readable text from PDF" Error:

  • Ensure your PDF contains selectable text (not just images)
  • Try copying text from your PDF - if you can't select text, neither can our system
  • Use PDFs created from text documents rather than scanned images
  • Avoid encrypted or password-protected PDFs
HTTP
  • index.ts
    andiebuk--b0…9e.web.val.run
Code
backendfrontendsharedREADME.mdmain.tsx
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.