Clarifai is a Next.js 16 relationship mediation app that helps couples and roommates move through conflict with AI-guided, evidence-based conversation support.
- Create or join a private room with a shareable code
- Submit perspectives from both participants
- Get AI analysis and suggested compromises
- Move into a turn-based live chat with real-time guidance
- End sessions with anonymized research aggregation
- Next.js 16 (App Router) + TypeScript
- Supabase (Auth, Postgres, Realtime, RLS)
- Vercel AI Gateway (Claude Haiku 4.5) for analysis and guidance
- Tailwind CSS v4 + Radix UI
- Create room (
/create) or join (/joinor/r/[code]) - Submit entries (
/room/[roomId]) - AI analysis (
/room/[roomId]/waiting) - Reveal insights (
/room/[roomId]/reveal) - Live chat (
/room/[roomId]/chat) - Complete (
/room/[roomId]/complete)
- Node.js 20+
- npm 10+
- Supabase project (URL + anon key + service role key)
- Vercel AI Gateway API key
Create .env.local:
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
AI_GATEWAY_API_KEY=npm install
npm run devOpen http://localhost:3000.
npm run dev
npm run build
npm run start
npm run lint- Room access is enforced with Supabase RLS and
requireRoomMember()auth middleware. - Tone checks fail closed: if AI is unavailable, messages are warned rather than allowed.
- Realtime subscriptions must be cleaned up to avoid leaked channels.
Create room -> Join -> Submit -> Analyze -> Reveal -> Chat -> Pause -> End session.
Build and run with:
npm run build
npm run start