Pular para o conteúdo

Demo Listing Seed

The demo listing seed inserts a pre-built user account and a premium property listing directly into D1. The listing description doubles as marketing copy for RedeCasas, making it useful for demos, local development, and soft launches.

What the seed creates

EntityDetails
Demo userdemo@redecasas.com.br / demo123456
PropertyCasa com Vista para o Mar em Florianópolis
LocationFlorianópolis / SC
PriceR$ 1.250.000,00
Images3 Unsplash photos (sea-view house)

The property description includes persuasive marketing content about RedeCasas — reach, free listings, AI chat, and no bureaucracy — encouraging visitors to create an account and publish their own properties.

Prerequisites

Make sure the D1 database exists and migrations have been applied:

Terminal window
cd chat-worker
npx wrangler d1 migrations apply redecasas-chat --local

Running locally

Terminal window
cd chat-worker
npx wrangler d1 execute redecasas-chat --local --file=./seeds/demo-listing.sql

After running the seed, the following pages become fully functional:

  • /imoveis/ — Displays the demo listing in the public catalog
  • /cadastro-imovel/ — Demo preview card renders with real data
  • /login/ — You can log in with the demo credentials to test the authenticated flow
  • /conta/imoveis/ — Manage the demo listing as the logged-in owner

Running in production

⚠️ Warning: Only run this in production if you intentionally want a visible demo listing on the live site.

Terminal window
cd chat-worker
npx wrangler d1 execute redecasas-chat --remote --file=./seeds/demo-listing.sql

The listing will appear publicly on /imoveis/ and in search results. Remove it as soon as real listings are published.

Demo credentials

Use these credentials to test authentication and the owner dashboard:

FieldValue
Emaildemo@redecasas.com.br
Passworddemo123456

Customizing the listing

You can edit chat-worker/seeds/demo-listing.sql before running it to adapt the content:

  • Title — Change the title column to match your target city or property style
  • Price — Update the price column (integer, in cents: 125000000 = R$ 1.250.000,00)
  • City / State — Modify city and state_code to your region
  • Description — Replace the marketing paragraphs while keeping the || concatenation syntax
  • Images — Swap the Unsplash URLs for your own R2 URLs or other image hosts

Adding more marketing listings

Duplicate the INSERT OR IGNORE INTO listings block and assign new UUIDs to id and user_id. Each additional listing should also have corresponding rows in listing_images with unique id values.

Removing demo data

To delete the demo user and all associated listings:

-- Delete images first (foreign key safety)
DELETE FROM listing_images WHERE listing_id = 'b2c3d4e5-f6a7-8901-bcde-f23456789012';
-- Delete the listing
DELETE FROM listings WHERE id = 'b2c3d4e5-f6a7-8901-bcde-f23456789012';
-- Delete the demo user
DELETE FROM users WHERE id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';

Run the commands through Wrangler:

Terminal window
cd chat-worker
npx wrangler d1 execute redecasas-chat --local --command="DELETE FROM listing_images WHERE listing_id = 'b2c3d4e5-f6a7-8901-bcde-f23456789012'; DELETE FROM listings WHERE id = 'b2c3d4e5-f6a7-8901-bcde-f23456789012'; DELETE FROM users WHERE id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';"