How tomerzcod7/twitter-bookmarks-chatbot works
Main Components
a. Client-Side Layer:
• Next.js Frontend (App Router based)
• UI Components (shadcn/ui components)
• Authentication Interface
• Chat Interface
• File Upload Interface
b. Server-Side Layer:
• Next.js Server Components
• Server Actions
• Authentication System (NextAuth.js)
• API Routes
c. External Services:
• LLM Providers (OpenAI, Anthropic, Cohere)
• Vercel Postgres Database
• Vercel Blob Storage
• Authentication Providers
┌─ Client Layer ─────────────────────────┐
• React Components │
• UI Framework (shadcn/ui) │
• Client-side State Management │
• ┬───────────────────┘
• ↕
┌─ Application Layer ───────────────────┐
• ┌─ Next.js App Router ──────────────┐ │
• Server Components │ │
• Server Actions │ │
• API Routes │ │
• ┘ │
• ┌─ Core Services ──────────────────┐ │
• Auth Service │ │
• Chat Service │ │
• File Management │ │
• ┘ │
• ┬───────────────────────┘
• ↕
┌─ External Services ──────────────────┐
• AI Models (OpenAI, etc.) │
• Vercel Postgres │
• Vercel Blob Storage │
• Auth Providers │
• ┘
Key Relationships to Highlight
a. Authentication Flow:
• Flow from auth forms → NextAuth.js → External providers
• Session management between client and server
b. Chat Flow:
• User input → Server processing → AI Model interaction → Response handling
• Real-time updates and streaming
c. Data Persistence:
• Chat history storage in Postgres
• File storage in Blob Storage
• User data management
Implementation Details
• Annotations for important configuration points (auth.config.ts, middleware.ts)
• Version information for critical dependencies