How exa-labs/exa-deepseek-chat works
Key Components to Include:
Client-Side Layer
• Next.js Frontend components (located in app/page.tsx and app/layout.tsx)
• TailwindCSS styling integration
Server-Side Layer
• Next.js App Router (represented by the app/ directory structure)
• API Routes (shown in app/api/ directory):
• Chat endpoint (app/api/chat)
• Exawebsearch endpoint (app/api/exawebsearch)
External Services Layer
• Exa API for web search
• Fireworks AI API (hosting Deepseek R1 LLM)
• Vercel hosting platform
┌─────────────────────────────────────────┐
• Client Browser │
• ┬───────────────────────┘
• ↓
┌─────────────────────────────────────────┐
• Next.js Frontend Layer │
• ┌─────────────┐ ┌────────────────┐ │
• page.tsx │ │ layout.tsx │ │
• ┘ └────────────────┘ │
• ↓ ↓ │
• ┌─────────────────────────────────────┐│
• TailwindCSS Styling ││
• ┴─────────────────┬───────────────────┘│
• ↓
┌──────────────────────────────────────────┐
• Next.js API Routes Layer │
• ┌─────────────┐ ┌────────────────┐ │
• /api/chat │ │/api/exawebsearch│ │
• ┬──────┘ └────────┬───────┘ │
• ┼─────────────────────┼─────────┘
• ↓ ↓
┌─────────────────┐ ┌────────────────┐
• Fireworks AI │ │ Exa API │
• (Deepseek R1) │ │ (Web Search) │
• ┘ └────────────────┘
• Use blue for client-side components
• Use green for server-side components
• Use orange for external services
• Use grey for infrastructure components
Important Elements to Highlight:
Data Flow
• How user queries flow from the frontend through the API routes
• Parallel calls to Exa API for web search and Fireworks AI for LLM processing
• How responses are streamed back to the client
Integration Points
• Vercel AI SDK integration points
• API key authentication points for both Exa and Fireworks AI
• Where environment variables are used
Key Technologies
• Next.js App Router architecture
• TailwindCSS styling system
• TypeScript implementation
• Vercel deployment infrastructure
Additional Notes:
• Version numbers for major dependencies
• Middleware.ts integration point
• Where environment variables (.env) are used
• Error handling and fallback paths