A full-stack MERN application that converts math questions into 3Blue1Brown-style Manim animations using Gemini AI.
User Question → Gemini (Prompt Engineer) → Gemini (Manim Code Gen) → Manim Render → FFmpeg (+ Music) → Video
- Node.js v18+ → https://nodejs.org
- Python 3.10+ → https://python.org
- Manim Community →
pip install manim - FFmpeg → https://ffmpeg.org/download.html (add to PATH)
- MiKTeX (LaTeX for Windows) → https://miktex.org/download
Verify everything works:
node --version
python --version
python -m manim --version
ffmpeg -versioncd server
npm installcd server/python
python generate_music.pycd client
npm installcd server
npm run devcd client
npm run devhttp://localhost:5173
- You type a math question in the chat interface
- Gemini AI re-engineers your prompt with deep mathematical intuition
- Gemini AI writes complete Manim Python code for a 3Blue1Brown-style animation
- Manim renders the animation frame-by-frame into an MP4
- FFmpeg mixes in soft ambient background music
- You watch the beautiful math visualization!
If Manim code has errors, Gemini automatically fixes and retries (up to 3 times).
- Gemini API calls: ~10-20 seconds
- Manim rendering: ~60-180 seconds (depends on animation complexity)
- Total: 2-4 minutes per visualization
- Frontend: React + Vite
- Backend: Node.js + Express
- Database: MongoDB Atlas
- AI: Google Gemini 2.0 Flash
- Animation: Manim Community Edition
- Audio: FFmpeg
Generated videos are saved in server/videos/ and served at:
http://localhost:5000/videos/final_[id].mp4
Manim fails with LaTeX errors:
- Make sure MiKTeX is installed and added to PATH
- Run MiKTeX Console and install missing packages automatically
FFmpeg not found:
- Download FFmpeg, extract it, and add the
bin/folder to Windows PATH - Restart your terminal after adding to PATH
MongoDB connection fails:
- Check your Atlas IP whitelist (add 0.0.0.0/0 for development)
- Verify the connection string in
server/.env
Video not found after rendering:
- Manim creates nested folder structures; the server searches recursively
- Check
server/temp/videos/for the rendered file