Course Platform with Secure Payments & Headless CMS

A production-ready wellness course platform with secure Stripe payments, automated enrolment, protected content access, and CMS-driven lessons.

Next.jsTypeScriptStripePrismaSupabaseSanity CMS
Course platform dashboard screenshotCourse platform mobile screenshot

The Problem

The platform needed to sell digital courses securely, automatically enroll users upon payment, and protect course content with authentication, while keeping the user interface simple and clutter-free.

  • Secure payment validation
  • Automated enrolment logic
  • Protected course routes
  • CMS-driven lesson content
  • Clean, intuitive dashboard

System Architecture

The system was designed backend-first to ensure payment integrity and data consistency. Webhooks validate payments before enrolment is created, and route protection ensures only authorised users access content.

Stripe Checkout + webhook verification
Server-side enrolment creation
Role-based route protection
Prisma ORM with relational data modeling
CMS-driven structured lesson rendering

Payment & Enrolment Flow

1. User completes Stripe Checkout

2. Stripe triggers verified webhook

3. Server validates signature

4. Enrolment record is created

5. User gains access to protected course routes

Payment and enrolment flow diagram

Key Technical Challenges

Stripe Webhook Validation

Implemented secure webhook handling with signature validation and idempotency checks to prevent duplicate enrolments and ensure payment integrity.

Protected Routes & Role Checks

Built server-side validation to ensure only enrolled users can access lesson content, preventing unauthorised access.

CMS-Driven Lesson Rendering

Structured Sanity schemas and dynamically rendered modular lesson blocks for flexible content updates without code changes.

Code snippet of sanity schemaSanity studio dashboard screenshot

UX Considerations

The interface was intentionally minimal to reduce cognitive load. Error handling and confirmation feedback ensure clarity at every stage of the purchase and learning experience.

Error message screenshotLesson complete message screenshot

Future Improvements

  • Background job queue for webhook handling
  • Loading skeleton for better perceived performance
  • Admin dashboard for analytics and customer management
  • Advanced lesson analytics tracking

Live Demo

Want to see it for yourself? Check out the link below to explore the live demo of the course platform.

View Live Demo