baychat is an open-source AI chatbot application built with TanStack Start, Convex, and the Vercel AI SDK.
It supports multiple AI providers, real-time messaging, and chat organization.
- Google Gemini
- OpenAI
- Anthropic
- OpenRouter
- BYOK (Bring your own API keys)
- Real-time streaming responses
- Organize chats with folders
- Pin or branch conversations
- Share chats with others
- Edit or regenerate messages
- Light and dark themes
- Code syntax highlighting (Shiki)
- Math rendering (KaTeX)
- Markdown support
- Generate images from text prompts
- Support for multiple image generation models
- Download and share generated images
- GitHub and Google OAuth (via Better Auth)
Frontend
- TanStack Start (full-stack React framework)
- TanStack Query (server state management)
- ShadCN (UI components)
- Zustand (client state management)
Backend
- Convex (real-time database and backend)
- Better Auth (authentication library)
- Vercel AI SDK (AI model integration)
- Zod (schema validation)
AI Providers
- OpenAI (GPT models)
- Anthropic (Claude models)
- Google (Gemini models)
- xAI (Grok models)
- OpenRouter (unified AI API)
- BYOK support for all above providers
Development
- Oxlint for linting and Oxfmt for formatting
- Node.js 18+
- Any package manager (bun used here)
- Git
-
Clone the repository:
git clone https://github.com/ankitk26/baychat.git cd baychat -
Install dependencies:
bun install
-
Set up Convex:
npx convex dev
Follow the prompts to create a new Convex project and get your deployment URL.
-
Create a
.env.localfile in the root directory:# Convex (Required) CONVEX_DEPLOYMENT=dev:your_project_name VITE_CONVEX_URL=https://your_project_url.convex.cloud VITE_CONVEX_SITE_URL=https://your_project_url.convex.site # Site URL (Required) VITE_SITE_URL=http://localhost:3000 # BetterAuth (Required for authentication) BETTER_AUTH_SECRET=your_better_auth_secret # GitHub OAuth (Required for authentication) GITHUB_CLIENT_ID=your_github_client_id GITHUB_CLIENT_SECRET=your_github_client_secret # Google OAuth (Required for authentication) GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret # Optional: API keys for AI providers GOOGLE_GENERATIVE_AI_API_KEY=your_google_api_key ANTHROPIC_API_KEY=your_anthropic_api_key
-
Run the development server:
bun run dev
-
Open your browser and navigate to
http://localhost:3000
- Sign in with your GitHub or Google account
- Configure API keys in settings (optional - you can use OpenRouter for all models)
- Start chatting with any available AI model
- Organize chats by creating folders and pinning important conversations
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Check the code comments and type definitions