How kkk1998sss/webinar works
Main Components
a. Client-side (Browser)
• User UI (public website, webinar flows, ebook/video library)
• Admin UI (CRUD interfaces for users, ebooks, videos, webinars)
b. Next.js Server Layer
• App Router pages & server actions (src/app/…)
• API Routes (serverless functions under src/app/api/…)
c. Data Layer
• Prisma ORM (prisma/schema.prisma)
• Underlying relational database (e.g., PostgreSQL)
d. Authentication & Authorization
• NextAuth (src/app/api/auth/[...nextauth])
• Role checks in middleware (src/middleware.ts)
e. External Services
• Stripe (checkout sessions, webhooks)
• Razorpay (payments, webhooks)
• Twilio (OTP, SMS)
• Email/SMS providers (for reset-password, verify-otp)
f. Infrastructure & CI/CD
• Vercel (hosting, serverless functions)
• GitHub Actions (lint, tests, i18n workflows)
Relationships & Data Flows
• Browser → Next.js Frontend via HTTPS (React pages + client components)
• Frontend → Server Actions & API Routes (form submissions, data fetching)
• API Routes → Prisma → Database (CRUD operations)
• API Routes → External Services (Stripe/Razorpay checkout, Twilio OTP)
• External Services → API Webhooks → Next.js API Routes → Prisma/Notifications
• NextAuth connects browser and API for session management, calling OAuth providers
Architectural Patterns
• Next.js App Router (colocates page, layout, and route handlers)
• “Server Actions” (src/actions/…) for mutations without explicit API routes
• Serverless functions (each API directory maps to a separate lambda)
• Prisma migrations for evolving database schema
• Role-based access: public vs. authenticated vs. admin areas
Additional Details
• Where middleware (middleware.ts) enforces auth on routes
• Prisma migrations path and schema file to indicate database versioning
• An inset showing i18n flow (messages under src/messages, src/lib/i18n) if needed
• Optionally, add a separate “Testing” section: Jest & Playwright calling API and page routes