DEV Community

How I built a white-label AI contract SaaS with Next.js 14, GPT-4o, and Stripe

I spent the last few months building ContractAI (aicontract.live) — a full AI contract automation platform. Here's what's under the hood.

Stack

  • Next.js 14 App Router + TypeScript
  • PostgreSQL + Prisma ORM
  • NextAuth.js v5 (email + Google + GitHub)
  • Stripe subscriptions
  • 5 AI providers: OpenAI, Anthropic, Google Gemini, Groq, xAI Grok
  • Resend for emails
  • BullMQ + Redis for background jobs
  • TipTap rich text editor
  • pdf-lib + docx for exports

Key features I'm proud of

  • AI risk analysis that scans contracts and returns severity levels with fix suggestions
  • Canvas e-signatures with IP logging and full audit trail
  • Bulk generation — upload CSV, generate 50 contracts simultaneously
  • White-label support via environment variables Lessons learned
  • Streaming AI responses makes the UX feel much faster
  • Prisma + PostgreSQL on Neon is a solid free-tier combo
  • BullMQ is great for bulk jobs but Redis adds infrastructure complexity

Live demo: aicontract.live

Top comments (0)