A modern chat interface application built with Astro, React, and Tailwind CSS, emulating the 10xChat experience with multi-threaded conversations and persistent chat history.
- Multi-threaded Conversations: Create and manage multiple chat threads
- Persistent Chat History: Chat data is saved locally and persists across sessions
- Responsive Design: Works seamlessly on desktop and mobile devices
- Real-time Chat Interface: Smooth messaging experience with loading states
- Auto-generated Titles: Thread titles are automatically generated from the first message
- Server-Side Rendering: Fast initial page loads with SSR support
/
βββ public/ # Static assets
β βββ favicon.svg
βββ src/
β βββ components/ # React components
β β βββ Avatar.tsx
β β βββ ChatInput.tsx
β β βββ ChatInterface.tsx
β β βββ ChatMessage.tsx
β β βββ ChatSidebar.tsx
β β βββ MobileHeader.tsx
β β βββ ThreadItem.tsx
β βββ hooks/ # Custom React hooks
β β βββ useChatMigration.ts
β βββ pages/ # Astro pages and API routes
β β βββ api/
β β β βββ chat.ts
β β βββ index.astro
β βββ stores/ # State management
β β βββ chatStore.ts
β βββ styles/ # Global styles
β βββ global.css
βββ astro.config.mjs # Astro configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json
- Framework: Astro 5.x with React 19 integration
- Styling: Tailwind CSS 4.x
- State Management: Zustand with persist middleware
- TypeScript: Strict configuration
- Deployment: Cloudflare Pages (configured)
- Icons: Lucide React
All commands are run from the root of the project:
| Command | Action |
|---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:3000 |
npm run build |
Build production site to ./dist/ |
npm run preview |
Preview build locally before deploying |
npm run astro |
Run Astro CLI commands |
The application uses a client-side state management approach with Zustand for handling chat threads and messages. Each chat session is organized into threads, with messages persisted to localStorage for continuity across browser sessions.
- ChatInterface: Main chat container managing thread switching and message flow
- ChatSidebar: Navigation for switching between chat threads
- ChatStore: Zustand store handling thread and message state with localStorage persistence
The chat functionality integrates with a server-side API endpoint at /api/chat for processing user messages and generating responses.