How ben-jamming-reilly/parasocial works
Main System Components
a) Client Layer:
• Next.js Frontend (src/app directory)
• React Components (src/components)
• Client-side State Management (src/hooks)
b) API Layer:
• tRPC API Routes (src/server/api/routers)
• Authentication (NextAuth.js)
• Video Query Service Integration
c) Service Layer:
• Video Query Services (src/server/video-query)
• Database Layer (Prisma)
Component Relationships
Frontend → API:
• TRPC client connections (src/trpc)
• Auth flows with NextAuth
• Video search requests
API → Services:
• Video query service interactions
• Database operations
• Authentication validations
Specific Implementation Details
Key architectural elements:
a) Frontend Components:
• Main pages (home, search, profile, video viewer)
• UI components (src/components/ui)
• Authentication provider
• Search interface
b) API Routes:
• tRPC routers for:
• Profile management
• Search functionality
• User operations
• Video handling
c) Service Integration:
• Video Query API client
• Search service
• Profile service
• Cluster service
Data Flow Visualization
Following flows:
User Authentication
Client → NextAuth → Database
Search Flow
SearchBar → tRPC API → Video Query Service → Search Results → Client
Profile Management
Profile Components → tRPC API → Database → Client
Key Technologies to Highlight
• Next.js 13+ (App Router)
• tRPC
• Prisma
• NextAuth
• Tailwind CSS
• Custom Video Query API