# Blog comments — Supabase setup

Comments are stored in [Supabase](https://supabase.com) (free tier). Posts stay in `blog/posts.json` in this repo.

## 1. Create a project

1. Sign up at [supabase.com](https://supabase.com) and create a new project.
2. In **Project Settings → API**, copy:
   - **Project URL** → `supabaseUrl`
   - **anon public** key → `supabaseAnonKey`

## 2. Run the SQL

In **SQL Editor**, paste and run `blog/supabase-schema.sql`.

## 3. Configure the site

```bash
cp blog-config.example.js blog-config.js
```

Edit `blog-config.js` with your URL and anon key. Deploy `blog-config.js` with your site (it only contains the public anon key).

## 4. Test

1. Open `post.html?slug=why-i-write` locally via a server (`python -m http.server 8000`).
2. Submit a comment with name + email.
3. Check **Table Editor → blog_comments** in Supabase.

## Privacy

- **Email** is required to comment but is **not** shown on the public site (readers only see name + comment).
- You can export or delete rows from the Supabase dashboard.
