Cloudflare Audiobook Distribution - Quick Start
📁 Infrastructure Created
infrastructure/
├── AUDIOBOOK_DISTRIBUTION.md # Architecture overview
└── audiobook-worker/
├── index.ts # Worker code (TypeScript)
├── wrangler.jsonc # Cloudflare config
├── schema.sql # D1 database schema
├── deploy.sh # One-command deployment
├── upload.sh # Upload audiobooks to R2
└── public/
└── index.html # Landing page
🚀 Deploy Now
cd ~/Nosos/inverter_cycle/infrastructure/audiobook-worker
# 1. Deploy infrastructure
./deploy.sh
# 2. Upload audiobook files
./upload.sh
# 3. Test
open https://audio.kbird.ai
📋 What Gets Created
| Component | Purpose | Cost |
|---|
| R2 Buckets | Store MP3 files (~4GB) | Free (10GB) |
| Worker | Serve files + analytics | Free (100K/day) |
| D1 Database | Download tracking | Free (500K rows) |
| Custom Domain | audio.kbird.ai | Included |
🎧 Endpoints
| URL | Description |
|---|
https://audio.kbird.ai | Landing page with players |
https://audio.kbird.ai/audio/wildflower/*.mp3 | WILDFLOWER files |
https://audio.kbird.ai/audio/tally/*.mp3 | TALLY files |
https://audio.kbird.ai/api/books | JSON metadata |
https://audio.kbird.ai/api/stats | Download stats |
✨ Features
- Streaming: Range request support (scrub/seek)
- Formats: Hybrid, Cinematic, Immersive
- Analytics: Track downloads per chapter
- CORS: Embeddable in any player
- Cache: 1 year CDN caching
- Global: 300+ Cloudflare edge locations
📊 Stats Dashboard
Access download analytics:
curl https://audio.kbird.ai/api/stats
🔮 Future Enhancements
💰 Cost Projection
| Scenario | Monthly Cost |
|---|
| Current usage (~4GB) | FREE |
| 10x growth (40GB) | ~$0.45 |
| 100x growth (400GB) | ~$6.00 |
Ready to deploy? Run ./deploy.sh and your audiobooks will be live! 🎙️