🎥 Make videos programmatically with React
docs(ai): add AI SaaS template documentation
ASchwada208d5321303
diff --git a/packages/docs/docs/ai/TableOfContents.tsx b/packages/docs/docs/ai/TableOfContents.tsxindex df0ee07493..f81ca27ba8 100644--- a/packages/docs/docs/ai/TableOfContents.tsx+++ b/packages/docs/docs/ai/TableOfContents.tsx@@ -38,9 +38,11 @@ export const TableOfContents: React.FC = () => {<strong>{'Just-in-time compilation'}</strong><div>Compile a Remotion component in JavaScript</div></TOCItem>- <TOCItem link="/templates/prompt-to-motion-graphics">- <strong>{'Prompt to Motion Graphics template'}</strong>- <div>A SaaS template for "Prompt to Motion Graphics" products.</div>+ <TOCItem link="/docs/ai/ai-saas-template">+ <strong>{'AI SaaS Template'}</strong>+ <div>+ An AI SaaS template for "Prompt to Motion Graphics" products.+ </div></TOCItem><TOCItem link="/templates/prompt-to-video"><strong>{'Prompt to Video'}</strong>diff --git a/packages/docs/docs/ai/ai-saas-template.mdx b/packages/docs/docs/ai/ai-saas-template.mdxnew file mode 100644index 0000000000..5afd8dbf28--- /dev/null+++ b/packages/docs/docs/ai/ai-saas-template.mdx@@ -0,0 +1,104 @@+---+image: /generated/articles-docs-ai-saas-template.png+crumb: 'AI'+title: AI SaaS Template - Prompt to Motion Graphics+sidebar_label: AI SaaS Template+---++import {Installation} from '../../components/Installation';++A Next.js starter template for building AI-powered motion graphics products. Users describe an animation in natural language, and the app generates and previews it in real-time.++## How is this different from using Claude Code with Remotion Skills?++The purpose of this template is to help you get started building your own browser-based product in the space of prompting motion graphics using Remotion.++Claude Code in combination with Remotion Skills is targeted at tech-savvy folks for iterating on videos with familiar tooling. For developers, this is super fast to set up - but not everybody is a developer.++This template is a starter kit to build AI products focused on generating Remotion code with LLMs directly within the browser. As this only requires natural language as input and no further technical setup, such products vastly broaden the target group beyond developers.++## What's Included++- **Chat interface** with conversation history for iterative refinement+- **Live preview** - instant rendering in the Remotion Player+- **Smart editing** - the LLM decides between targeted edits or full replacement+- **Input Validation** - prevents end-user misuse+- **Sanitation** - cleans nondeterministic LLM outputs+- **Self-correction** - automatically retries on compilation errors++The template can easily be extended by adding more [skills](/docs/ai/skills). It streams [generated code](/docs/ai/generate) and compiles it in the browser using [just-in-time compilation](/docs/ai/dynamic-compilation).++## Usage Tips++### Prompting++- Be specific about colors, timing, and layout+- Include data directly for charts and visualizations+- Describe the animation feel ("bouncy spring", "smooth fade", "staggered timing")+- If you have something specific in mind, attach images to the prompt for reference++### Images++This starter kit does not come with a backend. Therefore, there is an important difference between attaching images to the prompt and mentioning image URLs in the prompt.++- **Attaching images**: The assistant will try to replicate in code whatever you attach to the prompt, for example an abstract spiral.+- **Providing image URLs**: The assistant will embed the provided image within the animation based on the file URL. For example: _"Create a DVD screensaver animation of this image https://example.com/logo.png"_++### What works well++- Kinetic typography and text animations+- Data visualizations with animated entrances+- Chat/messaging UI mockups+- Social media content (Stories, Reels, TikTok)++## Getting Started++### Create the project++```bash+npx create-video@latest --template prompt-to-motion-graphics+```++### Configure environment++Create a `.env` file:++```bash title=".env"+OPENAI_API_KEY=sk-...++# Optional: For Lambda rendering+REMOTION_AWS_ACCESS_KEY_ID=...+REMOTION_AWS_SECRET_ACCESS_KEY=...+```++### Start the development server++```bash+npm run dev+```++Visit `http://localhost:3000` to start generating animations.++## Commands++| Command | Description |+| ---------------------- | -------------------- |+| `npm install` | Install dependencies |+| `npm run dev` | Start preview |+| `npx remotion render` | Render video |+| `npx remotion upgrade` | Upgrade Remotion |++## Lambda Rendering++To enable video export:++1. Set up Remotion Lambda following the [Lambda guide](/docs/lambda/setup)+2. Add AWS credentials to `.env`+3. Deploy with `npm run deploy`++## See Also++- [Code Generation](/docs/ai/generate) - How to generate Remotion code with LLMs+- [Just-in-time Compilation](/docs/ai/dynamic-compilation) - Compiling React code in the browser+- [Skills](/docs/ai/skills) - Creating modular knowledge for LLMs+- [System Prompt](/docs/ai/system-prompt) - Reference system prompt for Remotiondiff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.tsindex 86bafc46d1..26d5289582 100644--- a/packages/docs/sidebars.ts+++ b/packages/docs/sidebars.ts@@ -1210,6 +1210,7 @@ const sidebars: SidebarsConfig = {'ai/chatbot','ai/generate','ai/dynamic-compilation',+ 'ai/ai-saas-template','ai/mcp','ai/system-prompt','ai/skills',