Public
Like
Leadmagmagic
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.
index.ts
https://andiebuk--b05aa7123a9611f08a999e149126039e.web.val.run
An AI-powered application that analyzes PDF products and generates compelling lead magnets to drive sales.
- 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
- Upload your product PDF (book, course, guide, etc.)
- Provide your product purchase link
- AI analyzes your content and identifies key value propositions
- Generates a compelling lead magnet with strategic excerpts and insights
- Includes strong call-to-action directing to your full product
- 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
βββ 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
TOGETHER_API_KEY
: Your Together AI API key
- Set your Together AI API key in environment variables
- Upload your product PDF (ensure it has selectable text)
- Enter your product purchase link
- Let AI analyze and generate your lead magnet
- Download and distribute your new lead magnet
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
"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