How to Build an Online Course Platform
A course platform is three ideas: content in order, an enrollment that grants access, and progress that brings people back. Build those and sell with one checkout.

Key takeaways
- Access control is an enrollment row, created by the payment webhook. Every lesson query checks it on the server, not just the page.
- Use a dedicated video host for lessons. Storing and streaming long videos yourself is the expensive, fiddly part.
- Progress (lessons completed, a resume button, a certificate at the end) is what gets students to finish.
An online course platform needs four parts: courses organized into modules and lessons, enrollments that decide who can see which lessons, progress tracking so students can resume where they stopped, and a checkout that creates the enrollment when payment succeeds. Building your own instead of using a course marketplace makes sense when you want your own brand, your own pricing and a direct line to your students without a revenue share on every sale.
Your own platform or a course host
Hosted course tools are quick to start and charge monthly fees or a cut of sales. Your own platform costs more thought up front but lets you shape the experience: a cohort with live sessions, a course bundled with a community, a members area that mixes lessons, downloads and templates, or a corporate training portal with company accounts. If you will sell one course to a few dozen people, use a host. If courses are your business, own it.
The data model
- courses: title, slug, subtitle, description, cover image, price and currency, status (draft, published), and instructor.
- modules: course id, title, position. Sections like "Week 1: foundations".
- lessons: module id, title, position, type (video, text, quiz, download), the video id from your video host, body text, estimated minutes, and a free preview flag.
- enrollments: user id, course id, source (purchase, coupon, manual grant, company seat), created date, and an expiry date if access is time-limited.
- lesson_progress: user id, lesson id, completed date, and for videos the last watched second so the player resumes.
- quiz_questions and quiz_attempts: questions with choices and the right answer; each attempt with a score.
- orders: user, course, amount, Stripe session id, status, and refund state.
Access control done properly
The most common mistake in homemade course sites is hiding lessons in the interface but leaving them readable from the database. Anyone who opens the browser tools can then read every lesson. The rule must live on the server:
- A lesson's content is readable if the lesson is a free preview, or the reader has an enrollment in its course that has not expired.
- Enrollments are created only by the payment webhook, a coupon redemption function or an admin. Students can read their own enrollments and never insert them.
- Downloads (worksheets, templates) live in a private storage bucket and are served through signed links that expire, so a shared link stops working.
- Video ids are useless on their own if your video host supports signed or domain-restricted playback; turn that on.
In Startbase Cloud, the agent turns on row-level security for every table it creates and writes policies like these from your brief. Test them the honest way: sign in as a student without an enrollment and try to load a paid lesson. The database docs show the policy editor if you want to read the rules yourself.
Where the videos live
Video is the one part not to build yourself. Long lesson videos need transcoding into several qualities, adaptive streaming for slow connections, and a fast delivery network. Dedicated video hosts do all of that and charge for storage and minutes watched; the lesson row only stores the video id and the player is embedded on the lesson page. File storage is fine for short clips, slides and PDFs, but a 40-minute 1080p lesson belongs on a video host.
Add captions. They help students who are deaf or hard of hearing, people watching on a train without sound, and non-native speakers. Many video hosts generate captions automatically for you to correct.
What students see
- 01Course landing page: the promise, the curriculum with lesson titles, free preview lessons, the instructor, FAQs and the buy button.
- 02My courses: enrolled courses with a progress bar and a Continue button that jumps to the next unfinished lesson.
- 03Lesson page: the player or text, Mark complete, previous and next, the curriculum in a sidebar with checkmarks, and downloads for that lesson.
- 04Quiz: questions one at a time, feedback after each, a score at the end with the option to retry.
- 05Certificate: a completion page (and a downloadable version) once every lesson is complete.
Selling and emails
Payments in Startbase Cloud run through your own Stripe account, with Stripe Connect as the no-keys path. A one-time price per course is the simplest model; bundles and subscriptions come later. The Stripe webhook, running in an edge function, creates the enrollment and sends a welcome email with the first lesson link. A scheduled job can send the weekly nudge to students who have not opened a lesson in seven days. See Payments and Jobs.
Instructors need their own screens: a course editor with drag-to-reorder modules and lessons, a students list with progress, and sales. Give the instructor an Admin role so only they can edit content and grant enrollments by hand (for scholarships and refunds).
Useful AI features, and where to stop
Two AI features earn their place in a course platform. A lesson assistant answers questions using the lesson's text and transcript, which saves the instructor repeat emails. And quiz drafting turns a transcript into practice questions for the instructor to edit. With the App AI gateway on, the app calls these through its helper library with no API keys, and text calls are billed as runtime usage that you can cap per app; see AI. Keep the assistant grounded in the course material and say when it does not know.
What to leave out of version one
- A multi-instructor marketplace with payouts to each teacher.
- Discussion forums under every lesson. One community space, or none, is easier to keep alive.
- Drip schedules that unlock modules by date, unless you run cohorts.
- Native apps. Course platforms work well as responsive web apps, and students can add them to their home screen.
A brief you can paste
Build my course platform for teaching watercolor. Courses have modules and lessons; a lesson is a video (embedded from my video host by id), text, a quiz, or downloads, with estimated minutes and a free preview flag. Course landing page with the curriculum, preview lessons, instructor bio, FAQs and a Buy button. Students sign in with email magic link or Google. Payment through Stripe; only the Stripe webhook creates the enrollment, then emails a welcome with the first lesson link. Lesson content and downloads are readable only by enrolled students or for preview lessons, enforced in the database. Downloads in a private bucket with signed links. My courses page with progress bars and a Continue button. Lesson page with Mark complete, next and previous, and the curriculum sidebar with checkmarks. Multiple-choice quizzes with instant feedback. A completion certificate page with my signature and the student name. Admin area for me: course editor with drag-to-reorder, students with progress, manual enrollment grants, sales. Every Monday, email students inactive for 7 days with their next lesson.
Before launch, run the paid flow in Stripe test mode, then sign in as a non-student and try the direct URL of a paid lesson. For the broader business side of selling software and content, see how to build a SaaS without developers. If you sell access rather than single courses, compare how to build a membership site, and accepting payments in your app covers the checkout side.
Frequently asked questions
How do I protect paid course content?
Enforce access on the server: lessons are readable only with a valid enrollment or a free preview flag, enrollments are created only by the payment webhook or an admin, downloads use expiring signed links, and the video host restricts playback to your domain.
Where should I host course videos?
On a dedicated video host that handles transcoding, adaptive streaming and delivery. Store only the video id in your lesson rows and embed the host's player.
Is it better to build my own course platform or use a course marketplace?
A marketplace or hosted tool is faster for a single course. Your own platform makes sense when courses are your business and you want your own brand, pricing, student data and experience without a cut of each sale.
How do I get students to finish my course?
Short lessons, a visible progress bar, a Continue button that goes straight to the next lesson, reminder emails for inactive students, and a completion certificate all help.
