Skip to content

Latest commit

 

History

History
127 lines (94 loc) · 3.73 KB

File metadata and controls

127 lines (94 loc) · 3.73 KB

Dummy Data Setup

This guide explains how to populate your database with test data for development and testing.

Quick Start

  1. Run the dummy data script in your Supabase SQL Editor:
-- Copy and paste the contents of supabase-dummy-data.sql
-- Or run it via Supabase CLI:
supabase db execute -f supabase-dummy-data.sql

What's Included

Test Profiles

  • 3 test business user profiles
  • Note: These use placeholder UUIDs. In production, profiles are created automatically via Supabase Auth.

Sample Listings (9 listings)

  • Münchner Elektro-Service - Premium Elektriker in München
  • Bayern Sanitär & Heizung - Premium Plus Klempner
  • Farbenreich Malerbetrieb - Basic Maler
  • Holzwerkstatt München - Premium Schreiner
  • Dach & Fassade Bayern - Basic Dachdecker
  • Wärme & Energie München - Premium Heizungsbauer
  • Bauwerk München GmbH - Premium Plus Bauunternehmen
  • Nürnberg Elektro - Basic Elektriker in Nürnberg
  • Augsburger Maler - Basic Maler in Augsburg

Sample Reviews

  • Reviews for various listings with different ratings
  • All set to 'approved' status for immediate visibility

Sample Leads

  • A few sample customer inquiries
  • Different statuses (new, contacted)

Important Notes

User IDs

The dummy data uses placeholder UUIDs for user profiles:

  • 00000000-0000-0000-0000-000000000001
  • 00000000-0000-0000-0000-000000000002
  • 00000000-0000-0000-0000-000000000003

If you get errors about profiles not existing:

  1. Option 1: Create auth users in Supabase Dashboard first, then update the UUIDs in the script to match
  2. Option 2: Create profiles manually in the database that match these UUIDs
  3. Option 3: Modify the script to use existing profile IDs from your database

Images

  • All images use Unsplash placeholder URLs
  • In production, upload real images to Supabase Storage
  • The URLs will work for testing but may be slow

Opening Hours

  • Opening hours are stored as JSONB
  • Format: {"monday": "08:00-18:00", "tuesday": "08:00-18:00", ...}
  • The component handles various formats

Testing Features

With this dummy data, you can test:

Search & Filters

  • Search by location (München, Nürnberg, Augsburg)
  • Filter by category
  • Filter by rating
  • Filter by verified status

Listing Details

  • View full listing information
  • See images in lightbox gallery
  • View Google Maps location
  • See opening hours
  • Submit contact form (leads)

Reviews

  • View existing reviews
  • Submit new reviews (works without auth for testing)

Different Subscription Tiers

  • Basic listings
  • Premium listings (with badge)
  • Premium Plus listings

Customization

You can easily modify the dummy data:

  1. Add more listings: Copy a listing INSERT statement and modify the values
  2. Change locations: Update city, zip_code, latitude, longitude
  3. Add more reviews: Insert additional review records
  4. Modify categories: Use different category IDs from your categories table

Troubleshooting

Error: "null value in column user_id"

  • Make sure the test profiles exist first
  • Or update the user_id values to match existing profiles

Error: "foreign key constraint"

  • Ensure categories exist (run the main schema first)
  • Check that category slugs match your categories table

Reviews not showing

  • Check that review status is 'approved'
  • Verify the listing_id matches an existing listing

Images not loading

  • Unsplash URLs should work, but may be slow
  • Check your internet connection
  • In production, use Supabase Storage URLs

Next Steps

After loading dummy data:

  1. Test the search functionality
  2. Browse listing detail pages
  3. Submit test leads via contact forms
  4. Submit test reviews
  5. Test all filter combinations