How workvaibhavk/springboard works
Purpose and application shape
Springboard ReThink is a full-stack LMS built on Next.js App Router. It delivers course discovery, enrollment/payment, playlist-based learning, per-module progress, certificates, and separate administrator/subadministrator operations. The primary UI entry is app/page.tsx; global application composition is in app/layout.tsx.
Identity and access boundary
Clerk provides user sessions and protects the application, with authentication and onboarding surfaces at app/authenticate/page.tsx and app/onboarding/page.tsx. Server-side role-sensitive operations are exposed through Next route handlers, while user synchronization/actions are centralized in app/action/user.ts. proxy.ts is an architectural request-boundary candidate for route protection/middleware.
Course catalog and authoring
Public/dynamic course navigation is centered on app/courses/page.tsx and app/course/[Id]/page.tsx. Course data is retrieved through API handlers such as app/api/get-course-details/route.js and app/api/get-featured-courses/route.js. Privileged course creation is split by role UI (app/admin/add-course/page.tsx, app/subadmin/add-course/page.tsx) and the write endpoint app/api/add-course/route.js.
Learning player and progress pipeline
The learning runtime starts at app/learn/[id]/page.tsx, assembling module navigation and playback from components/ModuleList.jsx and components/VideoPlayer.jsx. The player integrates YouTube through hooks/useYouTubePlayer.js; course modules correspond to playlist/video metadata. Completion signals cross a server API boundary at app/api/mark-complete/route.js, while progress/dashboard reads use app/api/get-progress/route.js and app/api/get-user-courses-data/route.js.
Enrollment and payment flow
A user checks enrollment via app/api/check-enrollment/route.js, creates a Razorpay order at app/api/create-order/route.ts, then verifies payment at app/api/verify-payment/route.ts before enrollment is recorded through app/api/enroll/route.js. Razorpay’s asynchronous provider callback enters at app/api/razorpay-webhook/route.js. Client/server payment integration is represented by lib/loadRazorpayScript.ts and lib/razorpay.ts; the checkout UI is app/pay/page.tsx.
Dashboard, administration, and reporting
The learner dashboard is app/dashboard/page.tsx, consuming user course/progress data. Admin and subadmin interfaces are distinct operational surfaces: app/admin/users/page.tsx, app/subadmin/users/page.tsx, and app/subadmin/analytics/page.tsx. Their backend boundary includes user listing/details/progress APIs under app/api/admin/users/route.js, app/api/admin/user-details/route.js, and analytics at app/api/subadmin-analytics/route.js.
Certificates and verification
Certificate retrieval/generation is mediated by app/api/get-certificate/route.js and lib/Certificatepdfgenerator.ts. Public certificate display and validation are route-parameterized at app/certificate/[id]/page.tsx and app/verify/[id]/page.tsx, backed by app/api/verify-certificate/route.js. Admin certificate lookup is separated at app/api/admin/get-user-certificate/route.ts.
Data and infrastructure
Supabase is the persistence boundary, accessed through regular and privileged clients in lib/supabase.ts and lib/supabase-admin.ts. The declared core model is users, courses, course modules, and user progress; shared domain contracts live in types/course.ts, types/learning.ts, and types/supabase.ts. Material external services are Clerk authentication, Supabase database access, YouTube IFrame/Data APIs, and Razorpay payments.
Main entry points: supabase.ts Supabase · check-enrollment/route.js Enrollment & payment API · loadRazorpayScript.ts Razorpay client integration · users/route.js Admin & analytics API
Components 24
Application surfaces
- App shell · Global layout and primary landing entry.
app/layout.tsx - Authentication & onboarding
app/authenticate/page.tsx - Learner dashboard
app/dashboard/page.tsx - Admin operations · Separate admin and subadmin user, authoring, and analytics surfaces.
app/admin/users/page.tsx - Certificate public pages · Public display and verification by certificate ID.
app/certificate/[id]/page.tsx
Learning and catalog
- Course catalog · Course discovery and course detail routes.
app/courses/page.tsx - Course authoring
app/admin/add-course/page.tsx - Learning player · Playlist-based module learning runtime.
app/learn/[id]/page.tsx - Module navigation & player
components/ModuleList.jsx - YouTube player adapter
hooks/useYouTubePlayer.js - YouTube APIs · Supplies playlist and video playback metadata.
Enrollment and payments
- Checkout
app/pay/page.tsx - Razorpay client integration
lib/loadRazorpayScript.ts - Razorpay
lib/razorpay.ts
Server and infrastructure
- Request protection · Applies route-level access protection.
proxy.ts - User synchronization
app/action/user.ts - Course API · Serves course details and featured catalog data.
app/api/get-course-details/route.js - Progress API · Records completion and returns learner progress/course data.
app/api/mark-complete/route.js - Enrollment & payment API · Checks enrollment, creates/verifies orders, and records enrollment.
app/api/check-enrollment/route.js - Razorpay webhook · Receives asynchronous payment callbacks.
app/api/razorpay-webhook/route.js - Admin & analytics API · Provides user details, progress, certificates, and subadmin analytics.
app/api/admin/users/route.js - Certificates · Generates, retrieves, and verifies certificates.
app/api/get-certificate/route.js - Clerk
- Supabase · Persists users, courses, modules, enrollments, and progress.
lib/supabase.ts
Connections 24
- App shell → Request protection: requests pass through
- Request protection → Clerk: authenticates
- Authentication & onboarding → User synchronization: syncs user
- User synchronization → Supabase: writes user
- Course catalog → Course API: loads courses
- Course API → Supabase: reads catalog
- Course authoring → Enrollment & payment API: creates course
- Enrollment & payment API → Supabase: records enrollment
- Learning player → Module navigation & player: assembles
- Module navigation & player → YouTube player adapter: plays modules
- YouTube player adapter → YouTube APIs: uses IFrame/Data APIs
- Learning player → Progress API: reads and marks progress
- Progress API → Supabase: stores progress
- Learner dashboard → Progress API: loads learning data
- Checkout → Razorpay client integration: starts checkout
- Razorpay client integration → Enrollment & payment API: creates and verifies order
- Razorpay client integration → Razorpay: opens payment flow
- Razorpay → Razorpay webhook: payment callback
- Razorpay webhook → Enrollment & payment API: confirms payment
- Admin operations → Admin & analytics API: manages users and reporting
- Admin & analytics API → Supabase: reads operational data
- Certificate public pages → Certificates: retrieves and verifies
- Certificates → Supabase: stores certificate data
- Admin & analytics API → Certificates: looks up certificates