Skip to content

Project Overview

A ChatGPT-style chat application where users type messages and receive streaming AI responses. The app supports multiple conversations, message history, and rich markdown rendering.

  • Message list with user and AI messages
  • Input field with send button
  • Loading indicator during streaming
  • Auto-scroll to latest messages
  • AI responses appear word-by-word (streaming)
  • Cancel in-progress responses
  • Error handling with retry
  • Create new conversations
  • Switch between conversations
  • View conversation history
  • Delete conversations
  • Markdown support in AI responses
  • Code syntax highlighting
  • Links rendered as clickable
  • Copy code button
flowchart TD
User[User Types Message] --> UI[Chat Interface]
UI --> SC[Server Action]
SC --> AI[OpenAI/LLM API]
AI -->|Stream| SC
SC -->|Stream| UI
UI --> DB[(Database)]
RoutePurpose
/chatMain chat interface
/chat/[id]Specific conversation
  • Use the Vercel AI SDK for streaming
  • Build Server Actions that return streams
  • Manage conversation state
  • Persist chat messages in a database
  • Handle streaming UI updates with React