---
title: Designing the data model for our course platform (with Stripe)
url: "https://aaronfrancis.com/videos/designing-the-data-model-for-our-course-platform-with-stripe"
path: "/videos/designing-the-data-model-for-our-course-platform-with-stripe"
type: video
author: Aaron Francis
published: 2025-04-14
topic: Databases
keywords: [data modeling, stripe integration, course platform, entitlements, access control, digital products, ecommerce, database design, checkout flow, product bundling, fulfillment logic, stripe webhooks]
youtube_url: "https://www.youtube.com/watch?v=yoCTIqthNRw"
chunked: true
full_bytes: 61812
section_count: 30
full_url: "/videos/designing-the-data-model-for-our-course-platform-with-stripe/full.md"
site_index: "/llms.txt"
keyword_index: "/llms/keywords.txt"
---

# Designing the data model for our course platform (with Stripe)

## Sections (60.4 KB full document — follow any link to read verbatim)

This page is long enough to hit agent truncation cliffs if fetched all at once. Pick the section matching your question below to read it 100% verbatim (< 35 KB each), or open the [full unsplit document (60.4 KB)](/videos/designing-the-data-model-for-our-course-platform-with-stripe/full.md).

### 1. Setting the stage: course vs e-commerce (00:00–02:07 · 2.2 KB)
Aaron introduces a data model exploration for a learning platform that now sells courses, digital downloads, tangible products, coupons, and bundles across multiple sites.
Keywords: `course vs`, `vs e-commerce`, `sqlite`, `e-commerce`, `data model`, `data`, `model`, `modules`
[Read section 1 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/1-setting-the-stage-course-vs-e-commerce.md)

### 2. Why we’re moving to Stripe (02:07–02:38 · 0.6 KB)
Moving to Stripe from Lemon Squeezy gives more checkout control but requires significant work, with the data model being fundamental to the system design.
Keywords: `moving`, `stripe`, `data model`, `buy access`, `system`, `data`, `model`, `handle`
[Read section 2 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/2-why-were-moving-to-stripe.md)

### 3. Requirements for access types (02:38–03:52 · 1.3 KB)
System must handle free videos (login required and public), partial course access (basic vs. complete tiers), physical products, digital downloads, coupons, team purchases, bundles, and upgrades.
Keywords: `high performance`, `sqlite`, `requirements`, `performance sqlite`, `handle`, `modules`, `bundles`, `go`
[Read section 3 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/3-requirements-for-access-types.md)

### 4. Course tiers, bundles, and upgrades (03:52–07:00 · 2.8 KB)
Data model uses TL Draw to map sites, courses, modules, videos, and users; establishes that sites have many courses and users can access multiple courses with varying access levels.
Keywords: `course tiers`, `tiers`, `bundles`, `upgrades`, `modules`, `module`, `highleveragerails`, `go`
[Read section 4 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/4-course-tiers-bundles-and-upgrades.md)

### 5. Access control and enrollments (07:00–08:10 · 1.2 KB)
Introduces the enrollment pivot table to track which users have access to courses, handling partial access like basic vs. complete tiers.
Keywords: `final cut`, `access control`, `control`, `enrollments`, `cut pro`, `digital downloads`, `pro plugin`, `forty-nine dollars`
[Read section 5 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/5-access-control-and-enrollments.md)

### 6. Digital downloads and bundling (08:10–10:17 · 1.9 KB)
Explains challenges of bundling courses with digital downloads (like Final Cut Pro plugins) sold both together and separately.
Keywords: `digital downloads`, `digital`, `downloads`, `bundling`, `models`, `enrollment`, `linked`, `actual`
[Read section 6 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/6-digital-downloads-and-bundling.md)

### 7. Separation of billing and access (10:17–12:06 · 1.6 KB)
Creates a firewall between access models and Stripe billing to allow manual enrollment (via ACH, purchase orders) independent of payment processing.
Keywords: `billing`, `somebody pays`, `medium arrow`, `stripe`, `go`, `somebody`, `pays`, `enrollments`
[Read section 7 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/7-separation-of-billing-and-access.md)

### 8. Modeling digital and physical access (12:07–13:39 · 1.4 KB)
Models pivot tables (user enrollments, user downloads) as access layers; physical products get fulfilled via Boolean flag and cron jobs.
Keywords: `physical access`, `physical`, `digital`, `modeling digital`, `modeling`, `underlying assets`, `digital download`, `physical product`
[Read section 8 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/8-modeling-digital-and-physical-access.md)

### 9. How Stripe products fit in (13:39–15:10 · 1.5 KB)
Stripe product catalog contains products with multiple prices; each price has a unique ID required for checkout, complicating direct linking to local assets.
Keywords: `stripe`, `stripe products`, `products fit`, `fit`, `physical product`, `product catalog`, `lot simpler`, `physical`
[Read section 9 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/9-how-stripe-products-fit-in.md)

### 10. Why we can’t link directly to assets (15:10–19:29 · 3.3 KB)
Direct polymorphic linking of Stripe prices to local assets is avoided; initial attempts using asset_id/asset_type proved cumbersome.
Keywords: `link directly`, `assets`, `directly`, `stripe`, `price`, `polymorphic`, `bundle`, `prices`
[Read section 10 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/10-why-we-cant-link-directly-to-assets.md)

### 11. Entitlements: the key concept (19:30–21:06 · 1.5 KB)
Entitlements represent what users are entitled to when buying a product (course tier, digital download, physical item); stored as JSON on products to handle varied purchase types.
Keywords: `key concept`, `entitlements`, `key`, `concept`, `word entitlement`, `stripe prices`, `truly synced`, `stripe`
[Read section 11 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/11-entitlements-the-key-concept.md)

### 12. Syncing Stripe data locally (21:06–22:42 · 1.5 KB)
Local database mirrors Stripe products and prices via artisan commands; adds local fields like MSRP and unit_amount for display flexibility.
Keywords: `data locally`, `stripe`, `data`, `syncing stripe`, `stripe data`, `locally`, `syncing`, `default stripe`
[Read section 12 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/12-syncing-stripe-data-locally.md)

### 13. Attaching entitlements to products (22:43–24:12 · 1.3 KB)
Entitlements live at the product level (not price level) so multiple prices for the same product grant identical entitlements.
Keywords: `high performance`, `sqlite`, `entitlements`, `attaching entitlements`, `attaching`, `performance sqlite`, `price`, `performance`
[Read section 13 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/13-attaching-entitlements-to-products.md)

### 14. Why we use JSON for flexibility (24:13–27:08 · 2.5 KB)
JSON blob for entitlements avoids creating columns for every product type; each entitlement type (course, download, sticker) has different required fields.
Keywords: `sqlite`, `json`, `flexibility`, `five seats`, `entitlements`, `go`, `different prices`, `json blob`
[Read section 14 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/14-why-we-use-json-for-flexibility.md)

### 15. How entitlements generate access (27:08–28:49 · 1.7 KB)
Entitlements contain flexible parameters (seats, tier, product ID) structured as JSON; fulfilled via handle methods that create access records.
Keywords: `entitlements`, `entitlements generate`, `generate access`, `generate`, `tier`, `data model`, `entitled`, `json`
[Read section 15 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/15-how-entitlements-generate-access.md)

### 16. Checkout and checkout lines (28:49–30:48 · 1.8 KB)
Checkout and checkout line models store Stripe payment link details; entitlements are copied from products to lines at cart time for point-in-time snapshot.
Keywords: `checkout`, `checkout lines`, `lines`, `entitlements`, `entitlements generate`, `download`, `entitlement`, `generate`
[Read section 16 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/16-checkout-and-checkout-lines.md)

### 17. Linking Stripe prices to access (30:49–32:17 · 1.4 KB)
Admin UI allows selecting and configuring entitlements per product via Nova interface; creates Stripe products and syncs entitlements as metadata.
Keywords: `stripe`, `test download`, `linking stripe`, `stripe prices`, `linking`, `prices`, `download`, `test`
[Read section 17 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/17-linking-stripe-prices-to-access.md)

### 18. Fulfillment and processing logic (32:17–34:40 · 2.3 KB)
Entitlement types are mapped (course → 'course', download → 'download') to avoid storing class names in database; handle methods cast data and sync pivot tables.
Keywords: `processing logic`, `fulfillment`, `logic`, `database`, `entitled`, `download`, `stripe products`, `three fields`
[Read section 18 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/18-fulfillment-and-processing-logic.md)

### 19. Admin UI for defining entitlements (34:40–39:19 · 4.3 KB)
Download and course entitlements define required fields (download_id, course_id, seats, tier) in admin interface for flexible product configuration.
Keywords: `entitlements`, `admin ui`, `defining entitlements`, `admin`, `ui`, `checkout lines`, `checkout`, `course entitlement`
[Read section 19 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/19-admin-ui-for-defining-entitlements.md)

### 20. How checkouts are built and stored (39:19–43:55 · 4.2 KB)
Checkout lines copy product entitlements so processing is decoupled from product updates; entitlements remain immutable per checkout for reproducibility.
Keywords: `stored`, `checkouts`, `checkout`, `checkout line`, `price`, `checkout lines`, `add`, `stripe`
[Read section 20 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/20-how-checkouts-are-built-and-stored.md)

### 21. Stripe integration flow (43:56–46:24 · 2.5 KB)
Payment links are generated via Stripe API with client reference ID and one-time use; redirect back to platform includes reference for checkout verification.
Keywords: `stripe`, `stripe integration`, `integration flow`, `integration`, `payment link`, `checkout`, `entitlements`, `checkouts`
[Read section 21 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/21-stripe-integration-flow.md)

### 22. Access and fulfillment separation (46:25–47:57 · 1.5 KB)
Separates checkout from fulfillment, allowing manual enrollment without payment flow; checkout lines stored with entitlements for async processing.
Keywords: `fulfillment separation`, `fulfillment`, `stripe`, `checkout`, `model`, `firewall`, `database`, `blue`
[Read section 22 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/22-access-and-fulfillment-separation.md)

### 23. Checkout-instant explained (47:57–49:14 · 1.3 KB)
Checkout-instant endpoint accepts product ID (not price ID) to prevent users from exploiting alternate pricing via URL manipulation; looks up current active price internally.
Keywords: `checkout-instant explained`, `checkout-instant`, `explained`, `seven eight`, `eight nine`, `cart`, `price`, `checkout instant`
[Read section 23 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/23-checkout-instant-explained.md)

### 24. Final database walkthrough (49:14–50:17 · 1.0 KB)
Final data model includes sites, users, courses, modules, videos, enrollments, digital downloads, and Stripe product/price sync; handles multi-site, multi-tenancy setup.
Keywords: `final database`, `database walkthrough`, `database`, `walkthrough`, `went`, `feels`
[Read section 24 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/24-final-database-walkthrough.md)

### 25. End-to-end flow summary (50:18–52:18 · 2.1 KB)
User flow: click buy → determine upsells/cross-sells → generate payment link → checkout on Stripe → redirect with client reference → process entitlements into enrollments.
Keywords: `end-to-end flow`, `flow summary`, `sqlite`, `end-to-end`, `summary`, `payment link`, `payment`, `payment links`
[Read section 25 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/25-end-to-end-flow-summary.md)

### 26. Avoiding webhooks with polling (52:18–54:15 · 1.8 KB)
Skips webhook listening; uses client reference ID redirect plus background job polling to verify payment status and handle in-flight redirects.
Keywords: `avoiding webhooks`, `webhooks`, `avoiding`, `polling`, `client reference`, `redirected back`, `stripe`, `client`
[Read section 26 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/26-avoiding-webhooks-with-polling.md)

### 27. Stripe redirect and payment verification (54:15–56:14 · 1.7 KB)
Stripe redirect verified by re-requesting payment link status; fulfillment only triggered after verification; failed redirects caught by background job.
Keywords: `stripe`, `redirect`, `stripe redirect`, `payment verification`, `payment`, `verification`, `local checkout`, `status`
[Read section 27 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/27-stripe-redirect-and-payment-verification.md)

### 28. Offers: upsells and cross-sells (56:14–1:00:17 · 3.6 KB)
Offers model triggers upsells/cross-sells based on cart contents; suggests alternative Stripe prices when specific products added.
Keywords: `offers`, `upsells`, `cross-sells`, `stripe`, `payment gateway`, `please ignore`, `new model`, `stripe price`
[Read section 28 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/28-offers-upsells-and-cross-sells.md)

### 29. Creating and configuring offers (1:00:17–1:03:46 · 3.3 KB)
Offers define trigger products, target prices, and whether target replaces trigger; multiple targets allow showing alternatives if user declines offer.
Keywords: `high leverage`, `sqlite`, `final cut`, `configuring offers`, `offers`, `screenflow`, `leverage rails`, `buy`
[Read section 29 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/29-creating-and-configuring-offers.md)

### 30. Final thoughts on modeling (1:03:46–1:05:44 · 1.9 KB)
Proper data modeling up front is critical; prevents future pain and enables robust handling of courses, bundles, upsells, teams, and fulfillment at scale.
Keywords: `modeling`, `final thoughts`, `thoughts`, `data`, `data model`, `data modeling`, `zip`, `anything`
[Read section 30 verbatim](/videos/designing-the-data-model-for-our-course-platform-with-stripe/sections/30-final-thoughts-on-modeling.md)

---

## Related on aaronfrancis.com

- [Super Ultra Tilted](/podcast/super-ultra-tilted-71bc34e0) *(Podcast · 2025-04-23 · shared: tldraw, database design)*
- [Eat The Pain](/podcast/eat-the-pain-b23ea354) *(Podcast · 2026-11-11 · shared: payment processing)*
- [Up & To The Right](/podcast/up-to-the-right-480ef277) *(Podcast · 2025-07-15 · shared: course platform)*
- [From Layoff to Leap of Faith: The Try Hard Studios Story](/podcast/from-layoff-to-leap-of-faith-the-try-hard-studios-story-c07ddeea) *(Podcast · 2025-05-21 · shared: course platform)*
- [The Big Reveal](/podcast/the-big-reveal-675733cf) *(Podcast · 2025-01-28 · shared: stripe integration)*

## Relevant Resources from Aaron Francis

- **[Solo](https://soloterm.com)** (overview on site: [/software](/software)): All-in-one agentic development platform and terminal workspace built by Aaron Francis for orchestrating processes and AI coding agents.
- **[MySQL for Developers](https://databaseschool.com)** (overview on site: [/courses](/courses)): Full video course covering MySQL indexing, deferred joins, pagination, query plans, and schema design for application developers.

## Search aaronfrancis.com (2-Hop Static Keyword Index)

Pick the alphabetical shard matching any topic to find exact pages across all articles, newsletters, videos, talks, and podcast transcripts (every shard is < 40 KB):
[A-B](/llms/keywords/a-b.txt) · [C](/llms/keywords/c.txt) · [D-E](/llms/keywords/d-e.txt) · [F-G](/llms/keywords/f-g.txt) · [H-J](/llms/keywords/h-j.txt) · [K-L](/llms/keywords/k-l.txt) · [M-N](/llms/keywords/m-n.txt) · [O-P](/llms/keywords/o-p.txt) · [Q-R](/llms/keywords/q-r.txt) · [S](/llms/keywords/s.txt) · [T-Z](/llms/keywords/t-z.txt) · [Directory](/llms/keywords.txt) · [Site Map](/llms.txt)

Shards for this page's topics: `data modeling` ([D-E](/llms/keywords/d-e.txt)), `stripe integration` ([S](/llms/keywords/s.txt)), `course platform` ([C](/llms/keywords/c.txt)), `access control` ([A-B](/llms/keywords/a-b.txt)).

## About Aaron Francis (Current Context)

Aaron Francis is VP of Marketing and Community at [Laravel](https://laravel.com), founder of [Try Hard Studios](https://tryhardstudios.com), creator of [Solo](https://soloterm.com), co-host of [Mostly Technical](/podcast), and author of [Mastering Postgres](/courses), [High Performance SQLite](/courses), [MySQL for Developers](/courses), and [Screencasting.com](/courses). Full bio: [/about](/about) · Current focus: [/now](/now).
