9bafe9fbf22994a0702de791b79ba659282d46f7
Modern, responsive chat interface inspired by Open WebUI. Supports OpenAI-compatible API with streaming responses, token analysis, and RAG knowledge bases.
🚀 Quick Start (Docker)
cp .env.example .env
# Edit .env — set your API URL and key
docker compose up --build -d
# Open http://localhost
🏗️ Development
Backend
cd backend
npm install
npm run dev # port 3001
Frontend
cd frontend
npm install
npm run dev # port 5173 (with HMR)
✨ Features
| Feature | Description |
|---|---|
| 💬 Chat | Streaming messages with markdown & LaTeX |
| ⚙️ Settings | Model, system prompt, temperature, tokens |
| 📊 Token Analysis | Usage stats panel (tokens/sec, context, cost) |
| 📁 Attachments | Image upload + analysis |
| 📚 Knowledge Bases | RAG with multiple bases, file/folder upload |
| 🎨 Theme | Dark mode, accent colors |
| 📱 Responsive | Works on mobile and desktop |
🏛️ Architecture
┌──────────────────┐ ┌──────────────┐ ┌─────────────────┐
│ Nginx (80) │────────▶│ Backend │────────▶│ OpenAI API │
│ SPA + /api/* │ │ (Node.js) │ │ (or compatible)│
└──────────────────┘ └──────────────┘ └─────────────────┘
│
▼
┌──────────────┐
│ sqlite db │
│ (chats) │
└──────────────┘
🔧 Environment Variables
| Variable | Default | Description |
|---|---|---|
OPENAI_API_URL |
https://api.openai.com/v1 |
API endpoint |
OPENAI_API_KEY |
- | Your API key |
DEFAULT_MODEL |
gpt-4o-mini |
Default model ID |
JWT_SECRET |
random | JWT secret |
NODE_ENV |
development |
Environment |
🐳 Production
docker compose -f docker-compose.yml up -d --build
Nginx serves static frontend + proxies /api to backend.
📂 Project Structure
├── frontend/ # Vite + React + TypeScript + Tailwind
│ ├── src/components/ # Chat, UI, Layout components
│ ├── src/stores/ # Zustand store
│ ├── src/services/ # API client
│ └── Dockerfile
├── backend/ # Express + proxy + chat storage
│ ├── src/index.js # Main server
│ └── Dockerfile
├── nginx/ # Reverse proxy config
└── docker-compose.yml # Full stack
📜 License
MIT
Languages
TypeScript
80.5%
JavaScript
16.4%
CSS
2.2%
Dockerfile
0.6%
HTML
0.3%