How kpolley/gitchat works
Main Components
a. Client-Side (Frontend):
• Next.js Application Layer
• Authentication UI Components
• Chat Interface Components
• Theme Management
• Session Management
b. Server-Side (Backend):
• Next.js API Routes
• Authentication Service
• Vector Database
• Chat Processing Service
c. External Services:
• OpenAI API
• GitHub API
• Google OAuth
• Vector Storage
User Interface Layer (Top)
• Chat Interface (chat/, components/chat*)
• Authentication UI (sign-in/)
• Sidebar Navigation (components/sidebar*)
• Theme Controls (components/theme*)
Application Layer (Middle)
• Route Handlers (app/ directory)
• API Routes (app/api/)
• Middleware (middleware.ts)
• Actions (app/actions.ts)
Services Layer (Bottom)
• Authentication Service (auth.ts)
• Vector Database Service (generate.ts)
• Chat Processing Service (app/api/chat)
External Services (Right Side)
• OpenAI API
• GitHub Repository
• Google OAuth
• Vector Storage
Connection Flows
• User → Authentication Flow → Google OAuth
• Client → API Routes → OpenAI API
• Generate Script → GitHub Repo → Vector Database
• Chat Interface → Chat Processing → Vector Database + OpenAI
Technical Details to Note
Annotations for:
• Next.js 13+ App Router usage
• Server-side API routes
• Authentication flow with Auth.js
• Vector database implementation
• Real-time chat processing
The separation between client and server components
Remember to indicate the real-time nature of the chat system and the vector database's role in processing GitHub repository content. This will help other engineers understand both the static architecture and the dynamic data flows of the system.