Skip to content

Visual UI for Explainroo. Explainer videos and product demos made by your AI agent. Free and open source: a local voice (Kokoro), word timing (Whisper) and a canvas renderer turn a script into a narrated MP4.

15.1 KB
Raw Blame
import { Project } from '../types/explainroo';

export const PREBUILT_TEMPLATES: Project[] = [
  {
    id: 'dns-explainer',
    title: 'How DNS Works: From URL to Website',
    description: 'A visual journey showing how your browser turns human names into IP addresses in under 50 milliseconds.',
    look: 'whiteboard',
    musicTrack: 'lofi',
    musicVolume: 0.3,
    voicePitch: 1.0,
    voiceRate: 1.0,
    autoDuck: true,
    scenes: [
      {
        id: 'dns-s1',
        title: 'Entering the Web Address',
        narration: 'Whenever you open your browser and type google.com, your computer has no idea where that server is. It needs an IP address.',
        durationSeconds: 7,
        transition: 'fade',
        elements: [
          {
            id: 'e-client-1',
            type: 'client',
            x: 180,
            y: 280,
            width: 220,
            height: 150,
            label: 'Your Computer',
            color: '#0f172a',
            strokeWidth: 3,
            animation: 'pop',
            triggerWord: 'computer',
            triggerTimeSec: 0.5,
          },
          {
            id: 'e-browser-1',
            type: 'browser_window',
            x: 520,
            y: 200,
            width: 540,
            height: 280,
            label: 'Searching for google.com...',
            url: 'https://google.com',
            color: '#3b82f6',
            strokeWidth: 2.5,
            animation: 'slide',
            triggerWord: 'browser',
            triggerTimeSec: 1.8,
          },
          {
            id: 'e-arrow-1',
            type: 'arrow',
            x: 410,
            y: 340,
            width: 100,
            height: 0,
            label: 'Requests URL',
            color: '#f97316',
            strokeWidth: 2.5,
            animation: 'draw',
            triggerWord: 'type',
            triggerTimeSec: 3.2,
          },
        ],
      },
      {
        id: 'dns-s2',
        title: 'The Recursive Resolver',
        narration: 'Your computer sends a query to a recursive resolver, usually managed by your internet service provider or Cloudflare.',
        durationSeconds: 7,
        transition: 'fade',
        elements: [
          {
            id: 'e-client-2',
            type: 'client',
            x: 150,
            y: 290,
            width: 200,
            height: 130,
            label: 'Client',
            color: '#0f172a',
            strokeWidth: 2.5,
            animation: 'pop',
            triggerTimeSec: 0.2,
          },
          {
            id: 'e-cloud-resolver',
            type: 'cloud',
            x: 540,
            y: 240,
            width: 320,
            height: 200,
            label: 'DNS Resolver\n1.1.1.1',
            color: '#3b82f6',
            strokeWidth: 3,
            animation: 'pop',
            triggerWord: 'resolver',
            triggerTimeSec: 1.5,
          },
          {
            id: 'e-arrow-query',
            type: 'arrow',
            x: 360,
            y: 340,
            width: 170,
            height: 0,
            label: 'Who is google.com?',
            color: '#f97316',
            strokeWidth: 2.5,
            animation: 'draw',
            triggerWord: 'query',
            triggerTimeSec: 2.8,
          },
        ],
      },
      {
        id: 'dns-s3',
        title: 'Root & TLD Servers',
        narration: 'The resolver asks the root server, which points to the .com TLD server, finally finding the authoritative nameserver.',
        durationSeconds: 8,
        transition: 'fade',
        elements: [
          {
            id: 'e-resolver-s3',
            type: 'cloud',
            x: 160,
            y: 260,
            width: 240,
            height: 160,
            label: 'Resolver',
            color: '#3b82f6',
            strokeWidth: 2.5,
            animation: 'pop',
            triggerTimeSec: 0.2,
          },
          {
            id: 'e-root-server',
            type: 'server',
            x: 560,
            y: 160,
            width: 200,
            height: 120,
            label: 'Root Server (.)',
            color: '#0f172a',
            strokeWidth: 2.5,
            animation: 'pop',
            triggerWord: 'root',
            triggerTimeSec: 1.4,
          },
          {
            id: 'e-tld-server',
            type: 'server',
            x: 880,
            y: 360,
            width: 240,
            height: 130,
            label: 'TLD Server (.com)',
            color: '#10b981',
            strokeWidth: 2.5,
            animation: 'pop',
            triggerWord: 'TLD',
            triggerTimeSec: 3.8,
          },
          {
            id: 'e-arrow-chain-1',
            type: 'curved_arrow',
            x: 410,
            y: 280,
            width: 140,
            height: -60,
            label: '1. Ask Root',
            color: '#f97316',
            strokeWidth: 2,
            animation: 'draw',
            triggerTimeSec: 2.0,
          },
          {
            id: 'e-arrow-chain-2',
            type: 'curved_arrow',
            x: 770,
            y: 240,
            width: 100,
            height: 120,
            label: '2. Go to .com',
            color: '#10b981',
            strokeWidth: 2,
            animation: 'draw',
            triggerTimeSec: 4.5,
          },
        ],
      },
      {
        id: 'dns-s4',
        title: 'Connection Established',
        narration: 'Armed with the exact IP address, your browser connects directly to the server, and the webpage renders seamlessly.',
        durationSeconds: 7,
        transition: 'fade',
        elements: [
          {
            id: 'e-client-final',
            type: 'client',
            x: 180,
            y: 280,
            width: 220,
            height: 150,
            label: 'Client Connected',
            color: '#0f172a',
            strokeWidth: 3,
            animation: 'pop',
            triggerTimeSec: 0.2,
          },
          {
            id: 'e-target-server',
            type: 'server',
            x: 780,
            y: 260,
            width: 240,
            height: 160,
            label: 'Web Server\n142.250.190.46',
            color: '#10b981',
            strokeWidth: 3,
            animation: 'pop',
            triggerWord: 'server',
            triggerTimeSec: 1.5,
          },
          {
            id: 'e-arrow-success',
            type: 'arrow',
            x: 410,
            y: 350,
            width: 360,
            height: 0,
            label: 'HTTP GET / · 200 OK',
            color: '#10b981',
            strokeWidth: 3.5,
            animation: 'draw',
            triggerWord: 'renders',
            triggerTimeSec: 3.0,
          },
          {
            id: 'e-check-dns',
            type: 'checkmark',
            x: 580,
            y: 160,
            width: 80,
            height: 80,
            color: '#10b981',
            strokeWidth: 3,
            animation: 'pop',
            triggerTimeSec: 4.5,
          },
        ],
      },
    ],
  },
  {
    id: 'api-analogy',
    title: 'What is an API? The Restaurant Analogy',
    description: 'Understand APIs intuitively through a restaurant: you are the customer, the waiter is the API, and the kitchen is the backend.',
    look: 'darktech',
    musicTrack: 'tech',
    musicVolume: 0.25,
    voicePitch: 1.0,
    voiceRate: 1.0,
    autoDuck: true,
    scenes: [
      {
        id: 'api-s1',
        title: 'The Customer at the Table',
        narration: 'Imagine you are sitting in a restaurant looking at the menu. You know what you want to order, but you cannot walk directly into the kitchen.',
        durationSeconds: 7,
        transition: 'fade',
        elements: [
          {
            id: 'e-customer',
            type: 'client',
            x: 200,
            y: 280,
            width: 220,
            height: 160,
            label: 'Client (You)',
            color: '#38bdf8',
            strokeWidth: 3,
            animation: 'pop',
            triggerWord: 'customer',
            triggerTimeSec: 0.5,
          },
          {
            id: 'e-badge-order',
            type: 'badge',
            x: 480,
            y: 240,
            width: 180,
            height: 48,
            label: 'Order: Pizza #42',
            color: '#fbbf24',
            strokeWidth: 2,
            animation: 'pop',
            triggerWord: 'order',
            triggerTimeSec: 2.5,
          },
        ],
      },
      {
        id: 'api-s2',
        title: 'The Waiter is the API',
        narration: 'Enter the waiter, your Application Programming Interface. The waiter takes your request, translates it, and brings it safely to the kitchen.',
        durationSeconds: 8,
        transition: 'fade',
        elements: [
          {
            id: 'e-customer-s2',
            type: 'client',
            x: 150,
            y: 280,
            width: 200,
            height: 140,
            label: 'Client App',
            color: '#38bdf8',
            strokeWidth: 2.5,
            animation: 'pop',
            triggerTimeSec: 0.2,
          },
          {
            id: 'e-waiter-api',
            type: 'api_gateway',
            x: 520,
            y: 240,
            width: 240,
            height: 200,
            label: 'API Gateway\n(The Waiter)',
            color: '#fbbf24',
            strokeWidth: 3,
            animation: 'pop',
            triggerWord: 'waiter',
            triggerTimeSec: 1.2,
          },
          {
            id: 'e-kitchen-db',
            type: 'database',
            x: 900,
            y: 250,
            width: 200,
            height: 180,
            label: 'Kitchen Database',
            color: '#a855f7',
            strokeWidth: 3,
            animation: 'pop',
            triggerWord: 'kitchen',
            triggerTimeSec: 4.0,
          },
          {
            id: 'e-arrow-order',
            type: 'arrow',
            x: 360,
            y: 340,
            width: 150,
            height: 0,
            label: 'POST /order',
            color: '#38bdf8',
            strokeWidth: 2.5,
            animation: 'draw',
            triggerWord: 'request',
            triggerTimeSec: 2.5,
          },
        ],
      },
      {
        id: 'api-s3',
        title: 'Serving the Response',
        narration: 'The kitchen cooks the meal, packages it cleanly as structured JSON data, and the API serves it right back to your screen.',
        durationSeconds: 7,
        transition: 'fade',
        elements: [
          {
            id: 'e-customer-s3',
            type: 'client',
            x: 180,
            y: 280,
            width: 220,
            height: 150,
            label: 'Client (Received Data)',
            color: '#38bdf8',
            strokeWidth: 3,
            animation: 'pop',
            triggerTimeSec: 0.2,
          },
          {
            id: 'e-code-response',
            type: 'code_block',
            x: 500,
            y: 220,
            width: 440,
            height: 220,
            label: '{\n  "status": "success",\n  "dish": "Margherita",\n  "deliveredIn": "14ms"\n}',
            color: '#10b981',
            strokeWidth: 2,
            animation: 'draw',
            triggerWord: 'JSON',
            triggerTimeSec: 2.0,
          },
          {
            id: 'e-check-api',
            type: 'checkmark',
            x: 1000,
            y: 290,
            width: 90,
            height: 90,
            color: '#10b981',
            strokeWidth: 3,
            animation: 'pop',
            triggerTimeSec: 3.5,
          },
        ],
      },
    ],
  },
  {
    id: 'git-branching',
    title: 'Git Branching & Merge Explained Visually',
    description: 'Learn why branching is lightweight and how commits form an immutable directed graph.',
    look: 'blueprint',
    musicTrack: 'tech',
    musicVolume: 0.25,
    voicePitch: 1.0,
    voiceRate: 1.0,
    autoDuck: true,
    scenes: [
      {
        id: 'git-s1',
        title: 'The Main Branch Line',
        narration: 'Every Git repository begins with a commit history along the main branch. Each commit points to its parent snapshot.',
        durationSeconds: 7,
        transition: 'fade',
        elements: [
          {
            id: 'e-c1',
            type: 'circle',
            x: 240,
            y: 330,
            width: 80,
            height: 80,
            label: 'C1',
            color: '#ffffff',
            strokeWidth: 3,
            animation: 'pop',
            triggerTimeSec: 0.4,
          },
          {
            id: 'e-arr-c1-c2',
            type: 'arrow',
            x: 325,
            y: 370,
            width: 110,
            height: 0,
            color: '#38bdf8',
            strokeWidth: 2.5,
            animation: 'draw',
            triggerTimeSec: 1.5,
          },
          {
            id: 'e-c2',
            type: 'circle',
            x: 440,
            y: 330,
            width: 80,
            height: 80,
            label: 'C2',
            color: '#ffffff',
            strokeWidth: 3,
            animation: 'pop',
            triggerTimeSec: 1.8,
          },
          {
            id: 'e-arr-c2-c3',
            type: 'arrow',
            x: 525,
            y: 370,
            width: 110,
            height: 0,
            color: '#38bdf8',
            strokeWidth: 2.5,
            animation: 'draw',
            triggerTimeSec: 2.8,
          },
          {
            id: 'e-c3',
            type: 'circle',
            x: 640,
            y: 330,
            width: 80,
            height: 80,
            label: 'C3 (main)',
            color: '#facc15',
            strokeWidth: 3,
            animation: 'pop',
            triggerTimeSec: 3.2,
          },
        ],
      },
      {
        id: 'git-s2',
        title: 'Spawning a Feature Branch',
        narration: 'When you type git branch feature, Git simply creates a movable pointer pointing to the current commit without duplicating files.',
        durationSeconds: 7,
        transition: 'fade',
        elements: [
          {
            id: 'e-c2-s2',
            type: 'circle',
            x: 340,
            y: 400,
            width: 70,
            height: 70,
            label: 'C2',
            color: '#ffffff',
            strokeWidth: 2.5,
            animation: 'pop',
            triggerTimeSec: 0.2,
          },
          {
            id: 'e-c3-s2',
            type: 'circle',
            x: 520,
            y: 400,
            width: 70,
            height: 70,
            label: 'C3',
            color: '#ffffff',
            strokeWidth: 2.5,
            animation: 'pop',
            triggerTimeSec: 0.4,
          },
          {
            id: 'e-c4-feat',
            type: 'circle',
            x: 680,
            y: 220,
            width: 80,
            height: 80,
            label: 'C4 (feat)',
            color: '#38bdf8',
            strokeWidth: 3,
            animation: 'pop',
            triggerWord: 'feature',
            triggerTimeSec: 2.0,
          },
          {
            id: 'e-arr-branch',
            type: 'curved_arrow',
            x: 570,
            y: 390,
            width: 100,
            height: -140,
            label: 'Branch off',
            color: '#38bdf8',
            strokeWidth: 2.5,
            animation: 'draw',
            triggerTimeSec: 1.5,
          },
        ],
      },
    ],
  },
];