A full-stack AI-powered chat platform with OpenAI integration, Stripe subscriptions, and organization management — designed to help non-technical users interact with LLMs to build things.
Non-technical users and small teams want access to LLM capabilities (code generation, content, research) but are priced out of or overwhelmed by enterprise tools. There's a gap for a streamlined, affordable, organization-aware AI chat platform.
Built a multi-tenant Next.js SaaS platform where users sign up, choose a Stripe subscription plan, and access an AI chat powered by OpenAI GPT-4. Organizations can add members and manage usage. Prisma + PostgreSQL stores all relational data. Resend handles transactional emails.
Next.js App Router with server components for protected dashboard routes. shadcn/ui provides the chat interface, subscription management, and org settings UI. Framer Motion animates chat message entry. Chat history is streamed token-by-token using the OpenAI streaming API and rendered progressively in the UI.
Next.js API Routes handle: (1) chat completions via the OpenAI SDK with streaming response, (2) Stripe Checkout session creation and webhook handling for subscription lifecycle events, (3) organization CRUD and member invitation via Resend. All API routes are protected with session middleware.
PostgreSQL via Prisma ORM. Schema includes: users, organizations, organizationMembers, subscriptions (synced from Stripe webhooks), and chatSessions with message history stored as JSON.