A clean, fast chat dashboard with expert personas, authenticated personal workspaces, streaming replies, attachments, and readable code blocks.
Built with Next.js (App Router) + Vercel AI SDK + Supabase.
- Expert personas: switch between different “experts” with their own system prompts.
- Supabase Auth: sign up, sign in, sign out, and change password flows are built in.
- Multi-session chat: sessions list + titles + last-message preview.
- User-isolated chat history: sessions and messages are scoped to the authenticated user.
- Streaming responses: responsive UI while the model streams tokens.
- Attachments: upload images/files to Supabase Storage and send them with messages.
- Markdown + code blocks: readable rendering with syntax highlighting.
Create .env.local:
cp .env.local.example .env.localRequired:
OPENAI_API_KEY– your OpenAI API keyOPENAI_MODEL– e.g.gpt-5-mini(model is not hardcoded in code)
Supabase (recommended for sessions/experts/attachments):
PUBLIC_SUPABASE_URLPUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY
bun install
bun devOpen http://localhost:3000.
Authentication UI is available at http://localhost:3000/auth.
- Create a Supabase project.
- Run
supabase/schema.sqlin the Supabase SQL Editor. - Enable Supabase Auth email/password sign-in for the project.
- If email confirmation is enabled, new users must activate their account from email before signing in.
- Create a public Storage bucket named
chat-attachments.
The database schema now assumes authenticated access:
chat_sessions.user_idowns each chat session.chat_messagesinherit ownership throughsession_id.- Row Level Security allows users to read/write only their own sessions and messages.
expertsremain global/shared and are not user-owned.
This repo includes a production Docker build for the Next.js app:
docker compose up -d --buildApp is exposed at http://localhost:3202 (mapped from container 3000).
Tip: for Docker envs, set OPENAI_API_KEY, OPENAI_MODEL, PUBLIC_SUPABASE_URL, and PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY in your deployment platform or docker-compose.yml.
app/– Next.js routes (UI + API routes)components/botchat/– chat UI (sessions, experts, input, panels)components/ai-elements/– AI-friendly UI primitives (rendering, message building blocks)lib/– shared utilities + Supabase clientssupabase/schema.sql– database schema + RLS policies
bun dev # local dev
bun run build # production build
bun start # run production server on :3000