A production AI chat application with streaming responses
A full-stack AI chat app built with Next.js 15, OpenAI, and Supabase. Streams responses chunk-by-chunk, persists conversation history, and ships with a beautiful glassmorphism UI.
What's included
- SSE streaming — responses render token by token via ReadableStream
- OpenAI integration — real SDK with mock fallback (app runs without an API key)
- Conversation history — chats and messages in Supabase with localStorage fallback
- Chat sidebar — create, switch, and delete conversations
- Streaming UI — typing caret, auto-scroll, loading states
- Configurable system prompt — via environment variable
- Dark glassmorphism — modern, premium look
- TypeScript strict — fully typed
Quick Start
npm install
cp env.example .env # add OPENAI_API_KEY
npm run dev
Stack
Next.js 15 · React 19 · OpenAI · Supabase · TypeScript · Tailwind
Use cases
- AI support assistants
- Internal knowledge bots
- Chatbot MVPs
- AI product demos