Build your own multi-model AI chat app with 120+ models, authentication, streaming, and advanced features.
Next.js 15 • Vercel AI SDK • Shadcn/UI • Better Auth • Drizzle ORM
Ship a full-featured AI chat in minutes with Claude, GPT-4, Gemini, Grok, and 120+ models through Vercel AI Gateway.
- Next.js 15 - App Router, React Server Components
- TypeScript - Full type safety
- Vercel AI SDK v5 - Unified AI provider integration with 120+ models
- Better Auth - Authentication & authorization
- Drizzle ORM - Type-safe database queries
- PostgreSQL - Primary database
- Redis - Caching & resumable streams
- Vercel Blob - Blob storage
- Shadcn/UI - Beautiful, accessible components
- Tailwind CSS 4 - Styling
- tRPC - End-to-end type-safe APIs
- Zod 4 - Schema validation
- Zustand - State management
- Motion - Animations
- t3-env - Environment variables
- Pino - Structured Logging
- Langfuse - LLM observability & analytics
- Vercel Analytics - Web analytics
- Biome - Code linting and formatting
- Ultracite - Biome preset for humans and AI
- Streamdown - Markdown for AI streaming
- AI Elements - AI-native Components
- AI SDK Tools - Developer tools for AI SDK
- 🤖 120+ AI Models - Claude, GPT-5, Gemini, Grok via Vercel AI Gateway
- 🔐 Auth & Sync - Secure authentication with cross-device chat history
- 🎯 Try Without Signup - Guest access for instant demos
- 📎 Attachments - Images, PDFs, documents in conversations
- 🎨 Image Generation - AI-powered image creation and editing
- 💻 Syntax Highlighting - Code formatting for all languages
- 🔄 Resumable Streams - Continue after interruptions
- 🌳 Chat Branching - Alternative conversation paths
- 🔗 Chat Sharing - Share conversations with others
- 🔭 Deep Research - Real-time web search with citations
- ⚡ Code Execution - Secure Python/JavaScript sandboxes
- 📄 Document Creation - Generate docs, spreadsheets, presentations
-
Clone and Install
git clone https://github.com/franciscomoretti/sparka.git cd sparka bun install -
Environment Setup
cp .env.example .env.local
Required:
POSTGRES_URL- Database connectionAI_GATEWAY_API_KEY- Vercel AI GatewayBLOB_READ_WRITE_TOKEN- Vercel Blob read/write tokenCRON_SECRET- Cron job authenticationAUTH_SECRET- Better Auth secretAUTH_GOOGLE_ID/AUTH_GOOGLE_SECRET- Google OAuthAUTH_GITHUB_ID/AUTH_GITHUB_SECRET- GitHub OAuth
Optional:
REDIS_URL- For resumable streamsOPENAI_API_KEY- Direct OpenAI accessTAVILY_API_KEY- Web searchEXA_API_KEY- Web searchFIRECRAWL_API_KEY- Web scrapingSANDBOX_TEMPLATE_ID- Code execution
-
Database Setup
bun run db:migrate
-
Development Server
bun dev
Visit http://localhost:3000 to start building.