How r-curio/iskonek works
Main Components
Frontend Layer:
• Next.js Client Application
• Auth Module (src/app/auth)
• Chat Module (src/app/chat)
• Profile Settings Module (src/components/profilesetting)
• UI Components (src/components/ui)
• Sidebar/Navigation (src/components/sidebar)
API Layer:
• Next.js API Routes
• Authentication endpoints (/api/auth)
• Chat endpoints (/api/chat)
• Profile endpoints (/api/profiles)
• Friend management (/api/friend)
• Account management (/api/account)
Backend Services:
• Supabase Integration
• Authentication Service
• Real-time Database
• Storage (for avatars/media)
Relationship Flows to Highlight
Data Flow:
• Client-Server Communication
• REST API calls
• Real-time WebSocket connections
• Authentication flows
State Management:
• Custom hooks (src/hooks)
• Client-side state
• Server-side state
Architectural Patterns to Emphasize
• Next.js App Router Architecture
• API Route Handler Pattern
• Component-based UI Architecture
• Custom Hook Pattern for State Management
┌─────────────────────────────────────────────┐
• Client Layer │
• ┌─────────┐ ┌─────────┐ ┌──────────────┐ │
• Auth │ │ Chat │ │ Profile │ │
• ┘ └─────────┘ └──────────────┘ │
• ┬─────────────────────┘
┌─────────────────────┼─────────────────────┐
• API Layer │
• ┌─────────┐ ┌─────────┐ ┌──────────────┐ │
• Auth API │ │Chat API │ │Profile API │ │
• ┘ └─────────┘ └──────────────┘ │
• ┬─────────────────────┘
┌─────────────────────┼─────────────────────┐
• Supabase Layer │
• ┌─────────┐ ┌─────────┐ ┌──────────────┐ │
• Auth │ │Database │ │ Storage │ │
• ┘ └─────────┘ └──────────────┘ │
• ┘
Additional Elements
• WebSocket connections for real-time chat
• Data persistence paths
• Error handling paths
• State management flow
Important Details
• Separation between server and client components
• Real-time vs REST API connections
• Public and protected routes
• How the middleware (src/middleware.ts) integrates
• Demonstrate how hooks interact with the system