Back to Blog
January 4, 20267 min readReplay AI for

Replay AI for creating Real-Time dashboards.

R
Replay Team
Developer Advocates

TL;DR: Replay AI empowers developers to rapidly generate functional, real-time dashboards from video recordings, accelerating development and bridging the gap between design intent and working code.

From Video to Vibrant: Building Real-Time Dashboards with Replay AI#

Creating real-time dashboards is a common yet often time-consuming task for developers. Traditionally, this involves manual coding, UI design, and complex data integration. Imagine a world where you could simply record a video of your ideal dashboard, and AI would generate the working code for you. That's the promise of Replay.

Replay leverages the power of Gemini and Behavior-Driven Reconstruction to analyze video recordings and transform them into functional UI components. Unlike screenshot-to-code tools that merely replicate visuals, Replay understands the intent behind user interactions, enabling the generation of dynamic, data-driven dashboards.

The Problem: Dashboard Development Bottlenecks#

Developing real-time dashboards from scratch presents several challenges:

  • Design Complexity: Translating design mockups into interactive UI elements requires significant effort.
  • Data Integration: Connecting UI components to real-time data streams can be intricate and error-prone.
  • Iteration Cycles: Refining the dashboard based on user feedback often involves lengthy development cycles.
  • Maintaining Consistency: Ensuring a consistent look and feel across different dashboard components can be difficult.

Replay addresses these challenges by automating the code generation process, allowing developers to focus on higher-level tasks such as data analysis and feature enhancement.

Replay: The Video-to-Code Revolution for Dashboards#

Replay offers a novel approach to dashboard development, using video as the source of truth. This paradigm shift, known as Behavior-Driven Reconstruction, allows developers to capture the desired dashboard functionality through a simple screen recording.

Key Features for Real-Time Dashboard Generation#

  • Multi-Page Generation: Replay can generate dashboards with multiple pages and navigation, capturing complex workflows.
  • Supabase Integration: Seamlessly integrate your dashboard with Supabase for real-time data storage and retrieval.
  • Style Injection: Customize the look and feel of your dashboard with CSS and styling libraries.
  • Product Flow Maps: Visualize user interactions and data flows within the dashboard.

How Replay Works: A Technical Deep Dive#

Replay analyzes the video recording to identify UI elements, user interactions, and data dependencies. It then uses this information to generate clean, well-structured code that replicates the desired dashboard functionality. The process involves the following steps:

  1. Video Analysis: Replay analyzes the video frame by frame, identifying UI components such as charts, tables, and input fields.
  2. Behavioral Understanding: Replay infers user intent by analyzing mouse movements, clicks, and keyboard inputs.
  3. Code Generation: Replay generates code based on the identified UI elements and user interactions. This code can be exported in various formats, including React, Vue, and Angular.
  4. Data Integration: Replay integrates with data sources such as Supabase to populate the dashboard with real-time data.

Comparison with Existing Tools#

FeatureScreenshot-to-CodeManual CodingReplay
Video Input
Behavior Analysis
Real-Time Data IntegrationLimitedRequires Custom CodeSeamless Supabase Integration
Speed of DevelopmentModerateSlowVery Fast
Learning CurveLowHighLow

Building a Real-Time Dashboard with Replay: A Step-by-Step Guide#

Let's walk through the process of creating a simple real-time dashboard using Replay and Supabase. This example will demonstrate how to display real-time stock prices.

Step 1: Setup#

First, you'll need a Supabase account and a database with a table to store stock prices. You can use the following SQL to create a table named

text
stock_prices
:

sql
CREATE TABLE stock_prices ( id SERIAL PRIMARY KEY, symbol VARCHAR(10) NOT NULL, price DECIMAL(10, 2) NOT NULL, timestamp TIMESTAMP WITHOUT TIME ZONE DEFAULT (NOW() at time zone 'utc') );

Next, you'll need to set up a real-time subscription to the

text
stock_prices
table. Supabase provides built-in support for real-time updates using WebSockets.

📝 Note: You'll need to configure your Supabase project to allow public access to the

text
stock_prices
table for this example. In a production environment, you should implement proper authentication and authorization.

Step 2: Recording the Dashboard Video#

Record a video demonstrating how you want the dashboard to look and behave. Include the following elements:

  • A heading displaying "Real-Time Stock Prices"
  • A table displaying the stock symbol and price for each stock
  • A visual indication of real-time updates (e.g., a flashing icon)

Speak clearly about your intent in the video (e.g. "I want this table to show the latest stock prices."). This helps Replay understand the desired behavior.

Step 3: Uploading to Replay#

Upload the video to Replay. Replay will analyze the video and generate the code for your dashboard.

Step 4: Code Review and Customization#

Review the generated code and make any necessary customizations. Replay provides a code editor with syntax highlighting and auto-completion.

Here's an example of the React code that Replay might generate:

typescript
import { useEffect, useState } from 'react'; import { createClient } from '@supabase/supabase-js'; const supabaseUrl = 'YOUR_SUPABASE_URL'; const supabaseKey = 'YOUR_SUPABASE_ANON_KEY'; const supabase = createClient(supabaseUrl, supabaseKey); interface StockPrice { symbol: string; price: number; timestamp: string; } const RealTimeDashboard = () => { const [stockPrices, setStockPrices] = useState<StockPrice[]>([]); useEffect(() => { const subscription = supabase .from<StockPrice>('stock_prices') .on('*', (payload) => { setStockPrices((prevPrices) => { if (payload.eventType === 'INSERT') { return [...prevPrices, payload.new]; } else if (payload.eventType === 'UPDATE') { return prevPrices.map((price) => price.symbol === payload.new.symbol ? payload.new : price ); } return prevPrices; }); }) .subscribe(); return () => { supabase.removeSubscription(subscription); }; }, []); return ( <div> <h1>Real-Time Stock Prices</h1> <table> <thead> <tr> <th>Symbol</th> <th>Price</th> <th>Timestamp</th> </tr> </thead> <tbody> {stockPrices.map((price) => ( <tr key={price.symbol}> <td>{price.symbol}</td> <td>{price.price}</td> <td>{new Date(price.timestamp).toLocaleTimeString()}</td> </tr> ))} </tbody> </table> </div> ); }; export default RealTimeDashboard;

💡 Pro Tip: Use clear and concise voice narration in your video to guide Replay's code generation. Explicitly state the desired functionality of each UI element.

Step 5: Deployment#

Deploy the generated code to your preferred hosting platform. You now have a fully functional real-time dashboard powered by Replay and Supabase!

⚠️ Warning: Always sanitize user inputs and implement proper security measures to protect your application from vulnerabilities.

Benefits of Using Replay for Dashboard Development#

  • Rapid Prototyping: Quickly create dashboard prototypes from video recordings.
  • Reduced Development Time: Automate the code generation process and focus on higher-level tasks.
  • Improved Collaboration: Easily share dashboard ideas and prototypes with stakeholders using video recordings.
  • Enhanced User Experience: Create dashboards that accurately reflect user needs and expectations.
  • Democratization of Development: Empowers non-developers to contribute to the creation of functional UI.

Frequently Asked Questions#

Is Replay free to use?#

Replay offers a free tier with limited features and usage. Paid plans are available for more advanced features and higher usage limits. Check the pricing page for current details.

How is Replay different from v0.dev?#

While both tools aim to accelerate UI development, Replay distinguishes itself by using video as the primary input. This allows Replay to understand user behavior and intent, resulting in more accurate and functional code generation. V0.dev primarily relies on text prompts and predefined templates. Replay's Behavior-Driven Reconstruction offers a more intuitive and flexible approach.

What data sources can Replay integrate with?#

Replay currently offers seamless integration with Supabase. Support for other data sources is planned for future releases.

What code formats does Replay support?#

Replay currently supports React, Vue, and Angular. More frameworks will be added based on user demand.


Ready to try behavior-driven code generation? Get started with Replay - transform any video into working code in seconds.

Ready to try Replay?

Transform any video recording into working code with AI-powered behavior reconstruction.

Launch Replay Free