Generate and listen to personalized AI-powered podcasts on any topic to accelerate your learning.
A production-ready web application that creates personalized 8-12 minute educational podcasts on any topic. Built with Next.js, ElevenLabs, and Supabase.
- Any Topic Input: Enter any subject you want to learn about - tech, science, history, arts, etc.
- Personalized Content: Tailor to your familiarity level (New/Some/Expert)
- Context Focus: Optional targeting for specific areas or applications
- Smart Script Generation: Uses OpenAI GPT-4 to create structured, educational content
- High-Quality TTS: ElevenLabs voices for natural-sounding audio
- Download & Share: Export MP3 audio and text transcripts
Each podcast includes:
- Overview: 60-90 second intro tailored to familiarity level
- Key Concepts: 3-5 fundamental ideas with clear explanations
- Applications & Examples: Real-world uses and case studies
- Challenges & Considerations: Limitations, debates, and complexities
- Learning Path: Next steps and recommended resources
- Summary & Takeaways: Key points to remember
- Glossary: Important terms (for non-experts)
- Sources: Research links and references
- Progressive Flow: Topic β Script Preview β Audio Generation
- Saved Episodes: Automatic persistence of last 5 episodes
- Playback Controls: Speed adjustment, seeking, download
- Responsive Design: Works on desktop and mobile
- Real-time Feedback: Loading states and progress indicators
- Frontend: Next.js 14, React, TypeScript, Tailwind CSS
- Backend: Next.js API Routes, OpenAI GPT-4
- Audio: ElevenLabs Text-to-Speech API
- Database: Supabase (PostgreSQL)
- State Management: Zustand
- Deployment: Vercel-ready
- UI: Heroicons, React Hot Toast
- Node.js 18+ and npm/yarn
- OpenAI API key
- ElevenLabs API key
- Supabase project
-
Clone and install dependencies:
git clone <your-repo> cd commercialize-cast npm install
-
Set up environment variables:
cp .env.local.example .env.local
Fill in your API keys:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_service_role_key ELEVENLABS_API_KEY=your_elevenlabs_key OPENAI_API_KEY=your_openai_key
-
Set up the database:
- Create a new Supabase project
- Run the SQL schema from
supabase/schema.sql - Enable Row Level Security
-
Start development server:
npm run dev
-
Open in browser: http://localhost:3000
src/
βββ app/ # Next.js 13+ app directory
β βββ api/ # API routes
β β βββ generate-script/
β β βββ generate-audio/
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
βββ components/ # React components
β βββ TopicInput.tsx # Input form
β βββ ScriptPreview.tsx # Script display
β βββ AudioPlayer.tsx # Audio playback
β βββ Library.tsx # Library (saved episodes)
β βββ LoadingState.tsx # Loading indicators
βββ lib/ # Core services
β βββ supabase.ts # Database client
β βββ elevenlabs.ts # TTS service
β βββ script-generation.ts # OpenAI integration
β βββ store.ts # Zustand state
βββ types/ # TypeScript definitions
βββ utils/ # Helper functions
- Model: GPT-4 Turbo (recommended for best results)
- System prompt includes safety guidelines and content structure
- Temperature: 0.7 for creative but consistent output
- Default voices: Adam (CHRIS) and Bella (JESSICA)
- Voice settings optimized for podcast-style speech
- Configurable in
src/lib/elevenlabs.ts
- Row Level Security enabled
- Automatic episode saving (optional)
- JSON storage for flexible script structure
- No medical advice: Focuses on educational content, not health claims
- No financial advice: Discusses concepts, not investment advice
- Realistic framing: Acknowledges limitations and uncertainties honestly
- Educational focus: Targets learning and understanding primarily
- Balanced perspective: Covers both opportunities and challenges
- Specific examples: Includes real-world applications
- Actionable insights: Provides concrete next steps
- Source attribution: Links to research and references
npm run build
vercel --prod- Set all environment variables in Vercel dashboard
- Ensure Supabase URLs are production endpoints
- Use production API keys for OpenAI and ElevenLabs
- Import schema to production Supabase instance
- Configure Row Level Security policies
- Test database connectivity
// Request
{
topic: string;
familiarity: 'new' | 'some' | 'expert';
industries: Industry[];
useCase?: string;
}
// Response
PodcastScript// Request
{
scriptId: string;
}
// Response
AudioGeneration- API routes validate input parameters
- Rate limiting recommended for production
- Supabase RLS protects user data
- Environment variables secured
- Content filtering for inappropriate topics
- Tailwind CSS with custom color palette
- Responsive design utilities
- Dark mode ready (extend as needed)
- Modify
DEFAULT_VOICESinsrc/lib/elevenlabs.ts - Add more hosts or voice variety
- Adjust voice settings for different styles
- Update system prompt in
src/lib/script-generation.ts - Modify podcast sections and timing
- Add custom industry knowledge
- API Key Errors: Verify all environment variables
- Audio Generation Fails: Check ElevenLabs quota and voice IDs
- Database Errors: Ensure Supabase RLS policies are correct
- Build Errors: Check TypeScript types and imports
# Enable detailed logging
export DEBUG=commercialize-cast:*
npm run dev- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure TypeScript types are correct
- Submit a pull request
MIT License - see LICENSE file for details
- OpenAI for GPT-4 API
- ElevenLabs for high-quality TTS
- Supabase for backend infrastructure
- Vercel for hosting platform
- Tailwind CSS for styling system
Built for AI-powered learning experiences π