Review Desk

Review Desk is a Next.js app for AI-assisted community moderation. It stores demo forum state in Redis, runs a durable triage workflow, and escalates borderline cases to Slack for a human moderator decision.

This local checkout does not currently have a Git remote configured. After publishing the project, replace the deploy button's repository-url with the real GitHub repository URL.

Local Development

Install dependencies and start the development server:

pnpm install
pnpm dev

Open http://localhost:3000.

Environment Variables

Create a .env.local file in the project root. Next.js loads .env* files from the root directory and keeps non-NEXT_PUBLIC_ variables server-side.

AI_GATEWAY_API_KEY=

KV_REST_API_URL=
KV_REST_API_TOKEN=
REDIS_URL=

SLACK_BOT_TOKEN=
SLACK_SIGNING_SECRET=
SLACK_MOD_QUEUE_CHANNEL_ID=
VariableRequiredUsed byNotes
AI_GATEWAY_API_KEYYes@workflow/ai / AI SDKAuthenticates model calls for the triage agent. The app currently uses anthropic/claude-haiku-4.5 through AI Gateway.
KV_REST_API_URLYes, unless using UPSTASH_REDIS_REST_URL@upstash/redisRedis REST URL for forum posts and audit data. Vercel KV/Redis integrations usually provide this automatically.
KV_REST_API_TOKENYes, unless using UPSTASH_REDIS_REST_TOKEN@upstash/redisRedis REST token. Keep this secret.
REDIS_URLYes@chat-adapter/state-redisRedis connection URL for Chat SDK state, locks, dedupe, and subscriptions. Upstash provides this separately from REST.
SLACK_BOT_TOKENYes@chat-adapter/slackSlack bot token, usually starting with xoxb-. The bot posts moderation cards and replies.
SLACK_SIGNING_SECRETYes@chat-adapter/slackVerifies incoming Slack interactivity webhook requests.
SLACK_MOD_QUEUE_CHANNEL_IDYeslib/post-mod-card.tsSlack channel ID where escalated moderation cards are posted, for example C0123456789.

Slack Setup

Create a Slack app with a bot token and interactivity enabled.

  1. Add the bot to the moderation channel and copy that channel's ID into SLACK_MOD_QUEUE_CHANNEL_ID.
  2. Set the Slack interactivity request URL to:
https://<your-deployment-domain>/api/webhooks/slack
  1. Copy the Slack signing secret into SLACK_SIGNING_SECRET.
  2. Copy the bot token into SLACK_BOT_TOKEN.

Deploying to Vercel

The deploy button pre-prompts for the required AI Gateway, Redis, and Slack variables. You can also configure them manually in Vercel Project Settings.

Recommended Vercel setup:

  • Add a Vercel Redis or Upstash Redis integration so Redis REST variables are available.
  • Add the Redis connection URL as REDIS_URL for Chat SDK state.
  • Add AI_GATEWAY_API_KEY for model access.
  • Add the Slack variables listed above.
  • After the first deployment, update the Slack interactivity request URL to the production domain.

Scripts

pnpm dev
pnpm build
pnpm start
pnpm lint