An AI content review app built with Next.js, OpenAI, and Posthook. AI generates drafts, Posthook schedules reminders and expirations — reviewers approve, reject, or snooze before time runs out.
Live at: nextjs-starter.posthook.io
- Create a review task — AI generates a draft, Posthook schedules a reminder and expiration
- Reminder fires — webhook delivers, task status changes to "reminded"
- Expiration fires — if no one acted, the task auto-expires
- Approve / Reject / Snooze — human actions; pending hooks self-disarm via state verification
- AI content generation — OpenAI with graceful fallback to simulated drafts
- Webhook handlers — one route per hook type, each verifying HMAC signatures
- Task state machine — schedule-first ordering, conditional updates, epoch-based snooze
- Interactive dashboard — shadcn/ui with live countdowns, activity feed, real-time updates
- Session isolation — each visitor gets their own sandbox (30-min TTL)
- Seeded data — 3 pre-created tasks in different states on first visit
git clone https://github.com/posthook/nextjs-posthook-ai-review.git
cd nextjs-posthook-ai-review
npm install
docker compose up -d db
cp .env.example .env.local # add your keys
npm run db:push
SEED_REMINDER_DELAY=45s SEED_EXPIRATION_DELAY=3m npm run devIn another terminal:
npx posthook listen --forward http://localhost:3000Open http://localhost:3000 and click "Try the demo."
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes | Postgres connection string |
POSTHOOK_API_KEY |
Yes | Posthook API key (phk_...) |
POSTHOOK_SIGNING_KEY |
Yes | Posthook signing key (phs_...) |
OPENAI_API_KEY |
No | OpenAI key (falls back to simulated drafts) |
REMINDER_DELAY |
No | Default reminder delay (default: 1h) |
EXPIRATION_DELAY |
No | Default expiration delay (default: 24h) |
SEED_REMINDER_DELAY |
No | Seed task reminder delay (default: 45s) |
SEED_EXPIRATION_DELAY |
No | Seed task expiration delay (default: 3m) |
- Next.js 16 (App Router)
- Posthook for durable per-event scheduling
- OpenAI for AI content generation
- Drizzle ORM + PostgreSQL
- shadcn/ui + Tailwind CSS
- posthook/nextjs-posthook-scheduling — Simpler reminder-only starter. Vercel template.
- posthook.io — Durable scheduling API.
MIT
