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
| Entity | Details |
|---|---|
| Demo user | demo@redecasas.com.br / demo123456 |
| Property | Casa com Vista para o Mar em Florianópolis |
| Location | Florianópolis / SC |
| Price | R$ 1.250.000,00 |
| Images | 3 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:
cd chat-workernpx wrangler d1 migrations apply redecasas-chat --localRunning locally
cd chat-workernpx wrangler d1 execute redecasas-chat --local --file=./seeds/demo-listing.sqlAfter 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.
cd chat-workernpx wrangler d1 execute redecasas-chat --remote --file=./seeds/demo-listing.sqlThe 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:
| Field | Value |
|---|---|
demo@redecasas.com.br | |
| Password | demo123456 |
Customizing the listing
You can edit chat-worker/seeds/demo-listing.sql before running it to adapt the content:
- Title — Change the
titlecolumn to match your target city or property style - Price — Update the
pricecolumn (integer, in cents:125000000= R$ 1.250.000,00) - City / State — Modify
cityandstate_codeto 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 listingDELETE FROM listings WHERE id = 'b2c3d4e5-f6a7-8901-bcde-f23456789012';
-- Delete the demo userDELETE FROM users WHERE id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';Run the commands through Wrangler:
cd chat-workernpx 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';"