How rohittcodes/heymate works
Main System Components
a) Client Layer:
• Next.js Frontend (app directory structure)
• Authentication UI components (/(auth) route)
• Main Application UI components (/(main) route)
• Global UI components
b) Server Layer:
• API Routes (/api directory)
• Authentication System (Auth.js)
• Real-time Communication (Pusher)
• File Upload System (UploadThing)
c) Database Layer:
• MySQL Database (via Prisma)
• MindsDB AI Models
• Data Models (User, Group, VerificationToken)
d) External Services:
• MindsDB API
• OAuth Providers (GitHub, Google)
• Email Service (Resend)
• File Storage (UploadThing)
Component Relationships
a) Data Flow:
• Client → API Routes → Database
• Real-time message flow through Pusher
• Authentication flow through Auth.js
• AI Bot interactions with MindsDB
b) Authentication Flow:
• Social login paths
• Email verification process
• Session management
Specific Implementation Details
Specialized sections for:
a) Chat System:
• Direct messaging
• Messaging
• Real-time updates
• Sentiment analysis pipeline
b) AI Integration:
• Bot management system
• MindsDB model connections
• Sentiment analysis flow
Component Details
Key components to highlight:
Frontend:
• Auth Components (/app/(auth))
• Main App Components (/app/(main))
• Chat Interface (/app/(main)/app/chat)
• Group Management (/app/(main)/app/groups)
Backend:
• API Routes (/app/api)
• Authentication Handlers (/app/api/auth)
• Message Handlers (/app/api/messages)
• Friend Management (/app/api/friends)
Services:
• Pusher Integration (real-time)
• MindsDB Connection (AI bots)
• Email Service (verification)
• File Upload Service