The site uses Supabase to store P(doom) submissions.
- Go to supabase.com and create a free project.
- Copy the Project URL and anon public key from Settings > API.
- Paste them into
_data/supabase.yml:
url: "https://YOUR_PROJECT.supabase.co"
anon_key: "YOUR_ANON_KEY"Open the SQL Editor in the Supabase dashboard and run:
CREATE TABLE submissions (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
submitted_at timestamptz NOT NULL DEFAULT now(),
factors jsonb,
summary jsonb,
quiz_flow_id text,
quiz_answers jsonb
);As of May 30, 2026, new Supabase projects no longer expose public tables to the Data API by default. Grant access explicitly so the anon key (used by supabase-js) can reach the table:
GRANT SELECT, INSERT ON submissions TO anon;Without this, PostgREST returns a 42501 error.
RLS is required for the anon key to work. Enable it on the table, then add policies for anonymous insert and read access:
ALTER TABLE submissions ENABLE ROW LEVEL SECURITY;
-- Allow anyone to submit predictions
CREATE POLICY "Allow anonymous inserts"
ON submissions FOR INSERT TO anon
WITH CHECK (true);
-- Allow anyone to read submissions (needed for the stats page)
CREATE POLICY "Allow anonymous reads"
ON submissions FOR SELECT TO anon
USING (true);| Column | Type | Description |
|---|---|---|
id |
bigint | Auto-incrementing primary key |
submitted_at |
timestamptz | When the prediction was registered |
factors |
jsonb | Array of {key, label, lower, upper, midpoint, spread} per stage |
summary |
jsonb | {lower, upper, midpoint, p10, p90} — the combined P(doom) result |
quiz_flow_id |
text | Which quiz path was taken: decide, beginner, medium, expert, or null if skipped |
quiz_answers |
jsonb | Array of {question_id, type, value/values} — the user's quiz selections |