Repository navigation
Description
Why
Right now, after a fresh supabase db reset, the dashboard is empty. To see anything beyond the empty-state screens, a contributor has to:
- Sign up locally
- Create a brand, topics, prompts
- Configure provider API keys (
ANTHROPIC_API_KEYfor the direct-API path,CLORO_API_KEYfor the scraper-backed answer engines) — the scraper is a paid third-party service - Run a tracking job and wait for webhooks
That's a lot of friction for someone whose actual goal is a UI tweak. The result is that contributors hit empty pages, can't tell what their change does, and either give up or rely on us to hand-hold them past it. (See #38 for a recent example where a contributor working on a UI feature got stuck here.)
What we want
A supabase/seed.sql that runs automatically on supabase db reset and populates the local database with realistic-but-clearly-fake demo data — enough to drive every UI surface in the dashboard.
After running supabase db reset, the contributor should be able to:
- Sign in as a known demo user (e.g.
[email protected]/demo123) - Land on a dashboard already wired to a demo brand
- See populated Insights, Citations, Competitors, Content Opportunities, and AI Traffic pages
- Apply filters (date range, platform, model, region, topic) and watch the data react
What to seed
A deterministic, single-organization fixture is enough. Suggested shape:
- 1 organization (
Demo Org, planself_hosted) - 1 auth user + profile (
[email protected], passworddemo123, roleowner) - 1 brand (something obviously fake like
Acme CoffeeorDemo Brand— please don't use a real company name) - 2 topics under the brand (e.g.
Coffee subscription services,Espresso machines under $500) - 6–10 prompts spread across the topics
- ~80–120
prompt_resultsrows that cover the platforms / models / regions we actually track.
Platforms and models
The value that ends up in prompt_results.platform is the id field of a scraper in SCRAPER_GROUPS in web/src/config/prompt-options.ts, plus claude for the direct-API row. The accompanying model_used value varies: ChatGPT and Grok return a model identifier; most other scraper-backed engines echo the platform name back. Use this set as a starting point — read the file when you write the seed in case it has evolved:
platform |
typical model_used values |
|---|---|
chatgpt-web |
gpt-5-5, gpt-5-3-mini |
claude |
claude-sonnet-4-6 |
copilot-web |
copilot-web |
gemini-web |
gemini-web |
google-aimode |
google-aimode |
google-aio |
google-aio |
grok-web |
grok-3 |
perplexity-web |
perplexity-web |
For the seed, ChatGPT rows should split across both gpt-5-5 and gpt-5-3-mini so the model filter has something to discriminate on within the same platform.
Regions
A mix of region values drawn from REGIONS in web/src/config/prompt-options.ts — uppercase ISO-3166 codes (US, GB, DE, FR, TR, …). Pick four or five so the region filter is meaningful.
Other columns
created_atspread over the last 30 days so the time-series charts have a curve to draw- Realistic
mention_count,citation_count,visibility_score,sentiment(mix ofpositive/neutral/negative) citationsJSONB with 2–5 plausible URLs each (useexample.com,wikipedia.org,reddit.com— nothing real)competitor_mentionsJSONB referencing a small set of fake competitor names
Supporting rows
- 3–5
competitorsfor the brand - 2–3
content_opportunities - A few
ai_traffic_logsrows (so that page isn't empty either)
Use fixed UUIDs throughout ('00000000-0000-0000-0000-000000000001' style) so the seed is idempotent — running supabase db reset twice should produce the same database, not duplicates.
Source of truth: the catalog of platforms, models, and regions lives in
web/src/config/prompt-options.ts. The table above is a snapshot. Read the file when you write the seed so you stay in sync — and if anything in the table looks stale by the time you pick this up, trust the code, not the issue body.
Where it goes
supabase/seed.sql— the seed itself. Supabase runs this automatically after migrations onsupabase db reset(see https://supabase.com/docs/guides/local-development/seeding-your-database).- Update docs/self-host/supabase-setup.mdx and README.md with the demo login.
Constraints
- No real customer / brand names anywhere. Use obvious placeholders (
Acme,Demo,Fixture). - Idempotent. Use
INSERT … ON CONFLICT DO NOTHINGor fixed UUIDs so re-running is safe. - Self-contained. No dependency on cloud-only env, Stripe, scraper providers, or LLM keys. The seed should populate everything the UI needs to render.
- Local-only. The
supabase/seed.sqlconvention already restricts this tosupabase db reset— nothing here should be runnable against a production database.
How to verify
- Fresh checkout, run
supabase db reset— completes without errors -
pnpm dev(web + server), openhttp://localhost:3000, sign in with the demo credentials - Dashboard renders with a brand, topics, prompts visible
- Insights page shows charts with data points spread over the last 30 days
- Citations page lists rows with URLs
- Competitors page shows the seeded competitors
- Content Opportunities page shows the seeded opportunities
- AI Traffic page shows traffic rows
- Platform / model / region / topic filters all return non-empty subsets
- Run
supabase db reseta second time — no duplicate rows, no errors - No real-world brand / company name appears in any of the seed data
Out of scope
- A mock-provider mode that synthesizes new tracking results on demand (separate, larger piece of work — tracked in Idea: a MOCK_PROVIDERS mode so contributors can iterate on tracking without paid API keys #72)
- Billing / Stripe fixtures — local dev defaults to
self_hostedand skips subscription checks - E2E test fixtures — those live in
__tests__and should not depend on this seed
Contribution guide
See CONTRIBUTING.md for branch naming, commit conventions, and PR workflow.
Activity
feat(dx): Supabase seed.sql for a populated local dashboard (ansvisor#75