Skip to content

ahmifte/pathfinder

Repository files navigation

pathfinder

CI License: MIT Built with Next.js

A self-hostable, open-source course platform with Stripe one-time payments, gated MDX lessons, and per-lesson progress tracking. Keep ~97% of revenue instead of handing half to a marketplace.

Features

  • Course catalog with free intro lessons as the funnel
  • One-time Stripe Checkout granting lifetime access (idempotent webhook)
  • Gated MDX lessons — free lessons public, the rest paywalled
  • Per-lesson progress tracking and a "My learning" dashboard
  • GitHub auth via NextAuth + Prisma
  • Account/data deletion endpoint (privacy compliance)
  • Centralized, validated env config in lib/env.ts

Adding a course

  1. Add an entry to lib/courses.ts with its lessons, amount, and a stable lookupKey.
  2. Create content/courses/<courseId>/<lessonSlug>.mdx for each lesson.
  3. Run pnpm stripe:sync to provision the one-time Price in Stripe.

Getting started

pnpm install                 # runs `prisma generate`
cp .env.example .env.local   # fill in DATABASE_URL, auth, Stripe
pnpm db:push                 # create the schema
pnpm dev

Set a Stripe webhook to /api/stripe/webhook and configure STRIPE_WEBHOOK_SECRET. All variables are documented in .env.example.

Stripe products & prices (code as source of truth)

Courses define their price in code (lib/courses.ts) via amount + a stable lookupKey. Provision them with:

pnpm stripe:sync

This idempotently creates/updates the Products and one-time Prices in whatever account STRIPE_SECRET_KEY belongs to (run it with your key). At runtime the app resolves the live price ID by lookupKey via lib/stripe-prices.ts — no price IDs in env or code.

Monetization

One-time course sales ($99–$299) with bundle potential. Because it is self-hosted, you keep almost everything after Stripe fees.

Scripts

  • pnpm dev / pnpm build / pnpm start
  • pnpm lint / pnpm typecheck
  • pnpm db:push
  • pnpm stripe:sync — provision Stripe products/prices from lib/courses.ts

License

MIT — see LICENSE.

About

Open-source course platform with Stripe payments, gated MDX lessons, and progress tracking.

Topics

Resources

License

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors