How burakorkmez/onlyfans works
Main Components
a) Client-Side Layer:
• Next.js Frontend (src/app directory)
• Authentication UI Components
• Home Screen Components
• E-commerce Components
• Admin Dashboard
• Theme Provider
• TanStack Provider
b) Server-Side Layer:
• Next.js API Routes
• Authentication Handlers
• Webhook Handlers
• Server Actions
c) External Services:
• Kinde Auth (Authentication)
• Stripe (Payments)
• Cloudinary (Media Storage)
• Resend (Email Service)
• PostgreSQL Database
┌─ Client Layer ─────────────────────┐
• Public Pages │
• Protected Pages │
• Admin Dashboard │
• UI Components │
• ┬───────────────────┘
• ↓
┌─ Application Layer ─────────────────┐
• Next.js API Routes │
• Server Actions │
• Email Templates │
• ┬───────────────────┘
• ↓
┌─ Data Layer ──────────────────────┐
• Prisma ORM │
• PostgreSQL Database │
• ┬───────────────────┘
• ↓
┌─ External Services ────────────────┐
• Kinde Auth │
• Stripe │
• Cloudinary │
• Resend │
• ┘
Key Flows to Highlight
a) Authentication Flow:
• User → Kinde Auth → Callback → Protected Routes
b) Payment Flows:
• Subscription: User → Stripe Checkout → Webhook → Database
• One-time Purchase: User → Product Checkout → Webhook → Email
c) Content Management:
• Post Creation → Cloudinary → Database
• Comment/Like System → Database
Important Details
• Separation between public and protected routes
• Admin dashboard's special access
• Real-time features and data flow
• Webhook endpoints and their purposes
• Email notification triggers
Implementation Notes
• Next.js 14 App Router structure
• Server Components vs Client Components
• API route organization
• Database schema relationships
• External service integration points
Remember to:
• Use consistent styling
• Version numbers for major components
• Notes for important configuration requirements