An interface for generating educational lectures with synchronized animations and narration using AI.
- Friendly UI: Three-panel layout with sidebar, video player, and chat interface
- AI-Generated Content: Uses Groq API (OSS model) to generate Manim code and narration scripts
- Manim Animations: Automatically generates educational animations for STEM topics
- TTS: Browser Web Speech API (free)
- Video Output: Combines animations with narration for complete lecture videos
- Keyboard Shortcuts: Enter to submit, Shift+Enter for new line
gpt-open-hack/
├── frontend/ # React + Vite frontend
│ ├── src/
│ │ ├── components/
│ │ │ ├── Sidebar.jsx # Left panel - chat history
│ │ │ ├── VideoPlayer.jsx # Center panel - video player
│ │ │ └── ChatPanel.jsx # Right panel - prompt input
│ │ └── App.jsx
│ └── package.json
├── backend/ # Node.js + Express backend
│ ├── routes/
│ │ └── generate.js # Main API endpoint
│ ├── videos/ # Generated video files
│ └── index.js
└── README.md
- Node.js (v20+)
- Python with Manim installed:
pip install manim
- Groq API Key (or adapt back to OpenRouter)
-
Clone and setup:
cd gpt-open-hack -
Setup Backend:
cd backend npm install copy .env.example .env # (Windows PowerShell; use cp on macOS/Linux) # Edit .env and add your GROQ_API_KEY
-
Setup Frontend:
cd ../frontend npm install
-
Get Groq API Key:
- Visit https://console.groq.com/
- Create an API key
-
Configure Backend (
backend/.env):PORT=3001 GROQ_API_KEY=your_key_here
Note: TTS is handled automatically by your browser - no additional setup required!
-
Start Backend (Terminal 1):
cd backend npm start -
Start Frontend (Terminal 2):
cd frontend npm run dev -
Open Browser:
- Navigate to
http://localhost:5173
- Navigate to
-
Enter a Prompt: In the right panel, enter a topic like:
- "Explain Newton's laws of motion with visual examples"
- "Teach calculus derivatives with animated graphs"
- "Show how electromagnetic waves work"
-
Generate Lecture: Click "Generate Lecture" to create:
- Manim animation code
- Narration script
- Combined video output
-
View Results:
- Video plays in center panel
- Chat history appears in left panel
- Click previous chats to replay videos
- Components: Modular React components for each panel
- Styling: VS Code-inspired dark theme with CSS
- State Management: React hooks for managing video and chat state
- API Endpoint:
/api/generate- handles lecture generation - LLM Integration: Groq API for content generation (model:
openai/gpt-oss-120b) - Manim Execution: Runs Python scripts to generate animations
- File Serving: Static file serving for generated videos
- Model:
openai/gpt-oss-120bvia Groq - Prompt Engineering: "Maestro" system prompt producing shot-based timeline JSON (title, manim_header, scenes[shots], manim_footer)
- Output Format: JSON transformed into executable Manim scene
- Groq: Fast OSS model inference API
- Browser TTS: Web Speech API for text-to-speech
- Local Manim: Community edition for animations
- Local Storage: Browser memory for chat history
-
Manim not found:
pip install manim # or conda install -c conda-forge manim -
API Key errors:
- Check
.envfile exists inbackend/ - Verify
GROQ_API_KEYis correct - If switching back to OpenRouter, adjust endpoint & env var in
routes/generate.js
- Check
-
Port conflicts:
- Backend runs on port 3001
- Frontend runs on port 5173
- Change ports in config if needed
- Backend includes fallback responses for offline development
- Minimal guardrails (prompt length + pattern filtering) applied before execution
- For production consider sandboxing Manim (Docker, seccomp, etc.)
- Real TTS streaming integration
- Audio + video mux (ffmpeg) for packaged lectures
- Template library of common pedagogy animations
- Persistent storage for prompts & metadata
- Authentication / multi-user support
- Docker sandbox / safer code execution
- CI (lint, type, minimal unit test)
- Fork the repository
- Create feature branch
- Make changes
- Test locally
- Submit pull request
MIT License - see LICENSE file for details.