An AI-powered educational platform that creates comprehensive learning experiences through animated visualizations, written articles, audio narration, and interactive conversations. Built with Next.js and integrated with multiple AI services for generating educational content.
- π¬ Video Generation: Create Manim-powered mathematical animations with synchronized audio narration
- π Article Generation: Generate structured educational articles with AI-powered content
- π΅ Audio Narration: Convert articles to natural speech using Murf AI's text-to-speech
- π¬ Interactive Chatbot: Engage in conversational learning with AI-powered explanations
- π Multilingual Support: Translate content and generate audio in multiple languages
- π¨ Visual Learning: Dynamic mathematical visualizations using Manim animation engine
- π Content Library: Browse and manage generated educational materials
- π Secure Sandbox: Execute code safely in isolated E2B containers
- β‘ Real-time Generation: Dynamic content creation based on user input
- π Modern UI: Responsive interface with shader backgrounds and smooth animations
- Home (/) - Landing page with service overview and quick actions
- Explain (/explain/[topic]) - Generate animated videos for mathematical concepts
- Article (/article) - Create structured educational articles
- Library (/library) - Browse and manage generated content
- Translation Demo (/translation-demo) - Test multilingual capabilities
- Loading (/loading) - Processing states during content generation
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS 4, Paper Design Shaders, Motion (animations)
- AI Services:
- OpenRouter: Primary AI provider (GPT-4, Gemini, Claude)
- Google AI: Alternative AI provider for enhanced responses
- Murf AI: Professional text-to-speech and voice synthesis
- Sandbox & Execution: E2B Code Interpreter for secure code execution
- Animation: Manim (Mathematical Animation Engine) for video generation
- Storage: Vercel Blob for file storage and delivery
- Package Manager: Bun (with npm fallback)
- Development: ESLint, Turbopack for fast builds
- Node.js 18+ or Bun (recommended for faster installs)
- E2B Account - Sign up at e2b.dev for sandbox execution
- OpenRouter API Key - Get API key at openrouter.ai for AI content generation
- Murf AI API Key - Sign up at murf.ai for text-to-speech
- Vercel Blob Token - For file storage (optional, can use local storage)
-
Clone the repository
git clone https://github.com/Ankit-Kumar20/murf-manim-hack.git cd murf-manim-hack -
Install dependencies
bun install # or npm install -
Environment Setup Create a
.env.localfile with your API keys:E2B_API_KEY=your_e2b_api_key OPENROUTER_API_KEY=your_openrouter_api_key MURF_AI_API_KEY=your_murf_ai_api_key BLOB_READ_WRITE_TOKEN=your_vercel_blob_token
-
Run the development server
bun dev # or npm run dev -
Open your browser Navigate to http://localhost:3000
This project uses a custom E2B sandbox environment with Manim pre-installed.
The sandbox includes:
- Python 3.10
- Manim with all dependencies
- FFmpeg for video processing
- Cairo and Pango for rendering
If you need to rebuild the sandbox template:
e2b template buildThe template configuration is defined in:
e2b.Dockerfile- Docker configuration with Manim installatione2b.toml- E2B template configuration
βββ src/
β βββ app/ # Next.js app directory
β β βββ api/ # API routes
β β β βββ chatbot/ # Conversational AI endpoint
β β β βββ code-execution/ # Code execution in sandbox
β β β βββ generate-article/ # Article generation
β β β βββ generate-audio/ # Text-to-speech audio generation
β β β βββ generate-lesson/ # Lesson plan generation
β β β βββ generate-manim/ # Manim code generation
β β β βββ test-env/ # Environment testing
β β β βββ test-voices/ # Voice testing
β β β βββ translate/ # Translation services
β β β βββ voices/ # Voice options
β β βββ article/ # Article generation pages
β β βββ explain/ # Concept explanation pages
β β βββ library/ # Content library
β β βββ translation-demo/ # Translation demonstration
β β βββ loading/ # Loading states
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Homepage
β β βββ globals.css # Global styles
β β βββ favicon.ico # App favicon
β βββ components/ # React components
β β βββ ArticleDisplay.tsx # Article rendering
β β βββ ConceptInputForm.tsx # Input forms
β β βββ ContentModeSelector.tsx # Content type selection
β β βββ EnhancedArticleDisplay.tsx # Advanced article display
β β βββ EnhancedLessonBreakdown.tsx # Lesson components
β β βββ Footer.tsx # Site footer
β β βββ LanguageSelector.tsx # Language selection
β β βββ LessonArticleDisplay.tsx # Lesson article display
β β βββ LessonBreakdown.tsx # Lesson breakdown
β β βββ Navbar.tsx # Navigation
β β βββ ShaderBackground.tsx # Background effects
β β βββ SimpleEnhancedArticleDisplay.tsx # Simplified display
β β βββ SubmittedTopicTitle.tsx # Topic display
β β βββ TypewriterText.tsx # Animated text
β β βββ VideoWithAudio.tsx # Video with audio sync
β βββ utils/ # Utility functions
β βββ blobStorage.ts # File storage utilities
β βββ clearCache.ts # Cache management
β βββ formatManimCode.ts # Manim code formatting
β βββ lessonBreakdown.ts # Lesson processing
β βββ murfTTS.ts # Text-to-speech integration
β βββ sandbox.ts # E2B sandbox integration
β βββ structuredManimGenerator.ts # Manim code generation
β βββ translation.ts # Translation utilities
β βββ voiceNarration.ts # Voice narration
βββ public/ # Static assets
β βββ audio/ # Generated audio files
β βββ videos/ # Generated video files
β βββ *.svg # UI icons
β βββ *.ico # Favicons
βββ e2b.Dockerfile # E2B sandbox configuration
βββ e2b.toml # E2B template settings
βββ StringTheoryScene.py # Example Manim scene
βββ package.json # Dependencies and scripts
Generates Manim animation code for mathematical concepts.
Request:
{
"topic": "quadratic functions",
"details": "Show the graph transformation"
}Response:
{
"success": true,
"code": "from manim import *\n\nclass QuadraticFunction(Scene):\n def construct(self):\n ...",
"explanation": "This animation demonstrates..."
}Creates structured educational articles with AI-generated content.
Request:
{
"topic": "machine learning",
"audience": "beginners",
"sections": ["introduction", "basics", "applications"]
}Generates comprehensive lesson plans with breakdown and activities.
Converts articles to speech using Murf AI's text-to-speech.
Request:
{
"articleContent": {
"title": "Introduction to Algebra",
"introduction": "...",
"sections": [...],
"conclusion": "..."
},
"languages": ["en", "es"],
"voiceOptions": {
"voice": "en-US-female-1",
"speed": 1.0
}
}Provides conversational AI for educational topics with session management.
Request:
{
"message": "Explain derivatives",
"sessionId": "unique-session-123",
"topic": "calculus"
}Translates text and articles to multiple languages.
Request:
{
"type": "article",
"targetLanguage": "es",
"data": {
"articleContent": {...}
}
}Executes code safely in E2B sandbox environment.
Retrieves available voice options for text-to-speech.
Tests voice synthesis with sample text.
Environment testing and validation.
- Navigate to
/explain - Enter a mathematical concept (e.g., "quadratic equations")
- Choose visualization options
- Generate Manim animation with AI narration
- Go to
/article - Specify topic and audience level
- Select article structure
- Generate comprehensive educational content
- Create content in any supported language
- Use translation API to convert to multiple languages
- Generate audio narration in target languages
- Access content library for all versions
- Use chatbot for conversational explanations
- Generate lesson breakdowns with activities
- Create video + audio combinations
- Save everything to your personal library
- ConceptInputForm - Interactive form for submitting concepts to visualize
- ContentModeSelector - Toggle between different content generation modes
- LanguageSelector - Select target languages for translation
- Navbar - Main navigation component
- Footer - Site footer with links
- ArticleDisplay - Basic article rendering
- EnhancedArticleDisplay - Advanced article display with formatting
- SimpleEnhancedArticleDisplay - Lightweight article display
- LessonArticleDisplay - Specialized display for lesson content
- LessonBreakdown - Interactive lesson breakdown component
- EnhancedLessonBreakdown - Advanced lesson breakdown with activities
- VideoWithAudio - Synchronized video and audio playback
- TypewriterText - Animated typewriter text effect
- SubmittedTopicTitle - Displays current topic being processed
- ShaderBackground - Dynamic WebGL shader background effects
- Sandboxed Execution: All code runs in isolated E2B containers
- Input Validation: Robust validation of user inputs
- Rate Limiting: API endpoints are rate-limited
- Error Handling: Comprehensive error handling and logging
-
E2B Sandbox Fails to Start
- Ensure your E2B API key is valid
- Check that the template
q6wznn8hq65ffgkd0tqhexists - Rebuild the template if necessary
-
Manim Import Errors
- Verify the sandbox template includes all Manim dependencies
- Check the Docker build logs for any installation issues
-
API Key Errors
- Ensure all required environment variables are set
- Verify API keys are valid and have sufficient quotas
Test the Manim environment using the example scene:
python StringTheoryScene.pyOr use the built-in API testing endpoints:
/api/test-env- Environment validation/api/test-voices- Voice synthesis testing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- E2B Documentation - Sandbox execution platform
- Manim Documentation - Mathematical animation engine
- Next.js Documentation - React framework
- OpenRouter Documentation - AI model provider
- Murf AI Documentation - Text-to-speech service
- Vercel Blob Documentation - File storage
- Tailwind CSS - Utility-first CSS framework
- Paper Design Shaders - WebGL shader effects
- Motion - Animation library
- TypeScript Documentation - Type safety
- Bun Documentation - Fast JavaScript runtime
For support, please open an issue on GitHub or contact the development team.