A modern all-access course platform built with Next.js 16. Pay once ($99), get lifetime access to ALL courses.
- 💰 $99 one-time payment for lifetime all-access subscription
- 🎓 Unlimited access to ALL courses (current & future)
- 📺 Video course player (YouTube & Wistia support)
- 💳 Secure Stripe payment integration
- 📱 Responsive design
- 🔐 Clerk authentication
- 📊 Personal dashboard showing all courses
- 👥 User Management - Manage users and roles via Clerk metadata
- 📚 Course Management - Create, edit, publish, and delete courses
- 📝 Content Editor - Add chapters and lectures with drag-and-drop ordering
- 📊 Analytics Dashboard - View stats, revenue, and recent purchases
- 🔒 Role-Based Access - Secure admin routes with Clerk metadata
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Authentication: Clerk
- Database: MongoDB (Mongoose)
- Payments: Stripe
- Media: Cloudinary (Next Cloudinary)
- Forms: React Hook Form
- Styling: Tailwind CSS v4
- Video Players: YouTube API, Wistia
src/
├── app/ # Next.js App Router pages
│ ├── admin/ # Admin routes
│ │ ├── page.tsx # Overview
│ │ ├── users/ # User management
│ │ └── courses/ # Course management
│ ├── course/[id]/ # Course player
│ ├── dashboard/ # Student dashboard
│ └── page.tsx # Landing page
├── components/ # React components
├── actions/ # Server actions
├── lib/ # Database & services
└── models/ # MongoDB schemas
Create .env.local:
# Clerk Authentication
CLERK_SECRET_KEY=sk_test_...
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
# MongoDB
MONGODB_URI=mongodb+srv://...
# Stripe
STRIPE_SECRET_KEY=sk_test_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# Cloudinary (for course thumbnails)
# Get these from https://cloudinary.com/console
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your_cloud_name
NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET=course_thumbnails
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000npm installnpm run devVisit http://localhost:3000
To grant admin access to a user:
- Go to Clerk Dashboard
- Navigate to Users → Select your user
- Edit Public Metadata
- Add:
{ "role": "admin" } - Save changes
Now you can access the admin dashboard at /admin
Detailed guides are available:
- Performance Fixes - All optimizations and caching strategies
- Subscription Model - How the all-access pricing works
- Cloudinary Setup - How to configure Cloudinary for image uploads
- Course Player Guide - Course player implementation
/- Landing page/sign-in- Sign in page/sign-up- Sign up page
/dashboard- Student dashboard/course/[id]- Course player
/admin- Admin overview with stats/admin/users- User management/admin/courses- Course listing/admin/courses/[id]- Edit course content
- ✅ Server-side authentication checks
- ✅ Role-based access control via Clerk metadata
- ✅ Secure Stripe webhook handling
- ✅ MongoDB connection with authentication
- ✅ Protected admin routes
- ✅ CSRF protection via Next.js
- ✅ Next.js 16
'use cache'directive - Smart caching for all data fetching functions - ✅ Tagged cache invalidation - Precise cache updates with
updateTag() - ✅ Optimistic UI - Instant feedback with
useOptimistichook - ✅ Database indexes - Optimized MongoDB queries (10-100x faster)
- ✅ Field projection - Fetch only needed data with
.select()and.lean() - ✅ Batch operations - Eliminated N+1 queries with aggregations
- ✅ Server Components - Zero JavaScript by default
- ✅ Image optimization - Cloudinary CDN + Next.js Image
- Admin pages: 5-10x faster (300-500ms from 2-3s)
- Course editor: 15-25x faster (200-300ms from 3-5s)
- Dashboard: 10-20x faster (100-200ms from 1-2s)
- Cached requests: 100x faster (~5ms vs ~500ms)
See PERFORMANCE_FIXES.md for detailed breakdown.
- Push to GitHub
- Import project to Vercel
- Add environment variables
- Deploy
Make sure to set all environment variables listed in the setup section.
MIT
Contributions welcome! Please read the documentation first.
Built with ❤️ using Next.js 16 and React 19