A full-stack autonomous AI app that generates short narrated videos from text prompts using MetaGPT, ElevenLabs, DALL·E, and FFmpeg.
- Story Generation: Uses MetaGPT to create engaging stories from text prompts
- Voice Synthesis: ElevenLabs API for high-quality narration
- Image Generation: OpenAI DALL·E for scene visualization
- Video Assembly: FFmpeg for professional video creation
- Web Interface: React frontend with real-time progress tracking
- Persistent Storage: Supabase for job management and video storage
AI Project/
├── agents/ # MetaGPT agents
│ ├── storywriter.py # Story generation
│ ├── narrator.py # Voice synthesis
│ ├── visual.py # Image generation
│ └── editor.py # Video assembly
├── tools/ # API wrappers
│ ├── elevenlabs_client.py
│ ├── openai_client.py
│ ├── ffmpeg_utils.py
│ └── supabase_client.py
├── backend/
│ └── api/
│ └── app.py # FastAPI backend
├── frontend/ # React frontend
│ ├── src/
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ └── index.css
│ ├── package.json
│ └── vite.config.js
├── main.py # Standalone pipeline
├── requirements.txt # Python dependencies
└── .gitignore # Git ignore rules
Before you begin, ensure you have the following installed:
- Python 3.9+ (but less than 3.12)
- Node.js 16+ and npm
- FFmpeg (for video processing)
- Git (for cloning the repository)
git clone <your-repository-url>
cd AI-ProjectOption A: Install via pip (Recommended)
pip install metagptOption B: Install from source (if you need the latest version)
git clone https://github.com/geekan/MetaGPT.git
cd MetaGPT
pip install -e .
cd ..pip install -r requirements.txtcd frontend
npm install
cd ..Create a .env file in the root directory:
# API Keys (optional - mock mode available)
OPENAI_API_KEY=your_openai_key
ELEVENLABS_API_KEY=your_elevenlabs_key
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_keyWindows:
# Download from https://ffmpeg.org/download.html
# Add to PATHmacOS:
brew install ffmpegLinux:
sudo apt update
sudo apt install ffmpegVerify FFmpeg installation:
ffmpeg -versionTest the core pipeline with a hardcoded prompt:
python main.pycd backend/api
uvicorn app:app --reload --host 0.0.0.0 --port 8000cd frontend
npm run devThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
POST /generate- Start video generationGET /status/{job_id}- Get job statusGET /result/{job_id}- Get video resultGET /download/{job_id}- Download video file
All API clients support mock mode for development:
- ElevenLabs: Generates silent audio files
- OpenAI DALL·E: Creates placeholder images with text
- Supabase: Uses local file storage
- FFmpeg: Requires actual FFmpeg installation
- Set your API keys in environment variables
- The clients will automatically switch from mock to real mode
- For Supabase, create a
videostable with the schema fromVideoMetadata
- Story Style: Modify prompts in
agents/storywriter.py - Voice: Change voice settings in
tools/elevenlabs_client.py - Image Style: Adjust DALL·E parameters in
tools/openai_client.py - Video Effects: Add FFmpeg filters in
tools/ffmpeg_utils.py
- FFmpeg not found: Install FFmpeg and ensure it's in your PATH
- Import errors: Make sure you're in the project root directory
- API rate limits: Add delays or use mock mode for development
- CORS errors: The frontend proxy should handle this automatically
- MetaGPT import errors: Ensure MetaGPT is properly installed
Enable debug logging by setting environment variables:
export PYTHONPATH=.
export DEBUG=1If you encounter MetaGPT configuration issues:
# Initialize MetaGPT config
metagpt --init-config
# This creates ~/.metagpt/config2.yaml
# Edit the file with your API keys:
# llm:
# api_type: "openai"
# model: "gpt-4-turbo"
# api_key: "YOUR_OPENAI_API_KEY"# Using Gunicorn
pip install gunicorn
gunicorn app:app -w 4 -k uvicorn.workers.UvicornWorkercd frontend
npm run build
# Serve the dist/ directory- Set up a Supabase project for production storage
- Configure API keys for all services
- Set up proper CORS and security headers
- Use a reverse proxy (nginx) for production
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
- MetaGPT - Multi-agent framework
- ElevenLabs - Voice synthesis
- OpenAI - Image generation
- FFmpeg - Video processing
- Supabase - Backend as a service