This is a Next.js project bootstrapped with create-next-app.
A powerful web application for transcribing audio files using OpenAI's Whisper API, with credit-based billing and subscription management.
- 🎙️ Audio transcription using OpenAI Whisper
- 💳 Credit-based billing system
- 📦 Vercel Blob storage for audio files
- 🔐 Authentication with Google OAuth
- 💰 Stripe integration for payments
- 📊 User dashboard with transcription history
- ⚡ Real-time transcription processing
- Node.js 18+ or Bun
- PostgreSQL database (e.g., Neon, Supabase)
- AWS account with S3 bucket
- OpenAI API key
- Stripe account
- Google OAuth credentials
This application uses Amazon S3 (or S3-compatible services) for storing audio files.
Follow the comprehensive guide in docs/S3_SETUP.md for:
- Creating an S3 bucket
- Configuring IAM permissions
- Setting up security best practices
- Cost optimization strategies
- Alternative S3-compatible services (Cloudflare R2, DigitalOcean Spaces, etc.)
See docs/ENVIRONMENT_VARIABLES.md for a complete list of required environment variables.
Quick setup - create a .env.local file with:
# Database
DATABASE_URL=your_database_url
# Authentication
BETTER_AUTH_SECRET=your_secret_key
BETTER_AUTH_URL=http://localhost:3000
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
# Stripe
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_webhook_secret
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_publishable_key
# OpenAI
OPENAI_API_KEY=your_openai_api_key
# AWS S3
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_access_key_id
AWS_SECRET_ACCESS_KEY=your_secret_access_key
AWS_S3_BUCKET_NAME=your-bucket-name
# App
NEXT_PUBLIC_URL=http://localhost:3000npm install
# or
bun installnpm run db:pushnpm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
app/
├── (auth)/ # Authentication pages
├── api/ # API routes
│ ├── transcriptions/ # Transcription endpoints
│ ├── credits/ # Credit management
│ └── billing/ # Stripe billing
├── dashboard/ # User dashboard
└── page.tsx # Landing page
lib/
├── storage/ # S3 storage utilities
├── transcription/ # Transcription processing
├── credits/ # Credit system
└── billing/ # Stripe integration
components/
├── ui/ # UI components
└── sections/ # Landing page sections
- Supports multiple audio formats (MP3, M4A, WAV, WEBM, FLAC, OGG, MP4)
- Maximum file size: 25MB
- Automatic credit deduction based on duration
- Real-time processing status
- Pay-as-you-go pricing: 1 credit per minute
- Credit packages available
- Automatic refunds for failed transcriptions
- Free: 10 credits/month
- Pro: Unlimited credits + multiple file uploads
POST /api/transcriptions/upload- Upload audio filesGET /api/transcriptions- List user's transcriptionsGET /api/transcriptions/[id]- Get specific transcriptionPOST /api/transcriptions/process- Process transcription (internal)GET /api/credits/balance- Get credit balancePOST /api/credits/checkout- Purchase credits
npm run db:push # Push schema changes
npm run db:studio # Open Drizzle Studio# Test AWS credentials
aws s3 ls s3://your-bucket-name/
# Upload test file
aws s3 cp test.mp3 s3://your-bucket-name/test/If you're migrating from Vercel Blob:
- Set up S3 - Follow
docs/S3_SETUP.md - Update environment variables - Remove
BLOB_READ_WRITE_TOKEN, add AWS variables - Install dependencies - Run
npm install(AWS SDK is already in package.json) - Deploy - The code is already updated to use S3
The migration is complete! All new uploads will use S3. Existing files in Vercel Blob will remain accessible via their URLs.
Set these in your hosting provider:
- All variables from
.env.local - Use production values for Stripe, OpenAI, etc.
- Vercel - Zero-config deployment
- Railway - Easy environment management
- AWS Amplify - Native AWS integration
- Fly.io - Global edge deployment
- ✅ Database migrations applied
- ✅ S3 bucket configured and accessible
- ✅ Stripe webhooks configured
- ✅ OpenAI API key has credits
- ✅ OAuth redirect URLs updated
- ✅ Environment variables set
See docs/ENVIRONMENT_VARIABLES.md for common issues and solutions.
- Framework: Next.js 15
- Database: PostgreSQL + Drizzle ORM
- Authentication: Better Auth
- Payments: Stripe
- Storage: Amazon S3
- AI: OpenAI Whisper
- Styling: Tailwind CSS
- UI Components: Radix UI