A simplified AI avatar video generation platform that creates talking head videos using HeyGen's built-in avatars and voices.
Phase 1 focuses on a streamlined video generation experience:
- Built-in Avatars: Choose from HeyGen's professional AI avatars
- Built-in Voices: Select from multilingual voices with emotion support
- Script-to-Video: Simply write a script and generate professional videos
- Real-time Updates: Live status updates via Supabase realtime
- Responsive Design: Works on desktop, tablet, and mobile
- Node.js 18+
- npm/yarn/pnpm
- Supabase project
- HeyGen API key
-
Clone and install dependencies:
git clone <your-repo> cd avatars npm install
-
Set up environment variables:
cp docs/environment-setup.md .env.local # Edit .env.local with your actual values
-
Set up the database:
- Run the SQL from
scripts/phase1-migration.sql
in your Supabase SQL editor
- Run the SQL from
-
Start the development server:
npm run dev
- Frontend: Next.js 15, React 19, Tailwind CSS
- Backend: Next.js API Routes, Supabase
- Database: PostgreSQL (Supabase)
- AI Services: HeyGen (avatars, voices, video generation)
- Deployment: Vercel
- Authentication: Supabase Auth with Google OAuth
- Real-time Updates: Supabase Realtime subscriptions
- Webhook Handling: HeyGen webhook processing
- Row Level Security: Secure data access
GET /api/heygen/avatars
- List built-in avatarsGET /api/heygen/voices
- List built-in voicesPOST /api/video/generate
- Generate video with scriptPOST /api/heygen/webhook
- Handle video completion
- Sign In: Use Google OAuth to authenticate
- Create Video:
- Choose an avatar from the gallery
- Select a voice with desired language/emotion
- Write your script (up to 5000 characters)
- Customize settings (style, speed, pitch, background)
- Click "Generate Video"
- Monitor Progress: Real-time status updates on dashboard
- View Results: Watch and share completed videos
See docs/environment-setup.md
for detailed environment setup instructions.
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
HEYGEN_API_KEY=your-heygen-api-key
HEYGEN_WEBHOOK_SECRET=your-webhook-secret
PUBLIC_URL=https://your-domain.com
-
Connect to Vercel:
- Import your GitHub repository
- Vercel will auto-detect Next.js
-
Configure Environment Variables:
- Add all environment variables to Vercel project settings
- Set
PUBLIC_URL
to your Vercel domain
-
Deploy:
- Push to main branch for automatic deployment
app/
├── api/
│ ├── heygen/
│ │ ├── avatars/route.ts # List built-in avatars
│ │ ├── voices/route.ts # List built-in voices
│ │ └── webhook/route.ts # Handle HeyGen webhooks
│ └── video/
│ └── generate/route.ts # Generate videos
├── components/
│ ├── VideoGenerationForm.tsx # Main video creation form
│ ├── VideoCard.tsx # Video display component
│ ├── DashboardClient.tsx # Dashboard with real-time updates
│ └── Navbar.tsx # Navigation component
├── dashboard/page.tsx # User dashboard
├── video/create/page.tsx # Video creation page
└── page.tsx # Landing page
lib/
├── heygen.ts # HeyGen API utilities
├── validators.ts # Zod schemas
└── supabase/ # Supabase clients
scripts/
└── phase1-migration.sql # Database schema
- Phase 2: Custom avatar training from photos
- Phase 3: Custom voice cloning
- Phase 4: Advanced video editing features
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License.