Daily digest and message backup system
| data | ||
| public | ||
| src/app | ||
| .gitignore | ||
| eslint.config.mjs | ||
| next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.mjs | ||
| README.md | ||
| tsconfig.json | ||
Daily Digest Blog
Next.js App Router blog with Supabase-backed posts and an authenticated admin panel.
Run locally
npm install
npm run dev
Dev server runs on http://localhost:3002.
Environment variables
Set these in .env.local:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEY(used by external scripts/tools if needed)CRON_API_KEY
Public vs admin access
- Public blog (
/) is open to everyone. - Reading messages (
GET /api/messages) is public. - Admin UI (
/admin) requires a signed-in Supabase user. - If not signed in,
/adminredirects to/login. - Write APIs (
POST/DELETE /api/messages) require either:- a valid Supabase user bearer token, or
x-api-key: <CRON_API_KEY>(for automation/cron).
Login flow
- Open
/login - Sign in with a Supabase Auth email/password user
- You are redirected to
/admin
Digest automation endpoint
POST /api/digestrequiresx-api-key: <CRON_API_KEY>- Used for cron-based digest publishing