Lumora Documentation

Welcome to the documentation for Lumora, an online academy platform made of three projects: a Flutter mobile app for learners (Android and iOS), a NestJS + PostgreSQL backend API, and a Next.js admin panel. Learners browse and buy courses, watch lessons, take quizzes and timed live exams, and earn certificates. You run everything from the admin panel.

What is in this package: Accounts you need before you start: your own Firebase project (the app ships placeholder google-services.json and GoogleService-Info.plist files that you replace with your own, section 4) and, if you sell through Google Play, your own RevenueCat account (the app uses the RevenueCat SDK purchases_flutter for Google Play purchases; RevenueCat has its own pricing and terms, section 11). Full list: Third-Party Services and Costs.

Payments by platform: paid courses can be bought in the Android app (Google Play, and web gateways if you offer them) and on the web. The iOS app does not sell paid content: App Store purchases and web checkout are turned off on iOS, and only free courses can be taken there. Details: section 11, Payments by platform.

Setting up for the first time? Start with the backend (section 13), then the admin panel (section 14), then come back to the app (sections 1–12). The app needs a running backend to show anything.
Contents
  1. Feature Walkthrough
  2. Third-Party Services and Costs
  3. How the Pieces Connect (Architecture)
  4. 1. Prerequisites
  5. 2. Environment Setup
  6. 3. Change Package Name and Bundle ID
  7. 4. Firebase Setup
  8. 5. Google Sign-In and Push Notifications
  9. 6. Change App Name
  10. 7. App Icon, Splash and Brand Colours
  11. 8. Connect the App to Your Backend
  12. 9. Languages
  13. 10. Web Payment Gateways (Stripe, Flutterwave, Razorpay)
  14. 11. Google Play In-App Purchases (RevenueCat)
  15. 12. Build and Release
  16. 13. Backend Setup (NestJS)
  17. 14. Admin Panel Setup (Next.js)
  18. 15. Publish Your First Course
  19. 16. Marketplace Mode
  20. 17. API Reference
  21. 18. Database Schema
  22. 19. FAQ and Common Build Errors
  23. 20. Support
  24. 21. AI Disclosure
  25. 22. Changelog
  26. 23. Upgrading to a New Version

Feature Walkthrough

A plain-language tour of what the app does, so you can find your way around before touching any code. Nothing in this section needs programming knowledge; the technical setup starts at section 1.

Sign-in screen with email and Google
Sign in
Pick your topics
Pick your topics
Home screen with course rails
Home
Course details page
Course details

First launch

The main tabs

Checkout with coupon
Checkout and coupons
Payment methods: Stripe, Flutterwave, Razorpay and Google Play
Payment methods
Course player
Course player
Quiz overview
Quizzes

Buying a course

Learning

Live exams
Live exams
Certificate
Certificate
My Learning
My Learning
Account
Account

Languages and appearance

What you control from the admin panel

A tour of the admin panel with screenshots is in section 14.

Third-Party Services and Costs

Lumora is self-hosted: you receive the full source code, with no licence keys and nothing payable to us. Some features connect to outside services that are not included in the purchase.

Buyers are responsible for any and all fees charged by external services. This includes hosting, the database, file and video storage, developer accounts, payment processing fees, app store service fees, email sending and any usage beyond a provider's free tier. The item price covers the source code and documentation only. Prices change; check each provider's current rates.
Accounts you create yourself. Lumora ships no credentials of ours. Every key you enter belongs to an account you own, under that provider's terms:
ServiceRequired?Used forWho bills you
Server or cloud hostRequiredRuns the backend (Node.js 24 LTS or newer) and the admin panel. A VPS, or a serverless host such as VercelYour hosting provider
PostgreSQL databaseRequiredAll academy, course, learner and order data (PostgreSQL 15+)Your database host, or free on your own server
S3-compatible storage (Cloudflare R2, Amazon S3, others)Required for uploadsCourse pictures, lesson videos, documents and certificate files uploaded from the admin panel. Without it you can only paste links to files hosted elsewhereYour storage provider, usage-based
SMTP email providerRequired for password reset and emailed codesSending password-reset and verification codesYour email provider, beyond its free tier
Firebase (your own project)OptionalPush notifications (Cloud Messaging), crash reports (Crashlytics) and Google sign-in. The free plan covers typical use. Without it, those features are offGoogle, beyond the free plan
Google Sign-In (OAuth client IDs in your Google Cloud project)OptionalSign in with Google. Without it, learners use email and passwordFree
StripeOptionalHosted card checkoutStripe, a fee on each payment
FlutterwaveOptionalHosted checkout with cards, bank transfer and mobile moneyFlutterwave, a fee on each payment
RazorpayOptionalHosted checkout with cards, UPI and net bankingRazorpay, a fee on each payment
Google Play BillingOptionalIn-app purchase of a course on Android, with one-time products you create in Play ConsoleGoogle keeps a service fee on every purchase (commonly 15–30%)
RevenueCat (your own account)Required for Google Play purchasesTalks to Google Play for the app and confirms every purchase to the backendRevenueCat: free up to a monthly revenue limit, then a share of revenue
Apple In-App PurchaseNot supported in this versionTurned off in the iOS app: the iOS app sells no paid content (section 11)—
PayPal, bKash, Nagad, SSLCommerz and other gatewaysNot integratedNo checkout integration ships for these. Adding one is custom development—
Bunny StreamOptionalAdaptive video streaming with quality levels. Without it, lessons play as MP4 files from your storageBunny.net, usage-based
Zoom, Google Meet or JitsiOptionalLive classes: you paste a meeting link. Meetings run on your own accountThat provider, under its pricing
Google Play Developer accountRequired for AndroidPublishing the app; USD 25 one-timeGoogle
Apple Developer ProgramRequired for iOSPublishing the app; USD 99 per yearApple
AdsNot includedThe app shows no ads and ships no ad SDK—
Demo contentFreeThe optional demo data uses pictures and video clips from our CDN so a fresh install has something to show. The clips come from the Blender Foundation's open movies (CC BY 3.0). Replace them with your own courses before you go live—
Store rules. Google Play and the App Store have their own rules for selling digital content inside apps, including when web checkout may be offered. You choose which payment methods each course accepts (section 11). The iOS app sells no paid content in this version, so Apple's in-app payment rules for digital content are not triggered by checkout. You are responsible for checking those rules for your country and business, and for following the terms of every payment provider you use.

How the Pieces Connect (Architecture)

Lumora is three projects around one backend. Only the backend talks to the database and holds secrets; the app and the admin panel never see a database password or a payment secret key.

Flutter App learners, Android and iOS Flutter-App/ Admin Panel Next.js, staff in the browser Admin-Panel/ Backend API NestJS, https://api.your-domain.com Backend/ (PM2 or Vercel) orders, exams, certificates, push PostgreSQL all academy, learner and order data S3 storage / Bunny pictures, videos, documents Payment gateways Stripe, Flutterwave, Razorpay hosted checkout pages webhooks to the backend Firebase Cloud Messaging (push) Crashlytics, Google sign-in Google Play + RevenueCat in-app course purchases REST + X-Tenant + token REST + staff session Google ID token, push token push SQL upload links, signed lesson links pay webhook buy verify purchase, webhook
ConnectionWhat happens
App → BackendEvery request goes to your API_BASE_URL with the X-Tenant header (your academy slug). Signed-in learners also send their Lumora access token in Authorization: Bearer. The backend issues and refreshes these tokens itself.
App → Firebase → BackendFor Google sign-in, the app gets a Google ID token and the backend checks it against GOOGLE_CLIENT_IDS. The app also registers its push token with the backend after sign-in.
Admin panel → BackendStaff sign in with email and password. The admin panel's own server keeps the session in HttpOnly cookies and calls the backend's /console/* routes. The browser never calls the backend directly.
Backend → PostgreSQLAll data lives here. Only the backend connects. Money steps (order, payment, refund) each run in one database transaction.
Backend → S3 storage / Bunny StreamThe admin panel uploads files straight to your bucket with short-lived upload links from the backend. Learners get short-lived signed links to lesson files, or stream videos from Bunny Stream.
App → Gateway → BackendFor web checkout, the backend opens a hosted payment page (Stripe, Flutterwave or Razorpay) and the app shows it. The gateway's webhook tells the backend the result; the backend checks it with the gateway before it unlocks the course.
App ↔ Google Play / RevenueCat → BackendFor Google Play, the backend opens a pending order, the app buys the store product through RevenueCat, and the backend reads the purchase back from RevenueCat before it unlocks the course. RevenueCat's webhook also reports late purchases and refunds.
Backend → Firebase Cloud MessagingPush notifications (from the admin panel, exam reminders, announcements) are sent by the backend with your Firebase service account.
Scheduler → BackendA cron call to /internal/cron/minute every minute runs exam results, reminders, push delivery, missed-payment checks and cleanup.

1. Prerequisites

Use these versions for the smoothest build. The item was built and tested with the versions marked "tested".

Flutter SDKTested: 3.47.6
Min: 3.47.0 (Dart 3.13)
Java (JDK)17 or 21
(Android Studio's bundled JDK works)
Android StudioLatest stable, with the Android SDK
Xcode + CocoaPodsXcode 16 or newer, CocoaPods 1.16 or newer (iOS only)
Node.js24 LTS or newer
pnpm9 (admin panel; comes with Node through Corepack)
PostgreSQL15 or newer
IDEAndroid Studio or VS Code

Server size

The backend, PostgreSQL and the admin panel can run together on one Linux server (Ubuntu 22.04 or 24.04 LTS recommended). Videos, pictures and documents are stored in your S3-compatible bucket (or Bunny Stream), not on the server, so the disk only needs room for the code and the database.

CPURAMDiskGood for
Minimum1 vCPU2 GB (plus 2 GB swap)20 GB SSDTesting and a small academy
Recommended2 vCPU4 GB40 GB SSDLaunch, thousands of learners, live exams
Growing4 vCPU or more8 GB or more80 GB SSDMany learners in large live exams; consider a managed PostgreSQL

Building the admin panel (pnpm build) needs about 1.5 GB of free RAM; on a 2 GB server add swap first. A shared hosting plan (cPanel without SSH and Node.js) is not enough: you need a VPS or cloud server with SSH access, or a Node.js host such as Vercel.

Java version: the Android build runs on JDK 17 to 21. A newer JDK fails with "Unsupported class file major version". If java -version shows something newer, point Flutter at Android Studio's JDK: flutter config --jdk-dir "<Android Studio>/jbr".

2. Environment Setup

Select your operating system to see the setup steps.

Android Studio

  • Download Android Studio from the official page, run the installer and let it download the SDK components.
  • Optional: create an emulator in the Device Manager.

Flutter SDK

  • Download the stable Windows release from the Flutter download page and extract it, for example to C:\flutter.
  • Add C:\flutter\bin to the Path environment variable (This PC > Properties > Advanced system settings > Environment Variables).
  • Open a new Command Prompt and run flutter doctor. Fix anything it reports.

IDE

  • In Android Studio open File > Settings > Plugins > Marketplace, install the Flutter and Dart plugins and restart.
▶ Watch Windows Setup Video

Android Studio

  • Download Android Studio from the official page, drag it into Applications and complete the setup wizard.

Flutter SDK

  • Download the stable macOS release from the Flutter download page and extract it: tar xf flutter_macos_<version>.tar.xz
  • Add flutter/bin to your PATH in ~/.zshrc, then open a new terminal and run flutter doctor.

Xcode and CocoaPods (for iOS)

  • Install Xcode from the Mac App Store, open it once to finish installing components, then run sudo xcodebuild -runFirstLaunch.
  • Install CocoaPods: sudo gem install cocoapods (or brew install cocoapods).

IDE

  • In Android Studio open Settings > Plugins > Marketplace, install Flutter and Dart and restart.
▶ Watch macOS Setup Video

Android Studio

  • Download Android Studio from the official page, extract it (tar -xvzf android-studio-*-linux.tar.gz) and run bin/studio.sh.

Flutter SDK

  • Download the stable Linux release from the Flutter download page and extract it: tar xf flutter_linux_<version>.tar.xz
  • Add flutter/bin to your PATH, then run flutter doctor.

IDE

  • In Android Studio open File > Settings > Plugins > Marketplace, install Flutter and Dart and restart.
▶ Watch Linux Setup Video

Open and run the app

Set up the backend first (section 13) and create the app's configuration file (section 8). Then:

cd Flutter-App
flutter pub get
flutter run --dart-define-from-file=config/app_config.json

Generated code (models and translations) is already included. Regenerate it only after you change models or translation files:

dart run build_runner build --delete-conflicting-outputs
flutter gen-l10n

3. Change Package Name and Bundle ID

Every app needs a unique identifier, for example com.youracademy.app. Choose it before you set up Firebase (Firebase apps are registered by this identifier) and before your first Google Play upload (it can never change afterwards). The package ships with com.lumora.app.

Android

FileChange
android/app/build.gradle.ktsnamespace and applicationId
android/app/src/main/kotlin/com/lumora/app/MainActivity.ktMove the file to the folder that matches your id (for example kotlin/com/youracademy/app/) and change its first line to package com.youracademy.app

iOS

Tip: the Dart package name in pubspec.yaml is internal and never shown to learners. Leave it as it is; renaming it means updating every package: import.

4. Firebase Setup

Firebase provides push notifications, crash reports and the Google part of Google sign-in. Email and password accounts, sessions and everything else are handled by your own backend, not by Firebase.

You must use your own Firebase project. The package ships placeholder Firebase files with values such as YOUR_ANDROID_API_KEY and your-firebase-project-id. They let the project compile, but push notifications, crash reports and Google sign-in will not work until you replace them: No Firebase project of ours is included, so your app never connects to our accounts.

Step 1: Create a Firebase project

Step 2: Add the Android app

Step 3: Add the iOS app (optional)

Step 4: Turn on what you use

Step 5: Service account for the backend

The backend sends push notifications with a Firebase service account: Project settings > Service accounts > Generate new private key. Put the whole JSON on one line in the backend's FCM_SERVICE_ACCOUNT_JSON (section 13). Keep this file secret; it is never part of the app.

▶ Firebase + Flutter video tutorials

5. Google Sign-In and Push Notifications

Firebase is your own project, under your own Google account and Google's terms (see Third-Party Services). Every key below comes from your account.

Google sign-in

The app asks Google for an ID token and sends it to your backend (POST /auth/google), which checks it and starts a normal Lumora session.

Push notifications

6. Change App Name

Two names exist: the one under the icon on the phone, which is built into the app, and the academy name shown inside the app, which comes from your backend.

WhereFile or setting
Android home screenandroid:label="Lumora" in android/app/src/main/AndroidManifest.xml
iOS home screenCFBundleDisplayName in ios/Runner/Info.plist
Inside the appAdmin panel > Settings > General (the academy name). No rebuild needed

7. App Icon, Splash and Brand Colours

App icon

Splash screen

Brand colours (no rebuild)

Set the Main colour and Accent colour in the admin panel (Settings > Branding, also step 1 of the first-run setup). The app builds its whole light and dark palette from these two values the next time it starts. Example: Main #0F766E (teal) and Accent #E2725B (coral) are the defaults.

Without these settings the app uses its built-in palette in lib/src/core/theme/src/theme_extensions/src/colors/semantic.dart, for example:

static const Color teal = Color(0xFF0D6E6E);  // #0D6E6E, brand primary
static const Color coral = Color(0xFFFF6B4A); // #FF6B4A, accent

The logo shown inside the app is also set in Settings > Branding.

8. Connect the App to Your Backend

The app's build settings live in one file. Create it from the example:

cd Flutter-App
cp config/app_config.example.json config/app_config.json
{
  "API_BASE_URL": "https://api.your-domain.com",
  "TENANT": "acme",
  "GOOGLE_WEB_CLIENT_ID": "000000000000-xxxxxxxxxxxxxxxx.apps.googleusercontent.com"
}
KeyMeaning
API_BASE_URLThe address of your backend: https, no trailing slash. For a local backend on an Android emulator use http://10.0.2.2:3000; on a real phone use your computer's network address (http://192.168.x.x:3000). Release builds need https.
TENANTYour academy slug, the DEFAULT_TENANT_SLUG you chose on the backend. Sent as the X-Tenant header.
GOOGLE_WEB_CLIENT_IDThe Firebase project's Web client ID (section 5). Leave the example value if you do not use Google sign-in.

Pass the file to every run and build:

flutter run --dart-define-from-file=config/app_config.json
Everything else comes from the backend. The academy name, logo, colours, languages, payment methods, feature switches (exams, live classes, downloads), support email and legal pages are read from GET /app/config and cached on the phone. Change them in the admin panel; no new build is needed.

config/app_config.json is listed in .gitignore, so your values stay out of version control. A build without the file uses the placeholders in lib/src/core/config/build_config.dart and cannot reach any server.

9. Languages

The app ships five languages: English (en), Bengali (bn), Hindi (hi), Arabic (ar, right-to-left) and Spanish (es). In the admin panel (Settings > General > Languages) you choose which ones learners can pick and which one a new install starts with. The admin panel itself is in English.

What a language file looks like

Each language is one file in lib/l10n/: app_en.arb, app_bn.arb and so on. Every key has the same name in every file. A plain text and a text with a value inside:

{
  "@@locale": "en",
  "commonRetry": "Retry",
  "payStoreSubtitle": "Pay with your {store} account, in your local currency",
  "@payStoreSubtitle": {
    "placeholders": { "store": { "type": "String" } }
  }
}

Add a language (example: French)

Remove a language

10. Web Payment Gateways (Stripe, Flutterwave, Razorpay)

Learners pay on the gateway's own hosted page, shown inside the app. Card data never reaches your server or the app. Each gateway is optional; turn on one or more. Every account is your own, and each provider charges its own fee per payment.

Step 1: Enter the keys

In the admin panel open Settings > Payments, open the gateway and enter its keys. Keys saved here are encrypted with the backend's SETTINGS_ENCRYPTION_KEY (set it first; section 13). Alternatively, set them as backend environment variables.

GatewayFieldsWhere to find themEnvironment variables
StripeSecret key, webhook secretDevelopers > API keys > Secret key (sk_test_… / sk_live_…). The webhook secret (whsec_…) comes from step 2STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET
FlutterwaveSecret key, webhook secret hashSettings > API keys > Secret key. The secret hash is a long random string you make up (step 2)FLUTTERWAVE_SECRET_KEY, FLUTTERWAVE_WEBHOOK_HASH
RazorpayKey ID, key secret, webhook secretAccount & Settings > API Keys > Generate key. The webhook secret is a long random string you make up (step 2)RAZORPAY_KEY_ID, RAZORPAY_KEY_SECRET, RAZORPAY_WEBHOOK_SECRET

Click Test next to the gateway: the backend makes one read-only call to the provider and reports whether the keys work.

Step 2: Add the webhook

Webhooks settle an order even when the learner closes the app right after paying, and they report refunds. The admin panel shows each gateway's webhook URL: https://api.your-domain.com/webhooks/<gateway>/<your academy slug>, for example https://api.your-domain.com/webhooks/stripe/acme. Set the backend's PUBLIC_API_URL first so the URL is right. Test mode and live mode each have their own keys and webhook.

Step 3: Turn it on

Payment simulator (local testing only)

Never turn this on in production. While PAYMENT_SIMULATOR_ENABLED=true, any signed-in learner can mark their own order as paid without paying, for every gateway that has no keys.

What it does. The simulator lets a developer test the purchase flow (order, access to the course, My Learning, certificates) before any payment gateway is set up. With it on, the backend accepts a gateway that has no keys, and an order on such a gateway can be settled with one API call instead of a real payment. Orders on a gateway that has keys, and all Google Play / App Store orders, are always paid for real; the simulator refuses them. It is a backend tool for developers: the learner app has no simulator button.

How to turn it on for local testing:

  1. On your own computer, set PAYMENT_SIMULATOR_ENABLED=true in the backend's .env and restart the backend. The log shows a warning: PAYMENT_SIMULATOR_ENABLED=true: orders on a gateway without keys can be marked paid without money changing hands.
  2. Create an order as a signed-in learner (POST /checkout/orders, section 17). Its answer contains "payment": { "action": "simulate", "endpoint": "/checkout/orders/<id>/simulate-payment" }.
  3. Settle it with the learner's token:
    curl -X POST http://localhost:3000/checkout/orders/ORDER_ID/simulate-payment \
      -H "Authorization: Bearer LEARNER_ACCESS_TOKEN" -H "X-Tenant: your-academy-slug" \
      -H "Content-Type: application/json" -d '{"outcome":"success"}'
    "outcome": "success" marks the order paid and unlocks the courses; "failed" closes it and gives the coupon back.

How to confirm it is off before you go live:

  1. Open the backend's production .env (or your host's environment variables, for example on Vercel) and check that PAYMENT_SIMULATOR_ENABLED is false or not there at all. It is off unless it is exactly true.
  2. Restart the backend and read the start-up log (pm2 logs lumora-backend). With the simulator on, a production server logs an error: ... Turn it off before taking real orders. No such line means it is off.
  3. Optional check: call POST /checkout/orders/ANY_ORDER_ID/simulate-payment as a learner. With the simulator off the answer is 403 with Payment simulator is disabled.
Safety rules built in: nothing in a webhook body is trusted; the backend reads the payment again from the provider. Each event is processed once. If a webhook never arrives, the minute cron asks the provider about open payments, so orders still settle. Money that arrives for an order that can no longer take it is refunded automatically, or flagged on the order for you.

11. Google Play In-App Purchases (RevenueCat)

On Android, learners can buy a course with Google Play. Stores sell from a catalogue of products with prices set per country, so a course bought this way is paid with a store product (for example course_999 at USD 9.99) instead of the course's own price. Many courses can share one product. RevenueCat connects the app to Google Play and confirms every purchase to your backend.

Your accounts, your costs: you need your own Google Play Developer account, your own products in Play Console and your own RevenueCat account. Google keeps a service fee on every purchase; RevenueCat is free up to a monthly revenue limit and then takes a share.

Payments by platform

PlatformPaid courses and bundlesFree courses
Android appGoogle Play in-app purchase (RevenueCat), and the web gateways Stripe, Flutterwave and Razorpay if you offer them on AndroidYes
WebStripe, Flutterwave and RazorpayYes
iOS appNot available. The iOS app has no App Store purchases and no web checkout. A paid course shows its price and the note "Paid courses can't be bought in the iOS app"Yes (also orders that a 100% coupon makes free)
iOS: no paid checkout. App Store purchases have not been tested, and Apple does not allow web checkout for digital content inside an iOS app. So the iOS app turns both off: Course Details and the bundle page show the price and a note instead of Add to cart / Buy now, Wishlist hides "Add all to cart", and the Payment page shows no methods for a paid order. Free courses work on iOS as usual. The switch is one getter, paidCheckoutAvailable in Flutter-App/lib/src/core/billing/purchase_platform.dart. Steps 1–5 below are for Google Play, which is tested end to end.

Step 1: Create the products in Play Console

Step 2: Set up RevenueCat

Step 3: Enter the keys

In the admin panel open Settings > Payments > App stores > Google Play and enter:

FieldValueEnvironment variable
Secret keyRevenueCat secret API key (sk_…). Server onlyREVENUECAT_SECRET_KEY
SDK keyRevenueCat public SDK key (goog_…). Sent to the appREVENUECAT_GOOGLE_SDK_KEY
Webhook authorizationA long random string you make up (step 4)REVENUECAT_WEBHOOK_AUTH

Saving keys in the admin panel needs the backend's SETTINGS_ENCRYPTION_KEY; the environment variables work without it. Switch Google Play on. Its display name and logo (shown on the app's Payment page) can be changed on the same screen.

Step 4: Add the webhook

In RevenueCat open Integrations > Webhooks > Add:

The webhook settles a purchase when the app closed before it could confirm, and removes access when a purchase is refunded from the store.

Step 5: Add the store products in the admin panel

Payment methods per course

Testing

App Store purchases (turned off, for developers)

Not supported in this version. App Store purchases are turned off in the iOS app and are not part of the supported features. The backend and the admin panel still contain App Store support through the same RevenueCat flow, but it has not been tested on a real iPhone or with App Store Connect. A developer who wants to sell on iOS must finish and test it end to end: change paidCheckoutAvailable and StoreBillingServiceImpl.isSupported in the app so App Store purchases run on iOS, keep web gateways off for iOS, and test with Apple's sandbox testers, including a refund. This is custom development and is not covered by item support.

The steps mirror Google Play:

  1. In App Store Connect create consumable in-app purchases with the same product IDs as your Google Play products (Paid Applications agreement signed first).
  2. In RevenueCat add an App Store app with your bundle ID, connect it to App Store Connect as RevenueCat's setup asks, import the products and copy the app's public SDK key (appl_…).
  3. In the admin panel open Settings > Payments > App stores > App Store, enter the same RevenueCat secret key and webhook authorization as for Google Play plus the appl_… SDK key (environment variable REVENUECAT_APPLE_SDK_KEY), and switch it on.
  4. Add the products under Sales > Store products with the store set to App Store. The RevenueCat webhook URL is the same as for Google Play.
  5. In Xcode add the In-App Purchase capability, then test with a sandbox tester on a real device: buy, check the order in the admin panel, check the course unlocks, then refund and check access is removed.

How it stays correct

The app's word and the webhook body are never trusted: the backend reads every purchase back from RevenueCat and settles the order by the store transaction ID, so one purchase can never unlock two courses. A purchase that completes after its order was closed (for example a Play "pending" purchase paid days later) reopens the order within 7 days; otherwise it is flagged on the order for a refund from the store console.

12. Build and Release

Version number

Set version: in pubspec.yaml, for example 1.0.0+1: 1.0.0 is the version name learners see and 1 is the build number. Raise the build number for every upload to Google Play. Android reads both from pubspec.yaml.

Android: create an upload keystore

keytool -genkey -v -keystore /path/to/your/upload-keystore.jks -keyalg RSA \
  -keysize 2048 -validity 10000 -alias upload

Back up the keystore file and its passwords. If you lose them, you must ask Google to reset your upload key.

Android: key.properties

cp android/key.properties.example android/key.properties
storePassword=your-store-password
keyPassword=your-key-password
keyAlias=upload
storeFile=/path/to/your/upload-keystore.jks

/path/to/your/upload-keystore.jks is a placeholder: replace it with the full path to your own keystore file, on Windows, macOS or Linux. Use forward slashes / even on Windows. A path relative to the android/ folder, such as ../keys/upload-keystore.jks, also works.

android/app/build.gradle.kts reads this file in its signingConfigs block and signs release builds with it. key.properties and your keystore are git-ignored; never share them. Without key.properties, a release build is signed with the public debug key android/app/lumora-debug.jks and Gradle prints a warning: such a build installs and runs, but never upload it to Google Play. Debug and profile builds always use that debug key, so Google sign-in works in debug once its SHA-1 is registered in Firebase.

Android SDK levels: android/app/build.gradle.kts sets compileSdk = 36, targetSdk = 36 and minSdk = 24 (Android 7.0) as fixed numbers, so they do not change with your Flutter version.

Android: build

PurposeCommand
Google Play (App Bundle)flutter build appbundle --release --obfuscate --split-debug-info=build/symbols --dart-define-from-file=config/app_config.json
APKs per CPU, to share yourselfflutter build apk --release --split-per-abi --obfuscate --split-debug-info=build/symbols --dart-define-from-file=config/app_config.json
Debug APKflutter build apk --debug --dart-define-from-file=config/app_config.json

Output: build/app/outputs/bundle/release/app-release.aab (upload this to Play) and build/app/outputs/flutter-apk/. Keep the build/symbols folder for every released version: without it, crash stack traces cannot be read. Upload it to Crashlytics with firebase crashlytics:symbols:upload --app=<your Firebase Android app ID> build/symbols.

iOS: build

Test on a real device

13. Backend Setup (NestJS)

The backend is the heart of Lumora: the app and the admin panel both talk to it. It needs Node.js 24 LTS or newer and PostgreSQL 15 or newer. The commands below are for a Linux server (Ubuntu); they work the same on macOS for local testing.

Step 1: Install

cd Backend
npm ci

Step 2: Create the database

sudo -u postgres psql
CREATE USER lumora WITH PASSWORD 'choose-a-strong-password';
CREATE DATABASE lumora OWNER lumora;
\q

The tables are created by the migrations in step 4. Any hosted PostgreSQL (Supabase, Neon, Amazon RDS, DigitalOcean) works too; use the connection string it gives you.

Step 3: Configure .env

cp .env.example .env

Every variable is explained in .env.example. The ones you must look at:

VariableExampleWhat it is
NODE_ENVproductionUse production on your server
PORT3000Port the API listens on
DATABASE_URLpostgresql://lumora:password@localhost:5432/lumoraRequired. Your database
JWT_SECREToutput of openssl rand -base64 48Required. Signs sign-in tokens; 32 characters or more
PUBLIC_API_URLhttps://api.your-domain.comThe public address of the API, used in webhook URLs and certificate links
DEFAULT_TENANT_SLUGacmeYour academy's short name (lowercase letters, digits, dashes). Must match the app's TENANT (section 8)
SETUP_OWNER_EMAIL, SETUP_OWNER_PASSWORDowner@your-domain.com, a long passwordYour first admin account, created by step 4
SETUP_TENANT_NAME, SETUP_CURRENCY, SETUP_BUSINESS_MODEAcme Academy, USD, academyOptional. Academy name, currency (locked after the first order) and mode: academy (one school) or marketplace (many instructors and organizations)
SETTINGS_ENCRYPTION_KEYoutput of openssl rand -base64 48Needed to save payment keys, an SMTP password or a Bunny library in the admin panel. Keep it stable and backed up
CRON_SECRETa long random stringProtects the minute cron route (step 7)
GOOGLE_CLIENT_IDSyour Web client IDFor Google sign-in. Must contain the app's GOOGLE_WEB_CLIENT_ID (section 5)
FCM_SERVICE_ACCOUNT_JSONthe service account JSON on one lineFor push notifications (section 4)
S3_*, MEDIA_BUCKET, PUBLIC_MEDIA_BUCKET, PUBLIC_MEDIA_BASE_URLsee step 10File storage for uploads
SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, SMTP_FROMyour mail provider's valuesPassword-reset and verification emails (step 11)
TRUST_PROXY1 behind nginxSo rate limits see the real client address (step 9)

The server refuses to start when DATABASE_URL or JWT_SECRET is missing or a value is malformed, and tells you which one.

Step 4: Build and create the database tables

npm run build
npm run db:migrate

This is the real output on an empty database:

> lumora-backend@1.0.0 db:migrate > node scripts/db.js migrate applied 0001_platform.sql applied 0002_catalogue.sql applied 0003_assessment.sql ... (one line per migration file) applied 0055_course_payment_methods.sql 54 migration(s) applied created tenant acme 1 created platform settings (academy, USD) created platform seller created user owner@your-domain.com 2 created owner role for owner@your-domain.com Set DEFAULT_TENANT_SLUG=acme for the API (or send "X-Tenant: acme"), then sign in to the console as owner@your-domain.com.
  1. Your academy is created from DEFAULT_TENANT_SLUG, SETUP_TENANT_NAME and SETUP_CURRENCY.
  2. Your owner account is created from SETUP_OWNER_EMAIL and SETUP_OWNER_PASSWORD. Use it to sign in to the admin panel.

Running it again is safe. It applies only new migration files and never overwrites the owner or the password:

database is up to date owner account ready: owner@your-domain.com (acme), nothing to create

Step 5: Start and check

npm run start:prod
> lumora-backend@1.0.0 start:prod > node dist/main.js [Nest] 54634 - 11/23/2026, 11:17:02 PM LOG [NestFactory] Starting Nest application... [Nest] 54634 - 11/23/2026, 11:17:02 PM WARN [MediaUrlService] S3 is not configured: uploaded lesson files will have no link 1 [Nest] 54634 - 11/23/2026, 11:17:02 PM LOG [NestApplication] Nest application successfully started +2ms [Nest] 54634 - 11/23/2026, 11:17:02 PM LOG [Bootstrap] Lumora backend listening on 0.0.0.0:3000 [production] 2
  1. Normal until you set up storage in step 10. Other optional services log a similar warning while they are not configured.
  2. The API is running. (Between these lines Nest lists every route it mapped; that is normal.)

Check it in a terminal

$ curl -s http://localhost:3000/health
{"success":true,"message":"Service healthy","body":{"status":"ok","env":"production","database":"up"}}

$ curl -s -H "X-Tenant: acme" http://localhost:3000/app/config
{"success":true,"message":"OK","body":{"tenant":{"slug":"acme","name":"Acme Academy"},"businessMode":"academy","appName":"Acme Academy","branding":{"logoUrl":null,...,"primaryColor":"#0F766E","accentColor":"#E2725B"},"currency":"USD",...}}

Replies like these mean the API, the database and your academy all work.

Step 6: Lock it down after the first sign-in

Step 7: The minute cron

Exam results, exam reminders, push delivery, missed-payment checks and cleanup run when /internal/cron/minute is called. Call it every minute with your CRON_SECRET. On your own server, add one line with crontab -e:

* * * * * curl -fsS -H "Authorization: Bearer YOUR_CRON_SECRET" https://api.your-domain.com/internal/cron/minute > /dev/null

On Vercel, vercel.json already schedules it and Vercel sends the header itself once CRON_SECRET is set in the project. Per-minute schedules need a paid Vercel plan.

Step 8: Keep it running with PM2

sudo npm install -g pm2
pm2 start prod.config.js      # starts "lumora-backend" from dist/main.js
pm2 save
pm2 startup                   # run the command it prints, so PM2 starts after a reboot

Logs: pm2 logs lumora-backend. After a code update: npm ci && npm run build && npm run db:migrate && pm2 restart lumora-backend.

Step 9: nginx and HTTPS

Point api.your-domain.com at your server, then add an nginx site:

server {
    server_name api.your-domain.com;
    client_max_body_size 2m;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
sudo ln -s /etc/nginx/sites-available/lumora-api /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d api.your-domain.com

Set TRUST_PROXY=1 in .env (one proxy: nginx). With a CDN such as Cloudflare in front of nginx, use 2. Large files never pass through nginx: the admin panel uploads them straight to your storage.

Step 10: File storage (S3-compatible)

Uploads from the admin panel go straight to your bucket. Lumora works with Cloudflare R2, Amazon S3, Backblaze B2, MinIO and other S3-compatible services.

Without storage you can still paste links to images and videos hosted elsewhere.

Step 11: Email (SMTP)

Set SMTP_HOST, SMTP_PORT (465 or 587), SMTP_USER, SMTP_PASS and SMTP_FROM for password-reset and verification codes. Any provider works (your host's mail server, Amazon SES, Brevo, Mailgun, Gmail with an app password). You can also enter an SMTP account in the admin panel (Settings > Email), which then takes priority.

Step 12: Optional integrations

FeatureWhat to setSection
Push notificationsFCM_SERVICE_ACCOUNT_JSON4
Google sign-inGOOGLE_CLIENT_IDS5
Stripe, Flutterwave, RazorpayKeys in Settings > Payments (or env keys) and webhooks10
Google Play (RevenueCat)Keys in Settings > Payments > App stores and the RevenueCat webhook11
Bunny Stream videoSettings > Video in the admin panel, or BUNNY_STREAM_*admin panel

Demo data (optional)

To try Lumora with sample courses, learners and orders on a separate test database, run npm run db:seed after the migrations. It creates the academy demo with the accounts owner@demo.lumora.test and learner@demo.lumora.test (password lumora-demo-123). Never run it on your live database, and never keep the demo accounts on a public server.

npm run demo:math adds one complete sample course (maths, with quizzes in every question format and a live exam) to your academy, which is handy for testing checkout and the player.

Alternative: deploy to Vercel

Security settings

Troubleshooting

ProblemFix
"DATABASE_URL is required" or "JWT_SECRET must be at least 32 characters"Set them in .env in the Backend folder (the folder you start the server from)
ECONNREFUSED 127.0.0.1:5432PostgreSQL is not running or listens elsewhere: sudo systemctl status postgresql, and check host and port in DATABASE_URL
password authentication failedThe user or password in DATABASE_URL is wrong. Special characters in the password must be URL-encoded (@ = %40)
EADDRINUSE: address already in use :::3000Another process uses the port: change PORT, or stop it (pm2 list, sudo lsof -i :3000)
Requests fail with TENANT_NOT_FOUND ("Unknown tenant") or TENANT_REQUIREDThe X-Tenant slug does not exist, or none was sent and DEFAULT_TENANT_SLUG is empty. Check DEFAULT_TENANT_SLUG, the app's TENANT and the admin panel's LUMORA_TENANT
Uploads fail in the admin panelStorage is not configured (step 10), or the bucket's CORS rule does not allow PUT from the admin panel's address
No password-reset email arrivesCheck the SMTP values and the spam folder; the server log shows the SMTP error. Many hosts block port 25; use 465 or 587
Exam results or push notifications never appearThe minute cron is not running (step 7). Test it: curl -H "Authorization: Bearer YOUR_CRON_SECRET" https://api.your-domain.com/internal/cron/minute
Payment keys cannot be saved (409)Set SETTINGS_ENCRYPTION_KEY and restart
Webhooks answer 400The webhook secret in the admin panel does not match the one in the provider's dashboard, or a proxy rewrites the request body. Do not put a body-changing proxy or firewall rule in front of /webhooks/

14. Admin Panel Setup (Next.js)

The admin panel is a Next.js 15 app. Its own server talks to the backend; the browser never calls the backend directly and never sees a token. It stores no data of its own.

Step 1: Install and configure

cd Admin-Panel
corepack enable          # makes the pnpm version in package.json available
pnpm install
cp .env.example .env.local
VariableExampleWhat it is
API_BASE_URLhttp://localhost:3000 or https://api.your-domain.comYour backend. Read on the server only
LUMORA_TENANTacmeYour academy slug. Leave empty to use the backend's DEFAULT_TENANT_SLUG

Step 2: Run

pnpm dev
▲ Next.js 15.5.26 - Local: http://localhost:3001 - Environments: .env.local ✓ Starting... ✓ Ready in 8.9s ✓ Compiled /sign-in in 491ms (614 modules) GET /sign-in 200 in 718ms

Open http://localhost:3001. You should see the sign-in page with your academy's name:

Lumora admin sign-in page showing the academy name
The sign-in page. Sign in with the backend's SETUP_OWNER_EMAIL and SETUP_OWNER_PASSWORD. Learner accounts are refused here. (The small "N" in the corner is Next.js's development indicator; it does not appear in production.)

If sign-in fails with "We could not reach the server", check that the backend is running and that API_BASE_URL is right.

First-run setup wizard (5 steps)

The first time the owner signs in to a new academy, the admin panel opens Set up your academy instead of the dashboard. It has five steps, shown as tabs at the top. Each step saves on its own with its own button, so save before you click Next. Nothing here is final: every value can be changed later under Settings, and you can jump between steps with the tabs. The red numbers on each screenshot match the numbered notes under it.

1. Brand→2. Business mode→3. Currency & languages→4. Payment methods→5. Legal pages→Finish setup

Step 1 of 5: Brand

Setup step 1, Brand: logo, app icon, splash image, main and accent colour, preview
Step 1: how the app looks.
  1. Logo: shown at the top of the app. Click Upload (needs file storage on the backend, section 13 step 10) or paste an https:// link to a PNG with a transparent background. Leave empty for none.
  2. App icon: a square 1024 × 1024 image. It is built into the app, so it reaches learners with your next app release (section 7).
  3. Splash image: shown while the app opens. Also built into the app.
  4. Main colour: buttons, links and headers. Pick a colour or type a hex code such as #0F766E.
  5. Accent colour: highlights, badges and offers. Both colours reach the app straight away, with no new build.
  6. Preview: a rough picture of the two colours together.
  7. Save changes: saves this step.
  8. Next: goes to step 2.

Step 2 of 5: Business mode

Setup step 2, Business mode: Academy or Marketplace, and leaderboard names
Step 2: who sells courses on your platform.
  1. Academy (the default, marked current): you sell your own courses. Choose this if you are one school or one teacher.
  2. Marketplace: outside instructors and organizations can apply, publish their own courses and earn a share of each sale, and you keep a commission. See section 16.
  3. Leaderboards: whether learners appear on exam leaderboards by name or anonymously by default.
  4. Save changes: saves the leaderboard choice.
  5. Switch to Marketplace: changes the mode. It asks for a short reason, which goes into the activity log. If you are not sure, stay in Academy mode; you can switch later in Settings > Business.

Step 3 of 5: Currency & languages

Setup step 3: academy name, app name, support email, languages, currency, refund window, tax and order prefix
Step 3: your academy's name, languages and money settings (example values filled in).
  1. Your academy: Academy name (shown in the admin panel and on receipts), App name (the name under the app icon; needs a new app build) and Support email (for your own records; add it to the Help & support page in step 5 if learners should see it).
  2. Offered in the app: tick the languages learners may choose. English is always on.
  3. Default language: the language new learners start in. Course titles and category names must be filled in this language.
  4. Currency: a three-letter code such as USD, EUR or INR. It is locked after the first order, so set it now.
  5. Refund window (days): how long after buying a learner may ask for a refund. 0 means no refunds. In Marketplace mode, a seller's share becomes payable after this window.
  6. Tax (%): 0 hides the tax line at checkout. Tick Prices already include tax if your prices are tax-inclusive.
  7. Order number prefix: 1–5 capital letters or digits; order numbers look like LM-2026-000123.
  8. Save changes.

Step 4 of 5: Payment methods

Setup step 4: payment gateways with keys, webhook and paywall settings, and app stores
Step 4: how learners pay. Stripe is opened here as the example; Flutterwave and Razorpay work the same way.
  1. The gateway (here Stripe), with its state: Disabled, Test or Live, and whether keys are saved.
  2. API keys, webhook and paywall: click to open the gateway's settings.
  3. Keys: paste the keys from your own account with the provider, then click Save keys. They are stored encrypted and never shown again (only their last characters). Where to find each key: section 10.
  4. Test connection: after saving, checks that the saved keys work.
  5. Webhook URL: click Copy and add it in the provider's dashboard, following the numbered steps shown under it. Webhooks are how orders become paid.
  6. Offered in: the platforms that show this method (Android app, web). The "iOS app" option has no effect: the iOS app sells no paid content (section 11). Google Play has its own rules for selling digital content inside apps; check them before you offer web checkout on Android.
  7. Offer at checkout: tick it, choose Test or Live keys, and click Save. The app's Payment page lists the method at once.
  8. App stores: Google Play purchases through RevenueCat, set up in section 11. Leave the App Store row off: the iOS app does not use it (section 11).

You can skip this step and come back later from Settings > Payments. Until at least one method is on, learners can take free courses but cannot buy paid ones.

Step 5 of 5: Legal pages

Setup step 5: legal and help pages with a rich text editor per language
Step 5: the pages learners read in the app.
  1. Page: Terms of use, Privacy policy, Refund policy, About us, Contact, or Help & support. Pick one to edit.
  2. Language: each page is written once per language. A page not written in a language yet says so under the tabs.
  3. Title of the page in that language.
  4. Page body: write it in the Visual editor (headings, lists, links, images, tables), paste HTML in the HTML tab, or check it in Preview.
  5. Save page: saves this page in this language. Repeat for each page and language you need.
  6. Finish setup: marks the setup as done and opens the dashboard. The wizard does not open again; everything stays editable in Settings.
Google Play and the App Store require a privacy policy for apps with accounts. Write at least the Privacy policy and Terms of use before you publish the app. The texts must fit your own business and country; Lumora does not supply legal text.

Next: publish your first course (section 15).

Step 3: Go live

On your own server with PM2:

pnpm build
pm2 start prod.config.js      # starts "lumora-admin" on port 3001
pm2 save

Then an nginx site for admin.your-domain.com, the same as the backend's in section 13 step 9 but with proxy_pass http://127.0.0.1:3001;, and sudo certbot --nginx -d admin.your-domain.com. Set API_BASE_URL to the backend's address before pnpm build, and rebuild after you change it.

On Vercel: import the Admin-Panel folder, add API_BASE_URL and LUMORA_TENANT in the project's environment variables and deploy.

Roles

RoleCan
OwnerEverything, including payment keys, team and business mode
AdminEverything except owner-only settings
Content managerCourses, bundles, categories, exams, app home, FAQ
SupportLearners, reviews, questions, notifications
FinanceOrders, refunds, coupons, revenue
Instructor, organization adminMarketplace mode only: their own courses, bundles, reviews, questions and earnings (the Studio)

What you can manage

Admin panel tour

What the main pages look like, from the demo academy with sample courses.

Courses list with status, price and enrolments
Courses: every course with its status, price and learners
Course details and pricing step
Course details and pricing, including the payment methods the course accepts
Course curriculum with sections and lessons
Curriculum: sections and lessons (video, article, document, quiz)
Quiz builder
Quiz builder with pictures and maths equations
Live exams
Live exams: schedule, monitor and publish results
App home banners and rails
App home: banners and course rails, in the order learners see them
Learners
Learners, with CSV export
Orders
Orders and refunds
Coupons
Coupons: percent or fixed, public or private, usage limits
Push notifications composer
Push notifications to all learners, one course's learners, or learners who have been away
General settings
Settings: your academy, money and languages
Feature switches
Feature switches: turn app features on or off without a release
Team and roles
Team and staff roles

Troubleshooting

ProblemFix
"This account has no console access"You signed in with a learner account. Use the owner account or a team member
Sign-in fails or every page shows an errorAPI_BASE_URL is wrong or the backend is down. Check curl API_BASE_URL/health from the admin panel's server
Changes to .env.local have no effectRestart pnpm dev; in production run pnpm build again and restart
Images upload but do not showPUBLIC_MEDIA_BASE_URL on the backend does not point at the public bucket or CDN
pnpm: command not foundRun corepack enable (Node.js 24+), or npm install -g pnpm@9
Build runs out of memoryAdd swap on small servers, or build on your computer and copy the .next folder

15. Publish Your First Course

This walkthrough takes a new course from nothing to visible in the app, using only the admin panel. It assumes the backend and admin panel are running (sections 13 and 14) and the setup wizard is finished. It takes about ten minutes. The red numbers on each screenshot match the notes under it.

1. Category→2. New course→3. Details & price→4. Sections & lessons→5. Lesson content→6. Publish→7. Home rail→8. Check the app

Step 1: Create a category

Learners browse courses by category, and every course needs one. Open Catalogue > Categories and click New category.

New category dialog
A category called "Design".
  1. Name in your default language (required). The other languages are optional; an empty one falls back to the default.
  2. Parent: leave None (top-level), or pick a category to make this a sub-category. There are two levels.
  3. Show in the app: keep it ticked. Optionally add an icon (an emoji works) and a position.
  4. Save.

Step 2: Create the course

Open Catalogue > Courses and click New course.

New course dialog with the title field
Only the title is needed to start.
  1. Title: 3 to 160 characters. You can change it later.
  2. Create draft: creates the course as a Draft (learners cannot see drafts) and opens it.

Step 3: Details and price

The course opens on the Details & pricing tab. Fill it in and save.

Course details and pricing form
The Details & pricing tab with example values.
  1. Title as learners see it.
  2. Subtitle: one line under the title on the course page.
  3. Description: what the course is about.
  4. Category: the one from step 1. Also set the Level and the language the course is taught in.
  5. What learners will learn: one point per line. Requirements, Who this course is for and This course includes work the same way. Topics help search.
  6. Thumbnail: click Upload (needs file storage on the backend) or paste an https:// link. A 16:9 picture works best. A promo video link (YouTube, Vimeo or a video file) is optional.
  7. Price in your academy currency, or tick Free course. A Was price shows as a strike-through; Put this course on sale adds a sale price for a period.
  8. Payment methods: every method that is on in Settings > Payments is accepted. Untick one to exclude it for this course only. A Google Play store product can also be linked here (section 11).
  9. Certificate on completion: learners get a certificate when they finish. Below it: lifetime or time-limited access, and the lesson order (free or sequential).
  10. Save changes.

Step 4: Add sections and lessons

Open the Curriculum tab. A course is made of sections, and each section holds lessons.

Curriculum tab with a section, two video lessons and a quiz
One section with two video lessons and a quiz. "No video yet" warns about a lesson that still needs its content.
  1. Section: type a section title in the box at the bottom (5) and click Add section. Use the arrows to reorder and Rename to change it.
  2. Add a lesson: choose the type (Video, Document, Article or Quiz), type the title and click Add lesson.
  3. Edit: opens the lesson to add its video, file or text (step 5).
  4. Edit questions: for a quiz lesson, opens the quiz builder (questions, pictures, maths, pass mark, attempts).
  5. Add section: adds the next section.

Step 5: Add the lesson content

Edit video lesson dialog
A video lesson using a YouTube link.
  1. Title of the lesson.
  2. Video: where the video comes from: a YouTube link, a Vimeo link, a Direct video link, Upload MP4 (needs file storage) or Stream (adaptive) when Bunny Stream is set up. Then set the length in minutes.
  3. Link: the video address. Unlisted YouTube videos cost nothing to host.
  4. Required: later lessons stay locked until this one is finished. The completion threshold sets how much must be watched (90% by default).
  5. Free preview: anyone can watch this lesson before buying. One or two previews help sales.
  6. Save. Attachments (PDFs and other files for this lesson) can be added in the same dialog.

Document lessons take a PDF or slide file, article lessons a formatted text, and quiz lessons their questions. Fill every lesson before you publish.

Step 6: Publish

Click Publish at the top right of the course.

Publish course confirmation dialog
The confirmation: a published course appears in the app straight away and can be bought.
  1. Publish: confirms.
If some lessons are still empty, publishing is refused with a message such as These lessons have no video, file or questions yet: Layout and grids. Add the content to those lessons (or remove them) and publish again.
Courses list with the course marked Published
Back in Catalogue > Courses the course now shows Published.
  1. The course, its status, category, price and lesson count.

Step 7: Show it on the app's Home screen

A published course appears at once in its category, in search and in Browse. The Home screen shows the rails (rows of courses) you set up in Platform > App home. A new academy has none, so add one: click New rail.

New rail dialog with a hand-picked course
A "Featured courses" rail with the new course in it.
  1. Title of the rail in your default language (other languages optional).
  2. What fills this rail: Hand-picked courses (you choose them and their order), Category (courses from the categories you pick, sorted automatically) or Automatic (for example trending, new, or personal picks for each learner).
  3. Courses, in order: for a hand-picked rail, choose a course and click Add. Repeat for more.
  4. Save. Optional: a start and end date, and who sees the rail (everyone, signed-in learners, guests or new learners).

On the same page you can add banners (the sliding pictures at the top of Home) and intro slides (what new learners swipe through the first time).

Step 8: Check it in the app

Open the app (or pull down on Home to refresh). The app picks up changes within about a minute. The course is on Home in your rail, in its category and in search, and its page shows the details, price and curriculum you entered:

App home screen with course rails
Home with rails
App course details page
The course page
App payment methods page
Buying it

These app screenshots come from the demo academy, so their courses differ from the example above.

If the course does not appear: check that it is Published, that its category has Show in the app ticked, that the app points at the right backend and academy (section 8), and that the course has at least one lesson.

16. Marketplace Mode

In Academy mode (the default) you are the only seller. In Marketplace mode, outside instructors and organizations can also apply, publish their own courses and earn a share of every sale, while you keep a commission. This section walks through the whole journey, end to end, in the order it happens.

1. Turn on→2. Set the rules→3. Instructor applies in the app→4. You approve→5. Seller builds a course→6. You approve the course→7. Sales and earnings→8. Payout request→9. You pay and record it
WhoWhere they workWhat they do
You (owner or admin)Admin panelTurn the mode on, set the commission, approve sellers and their courses, pay sellers
Instructor (a seller)Applies in the app, then works in the admin panel's StudioBuilds courses, sends them for review, answers questions, requests payouts
Organization admin (a seller)The same StudioLike an instructor, for an organization's page, plus adding the organization's instructors
Finance role (optional)Admin panelCan see earnings and pay sellers

Step 1: Turn on Marketplace mode

Open Settings > Business (or step 2 of the setup wizard) and click Switch to Marketplace. Only the owner can change the mode.

Switch to Marketplace confirmation with a reason field
The switch asks for a reason, which is kept in the activity log.
  1. Reason: a short note for your records.
  2. Switch to Marketplace: the app changes for every learner straight away: seller profiles and the "Become an instructor" entry can appear.

You can switch back to Academy mode later only while no other seller has a published course: unpublish or archive their courses first.

Step 2: Set the marketplace rules

After the switch, the same page shows Selling on your marketplace.

Marketplace settings: commission, payouts, instructor sign-up
Settings > Business in Marketplace mode.
  1. Marketplace · current: the mode is on.
  2. Your commission (%): your share of each sale made by another seller, for example 20. You can give a single seller a different rate later (step 4).
  3. Seller payouts: Manual or Automatic. Either way, Lumora does not send money: you pay sellers yourself (bank transfer or another method) and record each payment in the admin panel (step 9).
  4. Instructor sign-up: Off (no new instructors), By invite only (the app shows no application form), or Open (anyone can apply from the app).
  5. Show "Become an instructor" in the app: shows the application form in the app's Account menu. Announcements per course a day limits how often a seller may message a course's learners.
  6. Save changes.

The Refund window (Settings > General, setup step 3) also matters here: a seller's share of a sale becomes payable only after that many days, so a refund can still be taken back from it.

Step 3: An instructor applies from the app

With sign-up open, a learner opens Account > Become an instructor in the app and sends a short application: display name, headline, bio, areas of expertise and links (for example a portfolio). They can apply as themselves or for an organization they run. While it is waiting they cannot send another one.

Step 4: Approve the application

Open People > Applications. Waiting applications are listed first.

Seller applications with an application waiting for review
One application waiting.
  1. The applicant with their headline, email, expertise, bio and links.
  2. Approve: the person becomes a seller with a public instructor profile and gets the instructor role in the admin panel; they are told in the app. For an organization, approving creates the organization's page with the applicant as its admin. Not approved asks for a reason that the applicant sees; they may apply again later.
Sellers list with the new instructor
People > Sellers lists every seller with their status, commission and live courses.
  1. The new seller. From here you can set a different Commission for this seller (it applies to new orders), mark them Verified, or Suspend them (new sales stop and their profile is hidden; learners keep what they bought).

With sign-up set to By invite only or Off, the app does not offer the form. An approved organization admin can add the instructors who teach for the organization from their Studio.

Step 5: The seller builds a course in the Studio

The seller signs in to the same admin panel with the email and password of their app account. (Someone who signed up with Google only sets a password first with Forgot password in the app.) They see only the Studio: their own courses, bundles, reviews, questions and earnings.

Seller Studio, My courses, with one draft course
The seller's Studio.
  1. New course: creates a draft, exactly as in section 15, steps 2 to 5.
  2. Their courses with each one's status.

When the course is ready, the seller clicks Send for review instead of Publish. Sellers cannot publish on their own.

Seller course page with the Send for review button
A seller's course: Send for review replaces Publish.
  1. Send for review: the course moves to In review and appears for your team.

Step 6: Approve the course

Open Catalogue > Courses and filter by In review (the dashboard also counts courses awaiting review). Open the course and check it.

Course in review with Approve and publish and Request changes
A seller's course waiting for review.
  1. Approve & publish: the course goes live in the app and can be bought.
  2. Request changes: sends it back with a note the seller sees in the Studio; they fix it and send it again.

Step 7: Sales and earnings

Learners buy a seller's course like any other. For every sale, the order item records the commission rate, your platform fee and the seller's share. Refunds are taken back from the seller's share. The seller follows their money under Earnings in the Studio:

Seller earnings with payable balance and Request payout button
The seller's Earnings page after one sale of a USD 15 course at 20% commission (the refund window was set to 0 days for this example).
  1. Payable now: earnings whose refund window has passed. Also shown: In refund window (not payable yet), Requested and Paid to you.
  2. Request payout: appears when something is payable.

Step 8: The seller requests a payout

Request a payout dialog with amount and note
The payout request.
  1. Amount: up to the payable balance. The amount is held until you pay or decline it.
  2. Note: where to send the money (for example a bank account) or anything your team should know.
  3. Send request.

Step 9: Pay the seller and record it

Open Sales > Payouts. Balances shows what each seller has earned, been paid and can be paid; History lists the requests.

Payouts history with a requested payout
A payout request waiting in Payouts > History.
  1. Requested: the total waiting to be paid.
  2. The request, with the seller's note.
  3. Mark paid: first send the money yourself, outside Lumora, then record it here. Not approved declines the request and returns the amount to the seller's payable balance.
Mark request paid dialog with a transaction reference
Recording the payment.
  1. Transaction reference (optional): the bank or wallet transaction ID, so you can match it later. The note goes into the activity log.
  2. Record payout: the payout is marked paid and the seller is notified.

You can also record a payment to a seller without a request, from the Balances tab. A payout can never be more than the seller's payable balance.

17. API Reference

The backend in Backend/ serves one JSON API. The Flutter app and the admin panel both use it. This section covers the conventions and the most important calls. Every path below is relative to the base URL, with no extra prefix.

Conventions

The response envelope

Every successful response is wrapped like this. body holds the actual result.

{
  "success": true,
  "message": "OK",
  "body": { ... }
}

In the examples below, a line starting with → shows only the body part. Errors use the same outer shape with "success": false (see Errors). Two kinds of route skip the envelope: the payment webhooks (/webhooks/...), which answer the provider with a small plain object, and the CSV exports, which stream a file.

Pagination

Lists take ?page=1&limit=20. page starts at 1 (maximum 1000); limit is 1 to 50, default 20. A paged list returns:

{ "success": true, "message": "OK",
  "body": { "items": [ ... ], "page": 1, "limit": 20, "total": 57 } }

A few short lists (GET /instructors, GET /organizations) return a plain array when you leave out page, and the paged shape above when you send it. GET /me/learning works the same way and always adds a summary. Large admin lists may add "totalCapped": true when there are more than 10,000 rows.

Errors

Every error has a human message and a machine-readable body.code. Validation errors also carry body.fieldErrors, one message per field.

// 422: POST /auth/register with a bad email and a short password
{ "success": false,
  "message": "Validation failed",
  "body": {
    "code": "VALIDATION_ERROR",
    "fieldErrors": {
      "email": "Must be an email",
      "password": "Must be longer than or equal to 8 characters"
    } } }

// 409: the email already has an account
{ "success": false, "message": "An account with this email already exists",
  "body": { "code": "EMAIL_TAKEN" } }

// 403: a lesson behind an unfinished required lesson
{ "success": false, "message": "Finish “Welcome” to unlock this lesson",
  "body": { "code": "LESSON_LOCKED", "blockingLessonId": "uuid", "blockingLessonTitle": "Welcome" } }

Nested fields use a dot path ("sections.0.title"). Common codes: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, INVALID_CREDENTIALS, INVALID_REFRESH_TOKEN, ACCOUNT_SUSPENDED, CODE_INVALID, CODE_EXPIRED, NOT_ENROLLED, ACCESS_EXPIRED, COUPON_INVALID, COUPON_EXPIRED, GATEWAY_UNAVAILABLE, ORDER_NOT_PAYABLE, AMOUNT_MISMATCH, FEATURE_DISABLED, MAINTENANCE, UPDATE_REQUIRED. The full list is in Backend/src/common/errors/error-codes.ts. Unexpected errors answer 500 INTERNAL_ERROR; the details go only to the server log.

CodeMeaning
200 / 201Success. 201 when a POST creates something (account, order, course)
400Bad request: malformed ID, missing X-Tenant, wrong or expired emailed code
401Missing, invalid or expired token; wrong email or password; suspended account
403Not allowed: no console permission, not enrolled, feature switched off, lesson locked
404Not found, or the academy slug is unknown
409Conflict with the current state: email taken, order already paid, exam closed, item in use
422Validation failed (fieldErrors), or a business rule such as an invalid coupon
426The app version is below the minimum (minSupported, updateUrl in body)
429Too many requests
500Unexpected server error
501A service is not set up: email delivery, S3 storage, Google/Apple sign-in, video streaming
502A payment or video provider refused the call or could not be reached
503Maintenance mode is on (MAINTENANCE), or the health check cannot reach the database

Authentication

Accounts belong to one academy. A sign-in returns a session. The access token is a short-lived JWT (ACCESS_TOKEN_TTL_SECONDS, default 900). The refresh token is opaque and changes on every refresh, so always keep only the newest one.

POST /auth/register                         201
X-Tenant: acme
{ "email": "learner@example.com", "password": "a-strong-password", "fullName": "Jane Learner" }

POST /auth/login                            200
{ "email": "learner@example.com", "password": "a-strong-password" }

// both answer with a session ("message" is "Account created" for register)
{ "success": true, "message": "OK",
  "body": {
    "accessToken": "eyJhbGciOiJIUzI1NiIs...",
    "refreshToken": "q8Yt3...",
    "expiresIn": 900,
    "user": { "id": "uuid", "tenantId": "uuid", "email": "learner@example.com",
              "fullName": "Jane Learner", "roles": [], "access": {} } } }

password is 8 to 128 characters and fullName 1 to 120. A wrong email or password answers 401 INVALID_CREDENTIALS (the same answer for unknown emails). For staff, roles lists their roles (for example ["owner"]) and access maps each admin module to view or edit.

POST /auth/google                           200
{ "idToken": "<ID token from the Google Sign-In SDK>", "fullName": "Jane Learner" }
// also POST /auth/apple with the same body; both answer with a session

POST /auth/refresh                          200
{ "refreshToken": "q8Yt3..." }              // answers with a new session

POST /auth/logout                           200
{ "refreshToken": "q8Yt3..." }
→ { "success": true, "message": "Signed out", "body": { "signedOut": true } }

Google and Apple ID tokens are checked against GOOGLE_CLIENT_IDS / APPLE_CLIENT_IDS. If the provider is not set up, the answer is 501 PROVIDER_NOT_CONFIGURED. Send one refresh at a time: reusing a refresh token that was already exchanged ends that sign-in (401 INVALID_REFRESH_TOKEN).

Password reset with an emailed code takes three calls:

// 1. email a 6-digit code (same answer for unknown emails)
POST /auth/password/forgot      { "email": "learner@example.com" }
→ { "sent": true, "expiresInSec": 600, "resendInSec": 60 }

// 2. exchange the code for a reset token
POST /auth/password/verify-code { "email": "learner@example.com", "code": "482915" }
→ { "resetToken": "9f2c...", "expiresInSec": 900 }

// 3. set the new password (signs out every session)
POST /auth/password/reset       { "token": "9f2c...", "password": "a-new-password" }
→ { "reset": true }

A wrong code answers 400 CODE_INVALID (5 tries per code); an expired code answers 400 CODE_EXPIRED. Without email delivery (SMTP in the admin panel or SMTP_* in .env) step 1 answers 501 EMAIL_NOT_CONFIGURED.

Example: app config and the Home screen

GET /app/config (no token) returns everything the app needs at start: business mode, branding, languages, currency, feature switches, contact details, minimum app version, maintenance state and paymentGateways (the gateways checkout can use right now).

GET /home?lang=en                          (no token)

{ "success": true, "message": "OK",
  "body": {
    "banners": [ { "id": "uuid", "title": "New courses", "subtitle": "Start today",
                   "imageUrl": "https://cdn.your-domain.com/...jpg",
                   "link": { "type": "course", "target": "uuid" } } ],
    "sections": [ { "id": "uuid", "kind": "featured", "source": "manual", "autoKind": null,
                    "title": "Featured", "subtitle": null, "audience": "all", "personal": false,
                    "seeAll": { "type": "section", "target": "uuid" },
                    "itemType": "course", "items": [ { ...course card... } ] } ],
    "categories": [ { ...category tree... } ] } }

A section with "personal": true (for example "For you") arrives with empty items; the app fills it from GET /me/recommendations/sections/:id. Banner link types: none, course, category, url.

Example: courses

GET /courses?q=design&category=design&level=beginner&price=paid&sort=popular&page=1&limit=20

{ "success": true, "message": "OK",
  "body": { "page": 1, "limit": 20, "total": 1, "items": [
    { "id": "uuid", "slug": "ui-design-basics", "title": "UI Design Basics",
      "subtitle": "From wireframe to prototype", "thumbnailUrl": "https://...",
      "level": "beginner", "category": { "id": "uuid", "slug": "design", "name": "Design" },
      "currency": "USD", "priceMinor": 1999, "originalPriceMinor": 2999, "discountPercent": 33,
      "sale": null, "isFree": false, "rating": 4.7, "ratingCount": 120, "enrollmentCount": 1840,
      "lessonCount": 42, "durationSec": 21600, "isBestseller": true, "isNew": false,
      "instructors": [ { "id": "uuid", "name": "Alex Doe", "avatarUrl": null } ],
      "organization": null, "accessDays": null, ... } ] } }

Other filters: minRating, topic, instructor, organization. Sort values: popular, rating, newest, price_asc, price_desc.

GET /courses/ui-design-basics              (ID or slug, no token)

// a course card plus:
{ "description": "...", "language": "en", "outcomes": ["..."], "requirements": ["..."],
  "certificateEnabled": true, "instructorDetails": [ ... ], "topics": [ ... ],
  "ratingDistribution": { "1": 2, "2": 1, "3": 6, "4": 31, "5": 80 },
  "includes": { "videoSec": 20400, "lessonCount": 42, "documentCount": 3, "quizCount": 4, "certificate": true },
  "curriculum": [ { "id": "uuid", "title": "Getting started", "lessonCount": 5, "durationSec": 1800,
      "lessons": [ { "id": "uuid", "title": "Welcome", "type": "video", "durationSec": 240,
                     "isPreview": true, "documentDisplay": "document",
                     "previewVideoUrl": "https://..." } ] } ] }

previewVideoUrl is set only on free-preview lessons. Paid lesson content comes from the player endpoints after enrollment (GET /me/courses/:courseId/lessons/:lessonId).

Example: checkout with a payment gateway

Stripe, Flutterwave and Razorpay use a hosted payment page that the app opens in a web view. Card data never reaches your server.

POST /checkout/orders                      (token)            201
{ "courseIds": ["uuid"], "couponCode": "SAVE10", "gateway": "stripe",
  "idempotencyKey": "6f1d9c2e-checkout-attempt" }

{ "success": true, "message": "Order created",
  "body": {
    "order": { "id": "uuid", "orderNo": "LM260115-000123", "status": "pending", "currency": "USD",
               "subtotalMinor": 1999, "discountMinor": 200, "taxMinor": 0, "totalMinor": 1799,
               "couponCode": "SAVE10", "gateway": "stripe", "createdAt": "...", "paidAt": null,
               "items": [ { "courseId": "uuid", "title": "UI Design Basics", "unitPriceMinor": 1999,
                            "discountMinor": 200, "finalPriceMinor": 1799, ... } ] },
    "replayed": false,
    "payment": { "action": "redirect", "endpoint": "/checkout/orders/uuid/pay" } } }

POST /checkout/orders/{id}/pay             (token)            200
→ { "url": "https://checkout.stripe.com/...", "returnUrl": "https://..." }

POST /checkout/orders/{id}/verify          (token)            200
→ the order, with "status": "paid" once the provider confirms

Example: Google Play purchases (RevenueCat)

The API also accepts "store": "app_store", but the iOS app does not call it: App Store purchases are turned off in this version (section 11).

Inside the mobile app a course can be paid with a store product. The store charges its own local price; the server never trusts the app and reads every purchase back from RevenueCat.

// 1. which methods this course accepts on this device
GET /checkout/courses/{courseId}/gateways?platform=android     (token)
→ { "courseId": "uuid", "isFree": false, "gateways": [
     { "provider": "stripe", "kind": "hosted", "displayName": "Stripe", "logoUrl": null,
       "platforms": ["android", "ios", "web"], "store": null },
     { "provider": "google_play", "kind": "store", "displayName": "Google Play", "logoUrl": null,
       "platforms": ["android"],
       "store": { "productId": "course_tier_999", "referencePriceMinor": 999,
                  "currency": "USD", "sdkKey": "goog_xxxxxxxx" } } ] }

// 2. create the store order                                    201
POST /checkout/store/orders
{ "courseId": "uuid", "store": "google_play", "idempotencyKey": "b7e0a4c1-store-attempt" }
→ { "order": { ...status "pending", gateway "google_play"... }, "replayed": false,
    "purchase": { "store": "google_play", "productId": "course_tier_999",
                  "appUserId": "uuid", "sdkKey": "goog_xxxxxxxx" } }

// 3. the app logs in to RevenueCat with appUserId and buys productId

// 4. settle the order                                          200
POST /checkout/orders/{id}/store-verify
{ "transactionId": "GPA.0000-0000-0000-00000" }      // optional
→ the order; still "pending" means ask again in a few seconds

store is google_play or app_store. Coupons and sale prices do not apply to store orders. The RevenueCat webhook settles the order if the app closes before step 4. Other order calls: GET /me/orders, GET /me/orders/:id, POST /me/orders/:id/cancel.

Example: create a course (admin)

POST /console/courses                      (staff token, Courses: edit)     201
X-Tenant: acme
{ "title": "UI Design Basics", "progression": "sequential", "preventSkipping": false }

→ { "id": "uuid", "title": "UI Design Basics", "slug": "ui-design-basics", "status": "draft",
    "currency": "USD", "priceMinor": 0, "isFree": false, "progression": "sequential",
    "sections": [], ... }

Only title (3 to 160 characters) is required. A new course starts as a draft. Set the details and price with PATCH /console/courses/:id (for example { "priceMinor": 1999, "categoryId": "uuid", "level": "beginner" }), add the curriculum with POST /console/courses/:id/sections and POST /console/sections/:id/lessons, then publish with POST /console/courses/:id/status { "to": "published" }. Publishing a course with unfinished lessons answers 409 NOT_READY.

File uploads

Files go straight from the admin panel or app to your S3-compatible bucket with a presigned URL. The API never receives the file itself.

  1. Ask for an upload URL: POST /console/uploads with { "kind": "video", "contentType": "video/mp4", "sizeBytes": 73400320 } (kind is video or document). For images use POST /console/uploads/image with a purpose (course, banner, branding, instructor, onboarding, organization).
  2. The answer is { "mediaFileId": "uuid", "uploadUrl": "https://...", "method": "PUT", "headers": { ... }, "expiresAt": "..." }. PUT the file to uploadUrl with exactly those headers.
  3. Confirm: POST /console/uploads/:mediaFileId/complete → { "mediaFileId": "uuid", "status": "ready" } (images also return the public url). The server checks the size and type first: 409 UPLOAD_INCOMPLETE if the file is not there yet, 422 UPLOAD_MISMATCH if it differs.
  4. Attach the mediaFileId to a lesson. Only completed uploads can be attached.

Large files use the multipart routes under /console/uploads/multipart. The app uploads profile photos the same way with POST /me/avatar/upload and then PATCH /me { "avatarKey": "..." }. Without S3 settings these calls answer 501 STORAGE_NOT_CONFIGURED. Your bucket's CORS must allow PUT from the admin panel origin and expose the ETag header.

Webhooks

Payment providers call one route per provider and academy. No token and no X-Tenant header are needed: the provider's signature is the authentication, and the academy slug is in the path.

POST /webhooks/stripe/acme
POST /webhooks/flutterwave/acme
POST /webhooks/razorpay/acme
POST /webhooks/revenuecat/acme      // Google Play purchases

// answers (no envelope)
200 { "received": true }            // also for a repeated event: { "received": true, "duplicate": true }
400 { "error": "..." }              // bad or missing signature, nothing stored
404 { "error": "..." }              // unknown provider or academy

The admin panel shows the exact webhookUrl for each gateway under Settings → Payments. Stripe signs with Stripe-Signature, Flutterwave sends verif-hash, Razorpay sends X-Razorpay-Signature, and RevenueCat sends your webhookAuth value in the Authorization header. Each event is stored once and the payment is fetched again from the provider before an order is settled. POST /webhooks/bunny/acme receives Bunny Stream encoding events when adaptive video is used.

Scheduled jobs (cron)

GET /internal/cron/minute
Authorization: Bearer <CRON_SECRET>

Call this once a minute (Vercel Cron, or a system cron with curl). It closes finished exams, queues and sends push notifications, fans out campaigns and announcements, checks payments with missed webhooks, cancels unpaid orders after PENDING_ORDER_TTL_MINUTES, cleans up abandoned uploads and runs periodic cleanup. Without CRON_SECRET set, every call is refused. Like other routes it needs an academy: send X-Tenant, or set DEFAULT_TENANT_SLUG. The single steps are also available under /internal/... with the same header.

Keep CRON_SECRET, JWT_SECRET and SETTINGS_ENCRYPTION_KEY private. Never ship them inside the Flutter app or the admin panel build.

Endpoint groups

Access: public (no token), token (any signed-in user), enrolled (active enrollment in the course), staff (a console role with the module's permission: view for GET, edit for other methods), owner/admin, seller (instructor or organization admin, Marketplace mode), cron (Bearer CRON_SECRET), signature (provider-signed webhook).

The table lists the main routes of each group. Every route is defined in a *.controller.ts file under Backend/src/modules/ (auth is in Backend/src/auth/).

GroupMethod and pathAccess
HealthGET /healthpublic, no tenant; 503 when the database is down
AuthPOST /auth/register
POST /auth/login
POST /auth/google
POST /auth/apple
POST /auth/refresh
POST /auth/logout
POST /auth/password/forgot
POST /auth/password/verify-code
POST /auth/password/reset
public
App configGET /app/config
GET /app/onboarding
GET /app/faq
GET /app/legal/:kind
public
CatalogueGET /home
GET /home/sections/:id/courses
GET /categories
GET /courses
GET /courses/:idOrSlug
GET /courses/:idOrSlug/reviews
GET /courses/:idOrSlug/similar
GET /instructors
GET /instructors/:id
GET /organizations
GET /organizations/:slug
GET /bundles
GET /bundles/:idOrSlug
GET /search/trending
POST /search/queries
GET /recommendations/guest
public
ProfileGET /me
PATCH /me
DELETE /me
POST /me/password
POST /me/email/code
POST /me/email/verify
POST /me/avatar/upload
GET /me/instructor-application
POST /me/instructor-application
token
PersonalizationGET /me/preferences
PUT /me/preferences
GET /me/recommendations
GET /me/recommendations/sections/:id
POST /me/recommendations/dismiss
DELETE /me/recommendations/dismiss/:courseId
POST /me/recommendations/reset
token
My learningGET /me/learning
GET /me/courses/:courseId/access
POST /me/enrollments
token
PlayerGET /me/courses/:courseId/player
GET /me/courses/:courseId/lessons/:lessonId
PUT /me/courses/:courseId/lessons/:lessonId/progress
GET /me/courses/:courseId/resources
GET /me/courses/:courseId/announcements
GET /me/courses/:courseId/notes
POST /me/courses/:courseId/notes
PATCH /me/notes/:noteId
DELETE /me/notes/:noteId
POST /me/courses/:courseId/review
enrolled
Q&AGET /me/courses/:courseId/questions
POST /me/courses/:courseId/questions
GET /me/questions/:threadId
POST /me/questions/:threadId/replies
PUT /me/questions/:threadId/vote
DELETE /me/questions/:threadId/vote
enrolled
QuizzesGET /me/courses/:courseId/quizzes/:quizId
GET /me/courses/:courseId/quizzes/:quizId/attempts
POST /me/courses/:courseId/quizzes/:quizId/attempts
enrolled
Live examsGET /me/exams
GET /me/exams/:examId
PUT /me/exams/:examId/reminder
DELETE /me/exams/:examId/reminder
POST /me/exams/:examId/attempt
GET /me/exams/:examId/attempt
PUT /me/exams/:examId/attempt/answers/:questionId
POST /me/exams/:examId/attempt/submit
POST /me/exams/:examId/attempt/events
GET /me/exams/:examId/leaderboard
GET /me/exams/:examId/review
token / enrolled
Live classesGET /me/live-sessions
GET /me/courses/:courseId/live-sessions
POST /me/live-sessions/:id/join
token / enrolled
Wishlist and cartGET /me/wishlist
PUT /me/wishlist/:courseId
DELETE /me/wishlist/:courseId
GET /me/cart
PUT /me/cart/:courseId
DELETE /me/cart/:courseId
PUT /me/cart/bundles/:bundleId
DELETE /me/cart/bundles/:bundleId
DELETE /me/cart
token
CheckoutGET /checkout/coupons
POST /checkout/quote
POST /checkout/orders
POST /checkout/orders/:id/pay
POST /checkout/orders/:id/verify
GET /checkout/gateways
GET /checkout/courses/:courseId/gateways
POST /checkout/store/orders
POST /checkout/orders/:id/store-verify
token
OrdersGET /me/orders
GET /me/orders/:id
POST /me/orders/:id/cancel
token
Notifications and devicesGET /me/notifications
GET /me/notifications/unread-count
POST /me/notifications/:id/read
POST /me/notifications/read-all
POST /me/devices
POST /me/devices/unregister
token
CertificatesGET /me/certificates
GET /me/certificates/:id
PATCH /me/certificates/:id/name
GET /certificates/verify/:code
GET /certificates/:id/pdf
token for /me; the rest public, no tenant
Console: dashboardGET /console/dashboard
GET /console/analytics/home
GET /console/analytics/campaigns
staff
Console: coursesGET /console/courses
POST /console/courses
GET /console/courses/:id
PATCH /console/courses/:id
POST /console/courses/:id/status
POST /console/courses/:id/sections
PUT /console/courses/:id/order
PATCH /console/sections/:id
DELETE /console/sections/:id
POST /console/sections/:id/lessons
PATCH /console/lessons/:id
DELETE /console/lessons/:id
GET /console/quizzes/:id
PUT /console/quizzes/:id
GET /console/courses/:id/resources
POST /console/courses/:id/resources
staff (Courses) or seller for own courses
Console: uploadsPOST /console/uploads
POST /console/uploads/image
POST /console/uploads/:id/complete
POST /console/uploads/multipart
POST /console/uploads/multipart/:id/parts
POST /console/uploads/multipart/:id/complete
DELETE /console/uploads/multipart/:id
staff or seller
Console: categories and bundlesGET /console/categories
POST /console/categories
PATCH /console/categories/:id
DELETE /console/categories/:id
GET /console/bundles
POST /console/bundles
PATCH /console/bundles/:id
PUT /console/bundles/:id/courses
DELETE /console/bundles/:id
staff
Console: examsGET /console/exams
POST /console/exams
GET /console/exams/:id
PATCH /console/exams/:id
PUT /console/exams/:id/paper
POST /console/exams/:id/status
GET /console/exams/:id/monitor
staff
Console: live classesGET /console/courses/:courseId/live-sessions
POST /console/courses/:courseId/live-sessions
PATCH /console/live-sessions/:id
POST /console/live-sessions/:id/cancel
GET /console/live-sessions/:id/attendance
staff
Console: learnersGET /console/learners
GET /console/learners/:id
POST /console/learners/:id/enrollments
POST /console/enrollments/:id/revoke
POST /console/learners/:id/status
POST /console/learners/:id/password-reset
DELETE /console/learners/:id
staff
Console: salesGET /console/orders
GET /console/orders/:id
POST /console/orders/:id/refunds
GET /console/coupons
POST /console/coupons
PATCH /console/coupons/:id
DELETE /console/coupons/:id
GET /console/reports/revenue
GET /console/sale-campaigns
POST /console/sale-campaigns
staff
Console: store productsGET /console/store-products
POST /console/store-products
PATCH /console/store-products/:id
GET /console/courses/:id/payment-methods
PUT /console/courses/:id/payment-methods
staff
Console: certificatesGET /console/certificates
POST /console/certificates/issue
POST /console/certificates/:id/revoke
POST /console/certificates/:id/restore
staff
Console: engagementGET /console/campaigns
POST /console/campaigns
GET /console/reviews
POST /console/reviews/:id/moderate
GET /console/questions
POST /console/questions/:id/replies
staff
Console: home content and FAQGET /console/home-content
POST /console/home-content/banners
POST /console/home-content/sections
PUT /console/home-content/order
GET /console/faq
POST /console/faq
staff
Console: settingsGET /console/settings
PATCH /console/settings
PUT /console/settings/app
PUT /console/settings/features
PUT /console/settings/email
PUT /console/settings/gateways/:provider
POST /console/settings/gateways/:provider/test
POST /console/settings/business-mode
staff (Settings); owner only for gateways and business mode
Console: teamGET /console/team
POST /console/team
PUT /console/team/:id/roles
POST /console/team/:id/suspend
GET /console/custom-roles
POST /console/custom-roles
GET /console/activity
owner/admin; suspend: owner; activity: staff
Console: sellers and payoutsGET /console/sellers
PATCH /console/sellers/:id
GET /console/instructor-applications
POST /console/instructor-applications/:id/approve
GET /console/payouts/balances
POST /console/payouts
staff (Sellers, Payouts)
Console: Seller StudioGET /console/studio
GET /console/studio/courses
POST /console/studio/courses
POST /console/studio/payouts
POST /console/studio/announcements
seller
Console: CSV exportsGET /console/exports/orders.csv
GET /console/exports/revenue.csv
GET /console/exports/learners.csv
staff (Reports); learners: owner/admin
WebhooksPOST /webhooks/:provider/:tenantSlugsignature
CronGET /internal/cron/minutecron

18. Database Schema

PostgreSQL 15 or newer. The backend uses plain parameterised SQL through pg, with no ORM. Business steps that touch money, progress or exams are SQL functions inside the database, so each one runs in a single transaction.

Where the schema lives

Conventions

How the data fits together (overview diagram)

A simplified entity-relationship view: the six main areas, their most important tables, and the columns that join one area to another. Read it before you customise anything. The full list of 92 tables follows under Tables by area.

tenants One row per academy. Every table below has a tenant_id column pointing here, and every query filters by it. Accounts and access 18 tables users user_roles refresh_tokens auth_identities device_tokens custom_roles Sellers and payouts (marketplace) 6 tables sellers payouts instructor_profiles organizations instructor_applications organization_members Catalogue 15 tables categories courses bundles course_sections home_sections lessons Commerce 18 tables orders order_items payments enrollments refunds coupons Quizzes and live exams 14 tables quizzes quiz_attempts questions exams question_options exam_attempts Learning and engagement 21 tables lesson_progress certificates course_reviews qa_threads notifications live_sessions orders.user_id courses.seller_id order_items.course_id order_items.seller_id lessons.quiz_id certificates.enrollment_id lesson_progress.lesson_id Arrows point from the parent to the child (one course has many sections, one order many items). The label names the column on the child that holds the link. Every course belongs to a seller; in Academy mode that is your academy's own seller, created at setup. users also links to enrollments, lesson_progress, attempts and certificates.

Tables by area

The migrations create 92 tables, plus schema_migrations created by the migration runner.

AreaTables
Platform and accounts (18)tenants, platform_settings, legal_pages, faq_items, onboarding_slides, users, user_roles, custom_roles, auth_identities, auth_codes, refresh_tokens, password_resets, device_tokens, media_files, video_events, activity_log, rate_limits, job_runs
Sellers and instructors (6)instructor_profiles, instructor_applications, sellers, organizations, organization_members, payouts
Catalogue (15)categories, courses, course_instructors, course_sections, lessons, lesson_resources, course_resources, topics, course_topics, home_banners, home_sections, home_section_items, bundles, bundle_courses, search_queries
Assessment (14)question_banks, questions, question_options, quizzes, quiz_questions, quiz_attempts, quiz_attempt_answers, exams, exam_questions, exam_attempts, exam_attempt_answers, exam_attempt_events, exam_reminders, exam_notifications_sent
Commerce (16)wishlist_items, cart_items, cart_bundles, coupons, coupon_courses, coupon_redemptions, orders, order_items, payments, payment_events, refunds, enrollments, payment_gateways, course_payment_exclusions, sale_campaigns, course_price_history
Store billing (2)store_products, course_store_products
Learning and engagement (14)lesson_progress, course_progress_refresh, lesson_notes, qa_threads, qa_replies, qa_votes, announcements, certificates, course_reviews, notifications, push_campaigns, live_sessions, live_attendance, live_notifications_sent
Personalization (7)learner_preferences, course_views, recommendation_dismissals, recommendation_runs, course_stats, course_similar, rail_stats_daily

Key tables

TableImportant columns
userstenant_id, email, phone, full_name, avatar_url, password_hash (scrypt, null for Google/Apple-only accounts), email_verified_at, locale, theme, auth_provider, status, last_active_at, deleted_at. Console roles are rows in user_roles
coursestenant_id, seller_id, category_id, slug (unique per academy), title, subtitle, description, level, language, currency, price_minor, compare_at_price_minor, sale_price_minor, sale_starts_at, sale_ends_at, is_free, status, published_at, access_days (null = lifetime), progression, prevent_skipping, certificate_enabled, counters, deleted_at
lessonscourse_id, section_id, type, title, sort, is_preview, duration_sec, video_source, video_url, media_file_id, quiz_id, article_body, document_display, is_required, completion_pct, allow_device_download, deleted_at
orderstenant_id, user_id, order_no (for example LM260115-000123), status, currency, subtotal_minor, discount_minor, tax_minor, total_minor, coupon_id, gateway, idempotency_key (unique per academy), store_product_id (store orders only), paid_at
order_itemsorder_id, course_id, seller_id, course_title, unit_price_minor, discount_minor, final_price_minor, tax_minor, commission_pct, platform_fee_minor, seller_share_minor, bundle_id, refunded_at. A CHECK makes the fee and seller share add up to the final price
paymentsOne row per payment page or store purchase: order_id, gateway, gateway_ref (checkout session or link id), gateway_txn_id, amount_minor, currency, status, raw_response (jsonb), attention (a note staff must act on)
enrollmentstenant_id, user_id, course_id (unique pair), source, order_item_id, status, progress_pct, last_lesson_id, last_accessed_at, enrolled_at, completed_at, expires_at
certificatesuser_id, course_id, enrollment_id, credential_id, code (12-character public verification code), learner_name, source, issued_at, revoked_at, pdf_path, image_path
store_productstenant_id, store, product_id (exactly as created in Play Console or App Store Connect), name, reference_price_minor, currency, status. course_store_products links a course to one product per store
payment_gatewaystenant_id, provider, kind (hosted or store, derived), environment, enabled, platforms, display_name, config_encrypted (keys sealed with SETTINGS_ENCRYPTION_KEY)

Allowed values

ColumnValues
Order statuspending, paid, failed, cancelled, refunded, partially_refunded
Payment statusinitiated, success, failed, cancelled, unapplied (money that arrived for an order that could not take it), refunded
Refund status / methodrequested, processed, failed / gateway, manual
Gateway providerstripe, flutterwave, razorpay, google_play, app_store (google_play only on android, app_store only on ios)
Enrollment status / sourceactive, revoked, refunded, expired / purchase, free, admin_grant
Course statusdraft, in_review, changes_requested, published, unpublished, archived
Course level / progressionbeginner, intermediate, advanced, all / free, sequential
Lesson typevideo, document, quiz, article
Video sourceupload, stream, youtube, vimeo, url
Console roleowner, admin, content_manager, support, finance, instructor, org_admin, operator, custom (a custom role points at custom_roles)
User status / auth provideractive, suspended, deleted / email, phone, google, apple
Business modeacademy, marketplace
Store product statusactive, archived

SQL functions for money and progress

These functions are the only way the backend changes orders, payments and progress. Their EXECUTE permission is revoked from PUBLIC, so only the database owner (the API's user) can call them.

FunctionWhat it does
create_orderPrices the basket, re-checks coupon limits under a row lock, reserves the coupon use and inserts the order and its items. Returns the existing pending order for the same basket and coupon instead of a second one
find_pending_orderFinds the learner's pending order with exactly the same courses, bundles and coupon (never a store order)
confirm_order_paymentMarks the order paid (once), creates the enrollments with their expiry, clears the cart and posts a purchase notification
settle_gateway_paymentApplies a provider-confirmed payment, keyed on the provider transaction id. It checks the amount and currency, then calls confirm_order_payment, or records the money as unapplied for a refund
finalize_refundsCompletes processed refunds: marks items refunded, removes course access, revokes the certificate, updates the order status and gives the coupon use back on a full refund
release_orderCancels an unpaid order and gives its coupon use back
course_priceThe one pricing function: list price, course sale and sale campaigns
record_lesson_progress, record_player_progress, refresh_enrollment_progressSave the player heartbeat, unlock the next lessons, update the course percentage and issue the certificate on completion (issue_certificate)
start_quiz_attempt, submit_quiz_attemptQuiz rules (attempt limit, cool-down, time limit) under a per-learner lock
start_exam_attempt, save_exam_answer, close_exam_attempt, finalize_exam, sweep_examsThe live exam engine: server-side deadline, grading in SQL, final ranks
Rules enforced by the database: one successful payment per order, idempotent orders and webhooks, refunds never above the amount paid, one live refund per item, one live exam attempt per learner, exam papers frozen once an exam starts, and an append-only activity log.

Backups

# back up (custom format, compressed)
pg_dump -Fc "$DATABASE_URL" -f lumora-$(date +%F).dump

# restore into an empty database
pg_restore --no-owner --clean --if-exists -d "$DATABASE_URL" lumora-2026-01-15.dump

The dump includes schema_migrations, so after a restore npm run db:migrate applies only newer files. Schedule a daily backup (for example with cron) and keep copies off the server. Uploaded media lives in your S3 bucket, so back up the bucket separately.

Use the same SETTINGS_ENCRYPTION_KEY after a restore. Payment gateway keys and the SMTP password are stored encrypted with it. With a different key they cannot be read, and you must enter them again in the admin panel.

19. FAQ and Common Build Errors

Before anything else

Flutter app

Error or problemFix
"Unsupported class file major version" / Gradle fails to startYour JDK is too new. Use JDK 17 or 21: flutter config --jdk-dir "<Android Studio>/jbr"
"Your project's Gradle / Android Gradle Plugin / Kotlin version is lower than Flutter's minimum"Use Flutter 3.47.x as tested. On a newer Flutter, raise the versions in android/settings.gradle.kts and android/gradle/wrapper/gradle-wrapper.properties to the values in the message
"No matching client found for package name"google-services.json does not match applicationId. Download it again for your package name (section 4)
Gradle warns "android/key.properties not found" during a release buildThe build is signed with the public debug key. Create your upload key and android/key.properties before publishing (section 12)
Google sign-in fails on Android (error 10 / DEVELOPER_ERROR)Add the SHA-1 and SHA-256 of the key you are running with (debug, upload or Play App Signing) in Firebase, then download google-services.json again
Google sign-in works on the phone, but the app then shows an errorThe backend refused the token: its GOOGLE_CLIENT_IDS must contain the app's GOOGLE_WEB_CLIENT_ID
Google sign-in crashes on iOSAdd the REVERSED_CLIENT_ID URL scheme (section 5)
Nothing loads; every screen shows an errorCheck API_BASE_URL and TENANT in config/app_config.json, and that you passed --dart-define-from-file. On an Android emulator use http://10.0.2.2:3000, not localhost
It works in debug but not in the release buildRelease builds only allow https. Put the backend behind HTTPS (section 13, step 9)
A payment method does not appear on the Payment pageIt is switched off in Settings > Payments, its keys are missing, or a course in the cart excludes it (course Pricing step). Google Play appears only on Android and only for a single course
Google Play shows "item not available" or no priceInstall the app from a Play testing track with a licence tester account, check that the product ID in Store products matches Play Console exactly and that the product is active, and that the RevenueCat SDK key is the Android one (goog_…)
Paid with Google Play, but the course stays lockedCheck the RevenueCat secret key and webhook (section 11). The order in the admin panel shows what the backend received
CocoaPods errors (pod install fails)cd ios && pod repo update && pod install. If it still fails, delete ios/Pods and ios/Podfile.lock and run pod install again
iOS "No signing certificate" / "requires a development team"Select your Team in Xcode (Runner > Signing & Capabilities)
Push notifications do not arriveCheck FCM_SERVICE_ACCOUNT_JSON on the backend (same Firebase project as the app) and that the minute cron runs. On iOS, add the push capability and an APNs key, and test on a real device
Changed the colours or logo, but the app still shows the old onesThe app caches its settings. Close it fully and open it again

Backend and admin panel

See the troubleshooting tables in section 13 and section 14.

General questions

QuestionAnswer
Are courses included?No. The optional demo data has sample courses for testing only. You publish your own courses.
Can I sell on iOS?Not in this version. The iOS app offers free courses only: App Store purchases and web checkout are turned off on iOS (section 11). Paid courses are sold in the Android app and on the web.
Can I add another payment gateway?Yes, as custom development. The existing gateways in Backend/src/modules/commerce/ show the pattern: open a payment, then confirm it with the provider before calling the database's payment functions.
Academy or marketplace?Academy mode is one school with its own instructors. Marketplace mode lets instructors and organizations apply, publish their own courses and request payouts. Switch in Settings > Business.
Can I run several academies on one backend?Each academy is a tenant with its own slug, settings and data. One installation normally serves one academy; the app is built for one TENANT.
Do I need S3 storage?Yes for uploads from the admin panel. You can also paste https links to files hosted elsewhere.
Can the backend and admin panel run on one server?Yes. Use two nginx sites, for example api. and admin. subdomains.
Are any files minified or obfuscated?No. All three projects ship as readable source code. Third-party libraries are installed from pubspec.yaml and package.json. (The --obfuscate flag only affects the app you build yourself.)

20. Support

Questions before or after purchase? Please use the Support tab on the CodeCanyon item page. All support is handled through the official Envato item support system.

Support covers bugs and questions about the included features. Customisation and installation on your server are not part of item support.

Before you open a ticket

What to include

A complete first message lets us answer in one reply instead of several:

InformationHow to get it
Your purchase codeCodeCanyon > Downloads > Lumora > License certificate and purchase code
Which partFlutter app, backend or admin panel, and the documentation section you were following
Platform and versionsAndroid or iOS and the device or emulator; your computer's OS; for the app the output of flutter doctor -v; for the server the output of node -v and psql --version and the server's OS
The exact error messageCopy and paste the text, not a summary. A screenshot of the full screen or terminal helps too
Log outputApp: the red error lines from flutter run. Backend: pm2 logs lumora-backend --lines 100. Admin panel: pm2 logs lumora-admin --lines 100 and the browser console (F12 > Console)
Steps to reproduceWhat you did, what you expected, and what happened instead
Never send secrets. Remove passwords, JWT_SECRET, SETTINGS_ENCRYPTION_KEY, service-account JSON, payment and RevenueCat keys and keystore passwords from anything you paste. We will never ask for them.

More resources

21. AI Disclosure

Yes, AI tools were used to help create parts of this item:

All of it was reviewed, tested and finished by the author, who supports the item. The item itself includes no AI features: the app, backend and admin panel do not use or call any AI service.

22. Changelog

Version 1.0.0 (Initial Release)

23. Upgrading to a New Version

When a new version of Lumora is released, download it from your CodeCanyon Downloads page and read its changelog first. Your courses, learners, orders and settings live in your PostgreSQL database and your storage bucket, not in the code, so updating the code does not delete them.

Before you start

Carrying your own code changes forward

If you edited source files (not only settings), do not copy the new version straight over them. The safest way is Git:

# one time, before your first customisation
cd Backend            # or Admin-Panel, or Flutter-App
git init && git add -A && git commit -m "Lumora 1.0.0 original"
# ...make your changes and commit them as usual...

# when a new version arrives
git checkout -b upgrade
# copy the new package files over the folder (keep the files listed above)
git add -A && git commit -m "Lumora 1.x.x original"
git checkout main && git merge upgrade      # Git combines both; fix any conflicts it lists

Without Git, compare your old folder and the new one with a diff tool (VS Code: right-click two files > Compare Selected) and re-apply your edits to the new files.

1. Backend

cd Backend
# copy the new files over your old folder, keeping your .env
npm ci
npm run build
npm run db:migrate
pm2 restart lumora-backend

2. Admin panel

cd Admin-Panel
# copy the new files over your old folder, keeping .env.local
pnpm install
pnpm build
pm2 restart lumora-admin

The admin panel stores nothing itself; all data comes from the backend. Upgrade the backend first.

3. Flutter app