A full-stack application combining React frontend with Python backend for AI-driven video analysis and editing. https://live-edit-eight.vercel.app/
chmod +x setup.sh
./setup.shBackend Setup:
cd LiveEditBackend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python app.pyFrontend Setup (new terminal):
cd LiveEditFronten
npm install
npm run devWorker Setup (new terminal):
cd LiveEditBackend
./start-celery.shLiveEditProject/
βββ LiveEditBackend/ # Python Flask backend
β βββ app.py # Main Flask application
β βββ main.ipynb # Development notebook
β βββ requirements.txt # Python dependencies
β βββ .env # Backend configuration
β
βββ LiveEditFronten/ # React frontend
β βββ App.tsx # Main app component
β βββ index.tsx # Entry point
β βββ types.ts # TypeScript types
β βββ vite.config.ts # Vite configuration
β βββ components/ # React components
β β βββ ChatInterface.tsx
β β βββ LiveInterface.tsx
β β βββ MediaSidebar.tsx
β β βββ VideoGenerator.tsx
β βββ services/ # API services
β β βββ gemini.ts # Gemini & backend integration
β βββ context/ # React context
β β βββ ThemeContext.tsx
β βββ utils/ # Utilities
β β βββ audio-utils.ts
β βββ .env.local # Frontend configuration
β
βββ Configuration Files
βββ setup.sh # Automated setup script
βββ start-backend.sh # Backend startup
βββ start-backend.sh # Backend startup
βββ start-backend.sh # Backend startup
βββ start-frontend.sh # Frontend startup
βββ start-celery.sh # Celery worker startup
βββ SETUP_GUIDE.md # Detailed setup guide
Framework: Flask
API Server: http://localhost:5000
flowchart LR
User((User)) --> FE[React Frontend (Vite)]
FE -->|HTTPS /api/*| API[Flask API (Gunicorn)]
API -->|Queue jobs| Redis[(Redis / Upstash)]
Worker[Celery Worker] -->|Consume jobs| Redis
Worker -->|AI calls| Gemini[Google Gemini API]
Worker -->|FFmpeg processing| FFmpeg[FFmpeg]
API -->|Read/Write| DB[(Neon PostgreSQL)]
Worker -->|Read/Write| DB
API -->|Serve results| FE
FE -->|Uploads| API
GET /health
Response: {"status": "ok", "message": "Backend is running"}
POST /api/chat
Content-Type: application/json
{
"message": "Your message here"
}
Response:
{
"message": "AI response",
"status": "success"
}POST /api/analyze-video
Content-Type: multipart/form-data
FormData:
- video_file: (file)
- prompt: "Analysis prompt"
Response:
{
"summary": "Video description",
"key_events": [...],
"edit_plan": [
{"type": "cut", "start": "00:12", "end": "00:45"},
...
]
}Framework: React 19 + TypeScript + Vite
Dev Server: http://localhost:5173
getAiClient()- Initialize Gemini API clientchatWithBackend(message)- Send message to backendanalyzeVideoWithBackend(file, prompt)- Analyze videogenerateAiVideo(config)- Generate video with Gemini
- ChatInterface - Text chat with AI
- LiveInterface - Real-time AI interaction
- VideoGenerator - AI video generation
- MediaSidebar - Asset management
GEMINI_API_KEY=your_api_key_here
FLASK_ENV=development
FLASK_DEBUG=TrueVITE_BACKEND_URL=http://localhost:5000
VITE_GEMINI_API_KEY=your_api_key_hereUser Input (React)
β
ChatInterface.tsx
β
services/gemini.ts (chatWithBackend)
β
Backend /api/chat (Flask)
β
Google Gemini API
β
Response β Frontend
β
Display in Chat
β
AI Chat Interface - Talk to Gemini AI
β
Video Analysis - Analyze videos for editing suggestions
β
Video Generation - Generate videos with AI
β
Asset Management - Organize media files
β
Live AI Mode - Real-time interaction
β
Theme Support - Dark/Light modes
β
Responsive Design - Works on desktop & tablet
- Flask 3.0.0
- Flask-CORS 4.0.0
- google-generativeai 0.3.0
- python-dotenv 1.0.0
- React 19.2.3
- React DOM 19.2.3
- @google/genai 1.37.0
- Vite 6.2.0
- TypeScript 5.8.2
Deploy to: Heroku, Railway, Render, or DigitalOcean
Update frontend .env.local:
VITE_BACKEND_URL=https://your-backend-url.comDeploy to: Vercel, Netlify, or GitHub Pages
npm run buildcd LiveEditBackend
source venv/bin/activate
python app.py # with FLASK_DEBUG=True for auto-reloadcd LiveEditFronten
npm run devcurl http://localhost:5000/health# Test chat
curl -X POST http://localhost:5000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Hello"}'
# Test video analysis
curl -X POST http://localhost:5000/api/analyze-video \
-F "video_file=@video.mp4" \
-F "prompt=Analyze this video"Port 5000 already in use:
lsof -i :5000 # Find process
kill -9 <PID> # Kill processModule not found:
source venv/bin/activate
pip install -r requirements.txtAPI key errors:
- Check
.envfile exists inLiveEditBackend/ - Verify
GEMINI_API_KEYis valid - Restart Flask server
Backend not responding:
- Check backend is running on port 5000
- Verify
VITE_BACKEND_URLin.env.local - Check browser console for CORS errors
Dependencies missing:
cd LiveEditFronten
rm -rf node_modules package-lock.json
npm install- SETUP_GUIDE.md - Detailed setup instructions
- Backend:
LiveEditBackend/app.py- See docstrings for endpoint details - Frontend:
LiveEditFronten/services/gemini.ts- Service documentation
- Create a feature branch
- Make your changes
- Test locally (both frontend & backend)
- Submit PR with description
- See TESTING.md for the full testing guide.
MIT License - See LICENSE file
- Video Analysis UI - Implement video upload & analysis display
- Authentication - Add user login/signup
- Database - Store analysis results & user data
- Queue System - Handle long-running tasks
- WebSockets - Real-time progress updates
- Mobile App - React Native version
Questions? Check SETUP_GUIDE.md or the API documentation above.