Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5f76b4b
Copy nextjs-tailwind template
ASchwad Nov 29, 2025
bd06f11
Add basic examples with edit functionality
ASchwad Nov 29, 2025
1370215
Fix lint issue
ASchwad Nov 29, 2025
1b7cff4
Add LLM code generation with Vercel AI SDK
ASchwad Nov 29, 2025
30c1114
Add StreamingOverlay, add copy button, show protected imports, show t…
ASchwad Dec 3, 2025
4be3f10
Simplify UI components
ASchwad Dec 3, 2025
45a98b7
Add Error Fallback for Remotion Player
ASchwad Dec 3, 2025
2e83db9
Add SettingsModal and OpenAI API key input
ASchwad Dec 3, 2025
1edfca5
Bump Editor API
ASchwad Dec 3, 2025
36193fc
Update template details
ASchwad Dec 3, 2025
96fcea9
Remove code examples and overhaul UI
ASchwad Dec 3, 2025
0a8bdda
Add example prompts
ASchwad Dec 3, 2025
bda1604
Adjust prompt examples and model select
ASchwad Dec 4, 2025
86f260d
Add streamPhase detection for GPT response
ASchwad Dec 4, 2025
cc54eb5
Tune system prompt
ASchwad Dec 4, 2025
fa15c9d
Tune prompt and minor AnimationPlayer UI fixes
ASchwad Dec 4, 2025
b7e3d89
Add LandingPage
ASchwad Dec 4, 2025
6abc1b5
Minor prompt change + loader on button
ASchwad Dec 5, 2025
abffaef
Update logo to white version
ASchwad Dec 5, 2025
a9ab339
Add separate pages for Landing and Editor
ASchwad Dec 5, 2025
52f1735
Remove OpenAI API Key entry
ASchwad Dec 5, 2025
06e4781
Simplify components
ASchwad Dec 5, 2025
f01d3d0
Add code examples gallery with 3D, shapes, and Lottie support
ASchwad Dec 5, 2025
c0a7a6c
Rework component wrapping/imports and add page for code examples
ASchwad Dec 6, 2025
7cfa9bc
Merge branch 'main' into pr/5998
JonnyBurger Dec 7, 2025
51fc7bf
align license
JonnyBurger Dec 7, 2025
ba2aa70
same .env.example format as elsewhere
JonnyBurger Dec 7, 2025
585438f
delete unused component
JonnyBurger Dec 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
394 changes: 388 additions & 6 deletions bun.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"node": ">=16"
},
"devDependencies": {
"@types/babel__standalone": "^7.1.9",
"@types/bun": "catalog:",
"@types/deno": "2.0.0",
"@types/react": "catalog:",
Expand Down
25 changes: 24 additions & 1 deletion packages/create-video/src/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export type Template = {
| 'tiktok'
| 'code-hike'
| 'render-server'
| 'recorder';
| 'recorder'
| 'code-generation';
defaultBranch: string;
featuredOnHomePage: string | null;
previewURL: string | null;
Expand Down Expand Up @@ -531,6 +532,28 @@ export const FEATURED_TEMPLATES: Template[] = [
allowEnableTailwind: true,
contributedBy: null,
},
{
homePageLabel: 'Code Generation',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call the template "Prompt to Motion graphics"?

And the slug and folder name is prompt-to-motion-graphics and template-prompt-to-motion-graphics

While it is longer, it is more descriptive of the use case and aligns with the other template template-prompt-to-video

Also happy to hear better name suggestions!

shortName: 'Code Generation',
org: 'remotion-dev',
repoName: 'template-code-generation',
description: 'AI-powered code generation for Remotion',
longerDescription:
'A template that uses AI to generate Remotion video code from prompts.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'A template that uses AI to generate Remotion video code from prompts.',
'A SaaS template for "Prompt to Motion Graphics" products. Generates Remotion code, streams it to the frontend, and compiles and previews it in the browser.',

promoBanner: {
width: 1280,
height: 720,
src: '/img/code-generation-template.png',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file doesn't seem to exist.

},
cliId: 'code-generation' as const,
type: 'image' as const,
defaultBranch: 'main',
featuredOnHomePage: null,
previewURL: null,
templateInMonorepo: 'template-code-generation',
allowEnableTailwind: false,
contributedBy: null,
},
].filter(truthy);

export const PAID_TEMPLATES = [
Expand Down
4 changes: 4 additions & 0 deletions packages/template-code-generation/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
REMOTION_AWS_ACCESS_KEY_ID=
REMOTION_AWS_SECRET_ACCESS_KEY=

OPENAI_API_KEY=
39 changes: 39 additions & 0 deletions packages/template-code-generation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
out/
.env
build
1 change: 1 addition & 0 deletions packages/template-code-generation/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers=true
5 changes: 5 additions & 0 deletions packages/template-code-generation/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"useTabs": false,
"bracketSpacing": true,
"tabWidth": 2
}
28 changes: 28 additions & 0 deletions packages/template-code-generation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# template-code-generation

AI-powered code generation template for Remotion.

## Adding examples and capabilities

When adding new capabilities to the assistant, we have to first create some examples to let the system know what we can do. So first we add the example to the template, tweak it a bit more to get it right with our taste and then add it as an example potentially to the system prompt of the assistant.

## Model Selection

GPT5.1 Low reasoning seems to be a good middle ground between generation speed and output quality.

## Usage

```bash
npx create-video@latest --template code-generation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make the README consistent with the other templates?

The following needs to pass: cd packages/it-tests && bun test src/templates/validate-templates.test.ts

```

## Development

```bash
bun install
bun dev
```

## License

Note that for some entities a company license is needed. [Read the terms here](https://github.com/remotion-dev/remotion/blob/main/LICENSE.md).
22 changes: 22 additions & 0 deletions packages/template-code-generation/components.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other templates don't have this file, do we feel it is necessary?

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "",
"css": "styles/global.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"registries": {}
}
10 changes: 10 additions & 0 deletions packages/template-code-generation/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Use autocomplete to get a list of available regions.
* @type {import('@remotion/lambda').AwsRegion}
*/
export const REGION = "us-east-1";

export const SITE_NAME = "my-next-app";
export const RAM = 3009;
export const DISK = 10240;
export const TIMEOUT = 240;
79 changes: 79 additions & 0 deletions packages/template-code-generation/deploy.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import {
deployFunction,
deploySite,
getOrCreateBucket,
} from "@remotion/lambda";
import dotenv from "dotenv";
import path from "path";
import { DISK, RAM, REGION, SITE_NAME, TIMEOUT } from "./config.mjs";
import { webpackOverride } from "./src/remotion/webpack-override.mjs";

console.log("Selected region:", REGION);
dotenv.config();

if (!process.env.AWS_ACCESS_KEY_ID && !process.env.REMOTION_AWS_ACCESS_KEY_ID) {
console.log(
'The environment variable "REMOTION_AWS_ACCESS_KEY_ID" is not set.',
);
console.log("Lambda renders were not set up.");
console.log(
"Complete the Lambda setup: at https://www.remotion.dev/docs/lambda/setup",
);
process.exit(0);
}
if (
!process.env.AWS_SECRET_ACCESS_KEY &&
!process.env.REMOTION_AWS_SECRET_ACCESS_KEY
) {
console.log(
'The environment variable "REMOTION_REMOTION_AWS_SECRET_ACCESS_KEY" is not set.',
);
console.log("Lambda renders were not set up.");
console.log(
"Complete the Lambda setup: at https://www.remotion.dev/docs/lambda/setup",
);
process.exit(0);
}

process.stdout.write("Deploying Lambda function... ");

const { functionName, alreadyExisted: functionAlreadyExisted } =
await deployFunction({
createCloudWatchLogGroup: true,
memorySizeInMb: RAM,
region: REGION,
timeoutInSeconds: TIMEOUT,
diskSizeInMb: DISK,
});
console.log(
functionName,
functionAlreadyExisted ? "(already existed)" : "(created)",
);

process.stdout.write("Ensuring bucket... ");
const { bucketName, alreadyExisted: bucketAlreadyExisted } =
await getOrCreateBucket({
region: REGION,
});
console.log(
bucketName,
bucketAlreadyExisted ? "(already existed)" : "(created)",
);

process.stdout.write("Deploying site... ");
const { siteName } = await deploySite({
bucketName,
entryPoint: path.join(process.cwd(), "src", "remotion", "index.ts"),
siteName: SITE_NAME,
region: REGION,
options: { webpackOverride },
});

console.log(siteName);

console.log();
console.log("You now have everything you need to render videos!");
console.log("Re-run this command when:");
console.log(" 1) you changed the video template");
console.log(" 2) you changed config.mjs");
console.log(" 3) you upgraded Remotion to a newer version");
53 changes: 53 additions & 0 deletions packages/template-code-generation/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import js from "@eslint/js";
import nextPlugin from "@next/eslint-plugin-next";
import remotion from "@remotion/eslint-plugin";
import tseslint from "typescript-eslint";

// Build Next.js recommended rules and an "off" map for overrides
const nextRecommended = nextPlugin.configs.recommended ?? { rules: {} };
const nextRecommendedRules = nextRecommended.rules ?? {};
const offNextRules = Object.fromEntries(
Object.keys(nextRecommendedRules).map((k) => [k, "off"]),
);

export default [
// Global ignores
{
ignores: [
"node_modules/**",
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
"next.config.js",
"deploy.mjs",
],
},
// Base JS recommended
js.configs.recommended,
// TypeScript recommended (non type-checked for speed/simplicity)
...tseslint.configs.recommended,
// Next.js recommended rules applied to app code
{
files: ["**/*.{js,jsx,ts,tsx}"],
plugins: { "@next/next": nextPlugin },
rules: {
...nextRecommendedRules,
},
},
// Remotion rules applied only to remotion files
{
files: ["src/remotion/**"],
...remotion.flatPlugin,
rules: {
...remotion.flatPlugin.rules,
},
},
// Disable all Next.js rules within remotion files
{
files: ["src/remotion/**"],
rules: {
...offNextRules,
},
},
];
6 changes: 6 additions & 0 deletions packages/template-code-generation/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
};

module.exports = nextConfig;
77 changes: 77 additions & 0 deletions packages/template-code-generation/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "template-code-generation",
"version": "4.0.379",
"description": "AI-powered code generation template for Remotion",
"repository": {
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/template-code-generation"
},
"homepage": "https://www.remotion.dev",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint .",
"remotion": "remotion studio",
"render": "remotion render",
"deploy": "node deploy.mjs"
},
"dependencies": {
"@ai-sdk/openai": "^2.0.74",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we

  • Pin ALL dependencies by removing the ^
  • If the same package is used elsewhere in the monorepo, use the same version across?

This ensures a smaller node_modules folder and prevents duplication of modules

"@ai-sdk/react": "^2.0.104",
"@babel/standalone": "^7.28.5",
"@monaco-editor/react": "^4.7.0",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-tooltip": "^1.2.8",
"@react-three/fiber": "^9.4.2",
"@remotion/animated-emoji": "workspace:*",
"@remotion/bundler": "workspace:*",
"@remotion/cli": "workspace:*",
"@remotion/google-fonts": "workspace:*",
"@remotion/lambda": "workspace:*",
"@remotion/lottie": "workspace:*",
"@remotion/paths": "workspace:*",
"@remotion/player": "workspace:*",
"@remotion/shapes": "workspace:*",
"@remotion/tailwind-v4": "workspace:*",
"@remotion/three": "workspace:*",
"ai": "^5.0.104",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.555.0",
"monaco-editor": "^0.55.1",
"monaco-jsx-syntax-highlight": "^1.2.2",
"next": "16.0.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"remotion": "workspace:*",
"tailwind-merge": "^3.4.0",
"three": "^0.181.2",
"zod": "^4.1.13"
},
"devDependencies": {
"@eslint/eslintrc": "3.1.0",
"@eslint/js": "9.38.0",
"@next/eslint-plugin-next": "15.1.6",
"@remotion/eslint-plugin": "workspace:*",
"@tailwindcss/postcss": "4.1.1",
"@types/node": "20.12.14",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@types/three": "^0.181.0",
"@types/web": "0.0.166",
"@typescript-eslint/eslint-plugin": "8.46.0",
"@typescript-eslint/parser": "8.46.0",
"autoprefixer": "10.4.20",
"dotenv": "16.0.3",
"eslint": "9.19.0",
"eslint-config-next": "15.1.6",
"postcss": "8.4.47",
"prettier": "3.6.0",
"tailwindcss": "4.0.3",
"tw-animate-css": "^1.4.0",
"typescript": "5.8.2",
"typescript-eslint": "8.46.0"
}
}
6 changes: 6 additions & 0 deletions packages/template-code-generation/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};
export default config;
5 changes: 5 additions & 0 deletions packages/template-code-generation/public/logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/template-code-generation/public/logo.png
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old logo, can be removed

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading