Why I Built This

I needed a platform to sell video courses internationally. Existing solutions like Teachable and Gumroad either took too much commission or lacked the customization I needed. So I built my own.

Tech Choices

  • Next.js 14 (App Router) — SSR for SEO, great DX
  • TypeScript — Type safety across the full stack
  • PostgreSQL — Reliable relational data
  • Stripe — Global payment processing
  • Vercel — Zero-config deployment

Architecture

┌─────────────┐     ┌──────────────┐     ┌────────────┐
│   Next.js   │────▶│  API Routes  │────▶│ PostgreSQL │
│   Frontend  │     │  (tRPC)      │     │            │
└─────────────┘     └──────────────┘     └────────────┘
       │                   │
       ▼                   ▼
┌─────────────┐     ┌──────────────┐
│   Stripe    │     │  Video CDN   │
│   Payments  │     │  (Cloudflare)│
└─────────────┘     └──────────────┘

Key Features

  • Course management — Create, edit, and organize courses with chapters and lessons
  • Video delivery — Secure video streaming with DRM-like protection
  • Payment flow — Stripe Checkout with support for multiple currencies
  • User dashboard — Track progress, bookmark lessons
  • Admin panel — Analytics, revenue tracking, content management

Deployment

Deployed on Vercel with:

  • Edge functions for API routes
  • PostgreSQL on Railway
  • Video storage on Cloudflare R2

Total cost: ~$20/month for the initial setup.


Source code: github.com/MrFant/course-shop