Strapi Plugin Maestro

Transform your Strapi app into a Learning Management System to create and sell courses online effortlessly.

LMS

Requirements

Mux account

  • Access token ID
  • Secret Key
  • Webhook signing secret
  • Signing Key ID
  • Base64-encoded Private Key

Stripe account

  • Secret key
  • Checkout success URL
  • Checkout cancel URL

Installation

In the root of your Strapi application:

npm i strapi-plugin-maestro

Configuring .env variables

Once installed, set the following values in your project's .env:

ACCESS_TOKEN_ID={Mux access token ID}
ACCESS_TOKEN_SECRET={Mux secret key}
WEBHOOK_SIGNING_SECRET={Mux webhook signing secret}
SIGNING_KEY_ID={Mux signing Key ID}
SIGNING_KEY_PRIVATE_KEY={Mux base64-encoded Private Key}

STRIPE_SECRET_KEY={Stripe secret key}
STRIPE_CHECKOUT_SUCCESS_URL={Frontend checkout success URL}
STRIPE_CHECKOUT_CANCEL_URL={Frontend checkout cancel URL}

Then add the following in config/plugins.ts:

export default ({ env }: { env: any }) => ({
    "maestro": {
        enabled: true,
        config: {
        stripeSecretKey: env('STRIPE_SECRET_KEY'),
        checkoutSuccessUrl: env('STRIPE_CHECKOUT_SUCCESS_URL'),
        checkoutCancelUrl: env('STRIPE_CHECKOUT_CANCEL_URL'),
        }
    },
    "mux-video-uploader": {
        enabled: true,
        config: {
        accessTokenId: env('ACCESS_TOKEN_ID'),
        secretKey: env('ACCESS_TOKEN_SECRET'),
        webhookSigningSecret: env('WEBHOOK_SIGNING_SECRET'),
        playbackSigningId: env('SIGNING_KEY_ID'),
        playbackSigningSecret: env('SIGNING_KEY_PRIVATE_KEY'),
        }
    }
});

That's it! Start the server with npm run develop.

Setting up permissions

Enable endpoints in the Users & Permissions plugin for Maestro.

Authenticated

Courses

  • checkLecture
  • getClassesCompleted
  • getCurrentLecture
  • getCourseDetails
  • getItemsPurchased
  • getMyLearning
  • getPlayAuth
  • resumeCourse

Orders

  • confirmWithUser
  • create
  • find
  • findOne

Public

Categories

  • findOne
  • index

Courses

  • find
  • findOne
  • findSlugs

Orders

  • confirm
  • create
  • finishRegister

Usage

Creating courses is done through the Strapi Admin Dashboard.

API

The Maestro plugin exposes a REST API for managing and consuming courses, categories, orders, and user progress. Below are the available endpoints.

Categories

MethodPathAuthDescription
GET/categories/indexPublicList all categories with thumbnails and courses.
GET/categories/:slugPublicGet a category by slug with courses.

Courses

MethodPathAuthDescription
GET/coursesPublicAll courses with thumbnails, modules, lectures, and metadata.
GET/courses/:slugPublicCourse by slug with modules/lectures and details.
GET/courses-slugsPublicList of all course slugs.
GET/course-details/:courseIdAuthenticatedStudents count and user progress.
GET/courses/:courseId/classes-completedAuthenticatedLectures completed by the user.
GET/courses/:courseId/get-current-lectureAuthenticatedCurrent lecture to resume.
GET/courses/:courseId/resume-courseAuthenticatedReturn the next lecture to watch.
GET/courses/:courseId/get-play-auth-lectureAuthenticatedPlay authorization for a lecture video.
PUT/courses/:courseId/check-lectureAuthenticatedMark a lecture as completed.
GET/my-items-purchasedAuthenticatedIDs of purchased courses.
GET/my-learningAuthenticatedFull info for purchased courses.

Orders

MethodPathAuthDescription
GET/ordersAuthenticatedList all orders for the user.
GET/orders/:idAuthenticatedGet an order by ID (must belong to user).
POST/ordersPublic or AuthenticatedCreate order for one or more courses. Supports guest checkout with email.
PUT/orders/confirmPublicConfirm order after payment (webhook/redirect).
PUT/orders/confirm-with-userAuthenticatedConfirm order for the authenticated user.
PUT/orders/finish-registerPublicFinish registration after guest checkout confirmation.

Services

  • courses: Register users to courses, calculate lecture durations, etc.
  • payments: Handles order creation and payment confirmation for Stripe and PayPal.
  • stripe: Integrates with Stripe for checkout sessions and payment status.
  • paypal: Integrates with PayPal for checkout sessions and payment status.

Data Models

  • Category: title, description, thumbnail, slug, courses
  • Course: title, duration, description, price, thumbnail, long_description, difficulty, language, category, slug, students, modules, instructor
  • Module: title, duration, course, lectures, slug, description
  • Lecture: title, slug, duration, video, module, description
  • StudentCourse: course, student, current_lecture, lectures_completed
  • Order: amount, user, confirmed, checkout_session, payment_method, items, response, courses
  • Instructor: name, bio, image, slug, designation, courses

See server/src/content-types/ for full schema details.