How zeus-12/uxie works
Main System Components
a) Client Layer:
• Next.js Frontend (React components)
• PDF Viewer & Editor Interface
• Real-time Collaboration UI
• Authentication UI
b) API Layer:
• tRPC Routes
• Next.js API Routes
• Authentication Endpoints
c) Service Layer:
• PDF Processing
• AI/LLM Services
• Real-time Collaboration
• File Storage
• Vector Search
d) Data Layer:
• Supabase Database
• Pinecone Vector DB
• File Storage (Uploadthing)
Component Relationships
a) Frontend to Backend:
• tRPC calls between frontend components and API routes
• WebSocket connections for real-time collaboration
• File upload streams
b) Backend Services:
• Authentication flow with NextAuth
• PDF processing pipeline
• AI processing pipeline
• Database operations
Specific Implementation Details
a) PDF Processing Flow:
Upload → OCR → Vectorization → Storage
b) AI Integration Flow:
User Input → Context Retrieval → LLM Processing → Response Streaming
c) Real-time Collaboration:
Client → Liveblocks → State Sync → Other Clients
Important Technical Elements
• Prisma ORM layer
• tRPC endpoints
• NextAuth integration
• Pinecone vector search
• Uploadthing storage
• Liveblocks real-time collaboration
• React Query data management
• Zod validation layer
Key Workflows to Highlight
a) Document Processing:
Upload → OCR → Vectorization → Storage → Accessibility
b) Flashcard Generation:
User Input → Context Retrieval → LLM Processing → AI Evaluation
c) Collaborative Editing:
User Action → State Update → Real-time Sync → Other Users