Open-source AI chat workspace you can self-host or run on OpenChat Cloud
Features • Quick Start • Deployment • Docs • Contributing
OpenChat is a modern, open-source AI chat platform that combines a streaming TanStack Start frontend with Convex for real-time persistence and live sync. It features Better Auth (GitHub OAuth), OpenRouter integration for 100+ AI models, and a beautiful Tailwind v4 + shadcn design system.
The monorepo is managed with Turborepo and Bun, keeping the web app, Convex functions, shared packages, and browser extension in lockstep.
|
|
|
|
|
|
| Layer | Technologies |
|---|---|
| Frontend | TanStack Start (Vite), React 19, TypeScript, Tailwind CSS v4, shadcn/ui |
| Backend | Convex (real-time database), Better Auth |
| AI | OpenRouter (AI SDK 6), 100+ models |
| Tooling | Bun 1.3+, Turborepo, Vitest, Oxlint |
| Analytics | PostHog, Vercel Analytics |
| DevOps | Docker, GitHub Actions |
openchat/
├── apps/
│ ├── web/ # TanStack Start frontend
│ │ ├── src/routes/ # File-based routing
│ │ ├── src/components/
│ │ └── src/stores/ # Zustand state management
│ ├── server/ # Convex backend
│ │ └── convex/ # Database schema & functions
│ └── extension/ # Browser extension (WXT + React)
├── docs/ # Documentation
│ └── deployment/ # Docker & Dokploy guides
├── docker/ # Dockerfile images
└── scripts/ # Operational scripts
- Bun
>= 1.3.0 - Node.js
>= 20(for tooling) - Convex CLI (auto-installed during dev)
# Clone the repository
git clone https://github.com/opentech1/openchat.git
cd openchat
# Install dependencies
bun install-
Copy environment templates:
cp env.web.example apps/web/.env.local cp env.server.example apps/server/.env.local
-
Configure required variables:
VITE_CONVEX_URL- Convex deployment URLVITE_CONVEX_SITE_URL- Convex HTTP actions URL- GitHub OAuth credentials (in Convex dashboard)
BETTER_AUTH_SECRET- Session secret
-
Optional variables:
OPENROUTER_API_KEY- Server API key for free tierVALYU_API_KEY- Web search integrationVITE_POSTHOG_KEY- AnalyticsREDIS_URL- Distributed rate limiting
# Start full development environment
bun dev
# Frontend on http://localhost:3001
# Convex backend runs automatically| Command | Description |
|---|---|
bun dev |
Start full dev environment |
bun dev:web |
Frontend only |
bun dev:server |
Convex backend only |
bun check |
Lint with Oxlint |
bun check-types |
Type checking |
bun test |
Run test suite |
bun build |
Production build |
Deploy the frontend to Vercel with Convex Cloud for the backend:
# Production deployment
docker compose up -dSee docs/deployment/ for detailed Docker and Dokploy guides.
Single Instance (default): In-memory rate limiting, no setup required.
Multi-Instance: Enable Redis for distributed rate limiting:
# Set Redis URL
export REDIS_URL=redis://localhost:6379
# Or with Docker
docker run -d -p 6379:6379 redis:alpine| Document | Description |
|---|---|
| ENVIRONMENT.md | Environment variables guide |
| deployment/ | Docker & Dokploy setup |
| SYNC.md | Real-time sync architecture |
| CONTRIBUTING.md | Contribution guidelines |
| CODE_OF_CONDUCT.md | Community standards |
We're grateful to our sponsors who help make OpenChat possible:
|
|
|
|
|
|
Thanks to all the amazing people who have contributed to OpenChat!
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use TypeScript with strict mode
- Follow the existing code style (Oxlint enforced)
- Write tests for new features
- Update documentation as needed
- Use conventional commits
- GitHub Issues - Bug reports & feature requests
- GitHub Discussions - Questions & community chat
- Discord - Real-time community support
Found a security vulnerability? Please report it responsibly by emailing security@openchat.dev or through our security policy.
OpenChat is open-source software licensed under the GNU Affero General Public License v3.