- Multi-provider TTS service (OpenAI, Piper, macOS say) - Supabase Storage integration for audio files - RSS 2.0 feed with iTunes extensions for podcast distribution - Web audio player at /podcast page - Integration with daily digest workflow - Manual TTS generation script - Complete documentation in PODCAST_SETUP.md
2.8 KiB
2.8 KiB
Podcast Architecture & Implementation Plan
Overview
Convert Daily Digest blog posts into a podcast format with automated TTS generation, RSS feed for distribution, and Supabase Storage for audio file hosting.
Architecture
1. Database Schema Updates
Add audio_url and audio_duration fields to the blog_messages table.
2. TTS Generation
Option A: Piper TTS (Recommended - Free)
- Local execution, no API costs
- High quality neural voices
- Fast processing
- No rate limits
Option B: OpenAI TTS (Paid)
- Premium quality voices
- Simple API integration
- ~$2-4/month for daily 5-min content
3. Audio Storage
- Provider: Supabase Storage
- Bucket:
podcast-audio - Cost: Free tier includes 1GB storage
- Access: Public read via signed URLs
4. RSS Feed Generation
- Endpoint:
/api/podcast/rss - Format: RSS 2.0 with iTunes extensions
- Compatible with: Apple Podcasts, Spotify, Google Podcasts
- Auto-updates: Pulls from blog_messages table
5. Integration Points
-
Daily Digest Workflow (
/api/digestPOST):- After saving post, trigger async TTS generation
- Upload audio to Supabase Storage
- Update database with audio_url
-
RSS Feed (
/api/podcast/rss):- Returns XML RSS feed
- Includes all posts with audio_url
-
Podcast Page (
/podcast):- Web player for each episode
- Subscribe links
- Episode list
Implementation Steps
Phase 1: Database & Storage Setup
- Create
podcast-audiobucket in Supabase - Add columns to blog_messages table
Phase 2: TTS Service
- Create
src/lib/tts.ts- TTS abstraction - Create
src/lib/storage.ts- Supabase storage helpers - Create
src/scripts/generate-tts.ts- TTS generation script
Phase 3: API Endpoints
- Create
src/app/api/podcast/rss/route.ts- RSS feed - Update
src/app/api/digest/route.ts- Add TTS trigger
Phase 4: UI
- Create
src/app/podcast/page.tsx- Podcast page - Update post display to show audio player
Phase 5: Documentation
- Create
PODCAST_SETUP.md- Setup instructions - Update README with podcast features
Cost Estimate
- Piper TTS: $0 (local processing)
- OpenAI TTS: ~$2-4/month
- Supabase Storage: $0 (within free tier 1GB)
- RSS Hosting: $0 (generated by Next.js API)
- Total: $0 (Piper) or $2-4/month (OpenAI)
File Structure
src/
├── app/
│ ├── api/
│ │ ├── digest/route.ts (updated)
│ │ └── podcast/
│ │ └── rss/route.ts (new)
│ ├── podcast/
│ │ └── page.tsx (new)
│ └── page.tsx (updated - add audio player)
├── lib/
│ ├── tts.ts (new)
│ ├── storage.ts (new)
│ └── podcast.ts (new)
└── scripts/
└── generate-tts.ts (new)