A production-grade ChatGPT-style AI chat interface built with React, TypeScript, Vite, and TailwindCSS.
- React + TypeScript + Vite
- TailwindCSS for styling
- Zustand for state management
- TanStack Query for async state
- react-markdown + remark-gfm for markdown rendering
- Lucide React for icons
npm install
npm run devOpen http://localhost:5173 to view the app.
In development, a mock API is included so you can use the UI without a backend. It returns placeholder responses for /api/chat and /api/chat/stream.
See docs/LLM_CONNECTION_GUIDE.md for step-by-step instructions to connect to:
- ChatGPT (OpenAI) – API key setup, Node.js/Python backend examples
- Claude (Anthropic) – Backend integration
- Custom LLMs – Gemini, Llama, or any compatible API
Configure your backend via environment variables (see .env.example):
VITE_API_BASE_URL– Your API base URL (e.g.https://api.example.com)VITE_LLM_PROVIDER–openai|anthropic|customVITE_ENABLE_STREAMING– Enable/disable streaming responses
Security: Never expose LLM API keys in the frontend. Use a backend proxy to call LLM providers.
src/
├── app/ # App shell, router, providers
├── api/ # API client, endpoints, chat API
├── components/ # UI components (chat, layout, ui)
├── config/ # Environment and LLM config
├── features/chat/ # Chat hooks, services, store, types
├── llm/ # LLM providers (OpenAI, Anthropic, custom)
├── lib/ # Utilities, markdown, stream parser
├── hooks/ # Shared hooks
├── styles/ # Global CSS
└── types/ # Global types
- ✅ Text and streaming responses
- ✅ Markdown, code blocks, tables, links
- ✅ Image, video, audio media rendering
- ✅ Multiple conversations with sidebar
- ✅ Create, switch, delete chats
- ✅ Persisted chat history (localStorage)
- ✅ Configurable LLM providers