Skip to main content
Seeding your database with demo data helps you test Hiro CRM’s features and understand how the system works before adding real customer data.

Overview

Hiro CRM provides two seeding options:
  1. Simple Seed - Basic brands, locations, and sample customers (JavaScript)
  2. Full Demo Dataset - Complete restaurant scenario with 5,000 customers and realistic data (SQL)

Simple Seed (Quick Start)

The simple seed script creates minimal test data to get started quickly.

What’s Included

  • 3 Brands: Manero, El Portal, MarMía
  • 2 Locations: Manero Madrid, Manero Alicante
  • 3 Sample Customers: With realistic Spanish names and data

Running the Simple Seed

1

Configure environment

Ensure your .env.local has valid Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
2

Run the seed script

cd frontend
node scripts/seed.js
You should see:
🌱 Starting seed...
✅ Brand seeded: Manero
✅ Brand seeded: El Portal
✅ Brand seeded: MarMía
✅ Location seeded: Manero Madrid
✅ Location seeded: Manero Alicante
✅ Customer seeded: Alejandro
✅ Customer seeded: Maria
✅ Customer seeded: John
✨ Seed completed!
3

Verify data

Log into your Hiro CRM and check:
  • Dashboard shows 3 customers
  • Locations dropdown shows 2 locations
  • Customer list displays seeded customers
The simple seed is idempotent - you can run it multiple times safely. It uses upsert to avoid duplicates.

Full Demo Dataset (Realistic Testing)

The full demo dataset creates a complete restaurant group scenario ideal for testing and demos.

What’s Included

3 Restaurant Brands

La Tasca, El Patio, La Brisa

5 Physical Locations

Madrid and Barcelona restaurants

5,000 Customers

Realistic Spanish customer data with loyalty tiers

~25,000 Reservations

2 years of reservation history

12 Marketing Campaigns

Email and SMS campaigns with metrics

~800 NPS Surveys

Customer feedback and ratings

Customer Distribution

The demo data includes realistic loyalty tier distribution:
  • 45% Nuevo (1-2 visits, €35-110 spend)
  • 25% Bronze (3-10 visits, €110-350 spend)
  • 15% Silver (10-22 visits, €380-800 spend)
  • 10% Gold (20-35 visits, €850-1,550 spend)
  • 4% Platinum (30-55 visits, €1,600-3,000 spend)
  • 1% Founders (50-100 visits, €3,500-8,000 spend)

Running the Full Demo Seed

1

Locate the seed file

The SQL file is at:
supabase/seeds/demo.sql
2

Open Supabase SQL Editor

  1. Go to Supabase Dashboard
  2. Select your project
  3. Click SQL Editor in the sidebar
  4. Click New query
3

Copy and run the seed

  1. Open supabase/seeds/demo.sql in your code editor
  2. Copy the entire file contents (475 lines)
  3. Paste into the SQL Editor
  4. Click Run (or press Cmd/Ctrl + Enter)
This query takes 30-60 seconds to complete. Don’t interrupt it!
4

Review the summary

After completion, scroll to the bottom of the results to see the summary:
brands_creadas    | 3
locales_creados   | 5
clientes_totales  | 5000
reservas_totales  | ~25000
campanas_totales  | 12
encuestas_nps     | 800
gasto_medio       | ~450.00
founders          | 50
platinum          | 200
gold              | 500
clientes_vip      | 250

Alternative: Supabase CLI

If you have the Supabase CLI installed:
cd frontend
supabase db seed demo
This assumes the seed file is in supabase/seeds/demo.sql in your linked project.

Demo Data Details

Brands & Locations

La Tasca (3 locations)

  • La Tasca Madrid · Centro - Gran Vía, 25
  • La Tasca Madrid · Salamanca - Calle Serrano, 3
  • La Tasca Barcelona · Eixample - Carrer de Provença, 230

El Patio (1 location)

  • El Patio Barcelona - Carrer del Consell de Cent, 302

La Brisa (1 location)

  • La Brisa Madrid - Paseo de la Castellana, 200

Loyalty Program

Pre-configured loyalty program with 6 tiers:
TierMin VisitsMin SpendBenefits
Nuevo0€05% discount next visit
Bronze3€10010% discount, priority booking
Silver10€30015% discount, preferred table, free dessert
Gold20€80020% discount, exclusive events, personal sommelier
Platinum30€1,50025% discount, annual tasting menu, VIP parking
Founders50€3,000Unlimited access, private chef, unique experiences

Marketing Campaigns

12 realistic campaigns with actual metrics: Email Campaigns:
  1. Welcome email (1,198 sent, 45% open rate)
  2. Valentine’s Day special (2,043 sent, 54% open rate)
  3. Easter menu (1,791 sent, 47% open rate)
  4. 1-year anniversary (3,118 sent, 58% open rate)
  5. Win-back campaign (756 sent, 38% open rate)
  6. Fall menu launch (2,801 sent, 50% open rate)
  7. Christmas reservations (3,412 sent, 60% open rate)
  8. VIP exclusive dinner (318 sent, 84% open rate)
  9. Spring menu (3,021 sent, 53% open rate)
  10. Birthday automation (372 sent, 80% open rate)
SMS Campaigns: 11. Wednesday flash sale (1,189 sent, 75% open rate) 12. Summer terrace opening (2,367 sent, 80% open rate)

Customer Data

All 5,000 customers have:
  • Realistic Spanish names - Common first and last names from Spain
  • Valid email addresses - Format: [email protected]
  • Spanish phone numbers - Format: +346xxxxxxxx
  • Geographic distribution - Primarily Madrid and Barcelona
  • Visit history - Realistic first visit and last visit dates over 2 years
  • Spending patterns - Correlated with loyalty tier
  • Marketing consent - ~72% opted in
  • Preferences - Seating preferences, tags, notes

Reservations

Reservations are generated based on each customer’s visit count:
  • Status distribution: Mostly “completed”, some “no_show” and “cancelled”
  • Party sizes: 2-6 people (realistic distribution)
  • Time slots: Lunch (13:30-14:30) and dinner (21:00-22:00)
  • Source: 65% from CoverManager, 35% manual
  • Date range: Distributed over 2 years from first visit to last visit

NPS Surveys

800 feedback surveys with realistic distribution:
  • 65% Promoters (4-5 stars) - Positive comments
  • 20% Passives (3 stars) - Neutral comments
  • 15% Detractors (1-2 stars) - Constructive criticism
Each survey includes:
  • Overall rating (1-5)
  • Food rating (1-5)
  • Service rating (1-5)
  • Ambiance rating (1-5)
  • Optional text comments

Resetting Demo Data

To clear demo data and start fresh:
This will delete ALL data in your database. Only do this in development/testing environments!
1

Delete customers and related data

-- Delete in order to respect foreign key constraints
DELETE FROM feedback_surveys;
DELETE FROM reservations;
DELETE FROM loyalty_transactions;
DELETE FROM customers;
DELETE FROM campaigns;
DELETE FROM locations;
DELETE FROM brands;
2

Re-run migrations (optional)

If you want to completely reset:
supabase db reset
supabase db push
3

Re-seed

Run the demo seed script again to populate fresh data.

Custom Seed Data

Create your own seed script for specific testing scenarios:

Example: Seed Your Own Restaurant

const { createClient } = require('@supabase/supabase-js');
require('dotenv').config({ path: '.env.local' });

const supabase = createClient(
  process.env.NEXT_PUBLIC_SUPABASE_URL,
  process.env.SUPABASE_SERVICE_ROLE_KEY
);

async function seedMyRestaurant() {
  // Create your brand
  const { data: brand } = await supabase
    .from('brands')
    .insert({
      name: 'My Restaurant',
      slug: 'my-restaurant',
      description: 'Fine dining in Barcelona'
    })
    .select()
    .single();

  // Create your location
  await supabase
    .from('locations')
    .insert({
      brand_id: brand.id,
      name: 'My Restaurant Barcelona',
      slug: 'my-restaurant-barcelona',
      address: 'Carrer de Provença, 123',
      city: 'Barcelona',
      postal_code: '08008',
      phone: '+34 932 123 456',
      email: '[email protected]'
    });

  console.log('✅ Your restaurant seeded!');
}

seedMyRestaurant();

Using Seed Data

Testing Features

With demo data loaded, you can test:

Dashboard Analytics

View realistic revenue charts, customer stats, and trends

Customer Segmentation

Create segments based on loyalty tier, spend, visits

Marketing Campaigns

Test campaign creation, audience selection, preview

Reservation Management

View reservation history, analytics, patterns

Loyalty Program

See tier distribution, points tracking, rewards

NPS Analysis

Analyze feedback trends, sentiment, improvements

Demo Scenarios

Use seed data to demonstrate:
  1. Customer Lifecycle: See customers progress through loyalty tiers
  2. Campaign ROI: View campaign metrics and engagement rates
  3. Location Comparison: Compare performance across 5 locations
  4. Seasonal Trends: Analyze reservation patterns over 2 years
  5. VIP Management: Identify and track top 1% customers

Production Considerations

Never run seed scripts in production! They’re designed for development and demo environments only.

Migrating from Demo to Production

When you’re ready to go live:
1

Backup your schema

supabase db dump -f schema.sql --schema public
2

Create a new production project

Set up a separate Supabase project for production.
3

Run migrations only

Apply migrations WITHOUT seed data:
supabase db push
# Do NOT run seed scripts!
4

Import real data

Use the CSV import features or API to add your actual customer data.

Troubleshooting

Cause: Using anon key instead of service role key.Solution: Ensure SUPABASE_SERVICE_ROLE_KEY is set in .env.local.
Cause: Seed data already exists.Solution:
  • Simple seed uses upsert, so this shouldn’t happen
  • For demo seed, delete existing data first (see “Resetting Demo Data” above)
Cause: Generating 5,000+ customers and 25,000+ reservations takes time.Solution:
  • Wait patiently (30-60 seconds is normal for full demo seed)
  • For faster testing, use the simple seed instead
Cause: Migrations not run or tables don’t exist.Solution: Run all migrations before seeding (see Database Setup).

Next Steps

Vercel Deployment

Deploy your seeded application to Vercel

Environment Variables

Configure production environment variables

Customer Import

Import your real customer data

Database Setup

Learn more about the database schema

Build docs developers (and LLMs) love