System requirements
Before installing, ensure your system meets these requirements:- Node.js: Version 18.0 or higher (download here)
- npm: Version 8.0 or higher (comes with Node.js)
- Operating system: macOS, Windows, or Linux
- Memory: At least 4GB RAM recommended
- OpenAI API access: Active OpenAI account with API credits
Step-by-step installation
Clone the repository
Get the source code from the Remotion monorepo:Or if you want just this template:
Install dependencies
Install all required npm packages:This installs 50+ packages including:Core Remotion packages:
remotion@^4.0.0- Core library for programmatic video@remotion/player@^4.0.0- Embedded video player component@remotion/bundler@^4.0.0- Webpack bundler for Remotion@remotion/cli@^4.0.0- CLI tools for rendering@remotion/web-renderer@^4.0.0- Browser-based rendering
@remotion/transitions@^4.0.0- Scene transition effects@remotion/shapes@^4.0.0- Geometric shape primitives@remotion/three@^4.0.0- Three.js integration for 3D@remotion/google-fonts@^4.0.0- Google Fonts integration@remotion/lottie@^4.0.0- Lottie animation support@remotion/paths@^4.0.0- SVG path utilities@remotion/tailwind-v4@^4.0.0- Tailwind CSS v4 integration
[email protected]- Vercel AI SDK for streaming@ai-sdk/[email protected]- OpenAI provider@ai-sdk/[email protected]- React hooks for AI SDK@babel/[email protected]- In-browser code compilation[email protected]- Schema validation for AI responses
[email protected]- Next.js App Router[email protected]- React 19[email protected]- React DOM@radix-ui/*- Headless UI components[email protected]- Icon library[email protected]- Utility-first CSS
@monaco-editor/[email protected]- Monaco editor React wrapper[email protected]- VS Code’s editor[email protected]- JSX syntax highlighting
Set up environment variables
Create a The Required variables:Get your OpenAI API key from platform.openai.com/api-keys.Optional variables (for cloud rendering):These are only needed if you want to use Remotion Lambda for cloud rendering. See the Lambda documentation for setup instructions.
.env file in the project root:.env.example file contains:Verify installation
Start the development server:You should see:Open http://localhost:3000 in your browser. You should see the landing page with the “What do you want to create?” input.
Configuration files
package.json scripts
The project includes these npm scripts:npm run dev
Start Next.js development server on port 3000
npm run build
Build production-optimized Next.js bundle
npm start
Start production server (after build)
npm run lint
Run ESLint to check code quality
npm run remotion
Open Remotion Studio for previewing compositions
npm run render
Render animations to video files
remotion.config.ts
Remotion configuration file:setOverwriteOutput(true)- Overwrite existing output filessetVideoImageFormat("jpeg")- Use JPEG for video frames (smaller size)setCodec("h264")- Use H.264 codec for broad compatibility
next.config.js
Next.js configuration with Remotion integration:tailwind.config.js
Tailwind CSS v4 with custom theme:Project structure
Understanding the codebase layout:Key files explained
src/app/api/generate/route.ts
src/app/api/generate/route.ts
The core generation API endpoint. Handles:
- Prompt validation (reject non-visual requests)
- Skill detection (analyze prompt for relevant skills)
- Initial generation (streaming response with full code)
- Follow-up edits (targeted edits or full replacement)
- Error correction (self-healing for compilation errors)
src/skills/*.md
src/skills/*.md
Domain-specific guidance files that get injected into prompts when relevant:
charts.md- Data visualization patterns, axis labels, staggered animationstypography.md- Kinetic text, typewriter effects, word carouselsmessaging.md- Chat UI, bubble layouts, WhatsApp/iMessage stylingtransitions.md- TransitionSeries, fade/slide/wipe effectssequencing.md- Sequence, Series, timing controlspring-physics.md- Spring configs, bounce effectssocial-media.md- Platform aspect ratios, safe zones3d.md- Three.js integration, camera setup
src/hooks/useAnimationState.ts
src/hooks/useAnimationState.ts
Manages code compilation using Babel standalone:
- Compiles JSX/TSX in-browser
- Provides React component for rendering
- Tracks compilation errors
- Debounces user edits
src/hooks/useConversationState.ts
src/hooks/useConversationState.ts
Maintains chat history and conversation context:
src/hooks/useAutoCorrection.ts
src/hooks/useAutoCorrection.ts
Automatic error healing with retry logic:
- Detects compilation errors after generation
- Automatically retries with error context (up to 3 attempts)
- Handles failed edits by requesting better context
- Tracks attempt count to prevent infinite loops
Model configuration
The system supports multiple OpenAI models with different performance characteristics:GPT-5.2
Default model
- Fast generation (~5-10 seconds)
- Good code quality
- Best for simple animations
- Lower API cost
GPT-5.2 (Low effort)
Reasoning model
- Slower (~15-30 seconds)
- Better code structure
- Handles complex prompts
- Higher API cost
GPT-5.2 (Medium effort)
Reasoning model
- Medium speed (~30-60 seconds)
- High-quality code
- Best for data visualizations
- Higher API cost
GPT-5.2 (High effort)
Reasoning model
- Slowest (~60-120 seconds)
- Highest quality code
- Best for complex 3D scenes
- Highest API cost
Development workflow
Local development
Code quality
Testing animations
Deployment
Deploy to Vercel
The easiest deployment option:Import to Vercel
- Go to vercel.com/new
- Import your GitHub repository
- Add environment variable:
OPENAI_API_KEY - Click Deploy
Deploy to other platforms
The app is a standard Next.js application and can be deployed to:- Netlify: Use the Next.js plugin
- Railway: Automatic deployment from GitHub
- AWS Amplify: Full-stack hosting
- Self-hosted: Build and run with
npm run build && npm start
Troubleshooting
Installation fails with peer dependency errors
Installation fails with peer dependency errors
Try using Or use the latest npm version:
--legacy-peer-deps flag:Build fails with webpack errors
Build fails with webpack errors
Clear Next.js cache and rebuild:
Monaco editor doesn't load
Monaco editor doesn't load
Ensure webpack configuration includes Monaco loader. Check
next.config.js has proper transpilePackages.Remotion Player shows blank screen
Remotion Player shows blank screen
Check browser console for errors. Common issues:
- Missing
AbsoluteFillwrapper in generated code - Syntax errors in compiled component
- Missing imports
OpenAI API errors
OpenAI API errors
Next steps
Quick start guide
Create your first animation in 5 minutes
Skills system
Learn how domain expertise is injected
API reference
Explore the generation API
Remotion docs
Deep dive into Remotion fundamentals