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.
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.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.












A tour of the admin panel with screenshots is in section 14.
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.
firebase_core, firebase_messaging, firebase_crashlytics in the app; a service account in the backend). You accept Google's Firebase Terms of Service and pay any usage beyond the free plan. Setup: section 4.| Service | Required? | Used for | Who bills you |
|---|---|---|---|
| Server or cloud host | Required | Runs the backend (Node.js 24 LTS or newer) and the admin panel. A VPS, or a serverless host such as Vercel | Your hosting provider |
| PostgreSQL database | Required | All 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 uploads | Course pictures, lesson videos, documents and certificate files uploaded from the admin panel. Without it you can only paste links to files hosted elsewhere | Your storage provider, usage-based |
| SMTP email provider | Required for password reset and emailed codes | Sending password-reset and verification codes | Your email provider, beyond its free tier |
| Firebase (your own project) | Optional | Push notifications (Cloud Messaging), crash reports (Crashlytics) and Google sign-in. The free plan covers typical use. Without it, those features are off | Google, beyond the free plan |
| Google Sign-In (OAuth client IDs in your Google Cloud project) | Optional | Sign in with Google. Without it, learners use email and password | Free |
| Stripe | Optional | Hosted card checkout | Stripe, a fee on each payment |
| Flutterwave | Optional | Hosted checkout with cards, bank transfer and mobile money | Flutterwave, a fee on each payment |
| Razorpay | Optional | Hosted checkout with cards, UPI and net banking | Razorpay, a fee on each payment |
| Google Play Billing | Optional | In-app purchase of a course on Android, with one-time products you create in Play Console | Google keeps a service fee on every purchase (commonly 15–30%) |
| RevenueCat (your own account) | Required for Google Play purchases | Talks to Google Play for the app and confirms every purchase to the backend | RevenueCat: free up to a monthly revenue limit, then a share of revenue |
| Apple In-App Purchase | Not supported in this version | Turned off in the iOS app: the iOS app sells no paid content (section 11) | — |
| PayPal, bKash, Nagad, SSLCommerz and other gateways | Not integrated | No checkout integration ships for these. Adding one is custom development | — |
| Bunny Stream | Optional | Adaptive video streaming with quality levels. Without it, lessons play as MP4 files from your storage | Bunny.net, usage-based |
| Zoom, Google Meet or Jitsi | Optional | Live classes: you paste a meeting link. Meetings run on your own account | That provider, under its pricing |
| Google Play Developer account | Required for Android | Publishing the app; USD 25 one-time | |
| Apple Developer Program | Required for iOS | Publishing the app; USD 99 per year | Apple |
| Ads | Not included | The app shows no ads and ships no ad SDK | — |
| Demo content | Free | The 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 | — |
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.
| Connection | What happens |
|---|---|
| App → Backend | Every 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 → Backend | For 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 → Backend | Staff 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 → PostgreSQL | All data lives here. Only the backend connects. Money steps (order, payment, refund) each run in one database transaction. |
| Backend → S3 storage / Bunny Stream | The 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 → Backend | For 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 → Backend | For 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 Messaging | Push notifications (from the admin panel, exam reminders, announcements) are sent by the backend with your Firebase service account. |
| Scheduler → Backend | A cron call to /internal/cron/minute every minute runs exam results, reminders, push delivery, missed-payment checks and cleanup. |
Use these versions for the smoothest build. The item was built and tested with the versions marked "tested".
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.
| CPU | RAM | Disk | Good for | |
|---|---|---|---|---|
| Minimum | 1 vCPU | 2 GB (plus 2 GB swap) | 20 GB SSD | Testing and a small academy |
| Recommended | 2 vCPU | 4 GB | 40 GB SSD | Launch, thousands of learners, live exams |
| Growing | 4 vCPU or more | 8 GB or more | 80 GB SSD | Many 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 shows something newer, point Flutter at Android Studio's JDK: flutter config --jdk-dir "<Android Studio>/jbr".
Select your operating system to see the setup steps.
C:\flutter.C:\flutter\bin to the Path environment variable (This PC > Properties > Advanced system settings > Environment Variables).flutter doctor. Fix anything it reports.tar xf flutter_macos_<version>.tar.xzflutter/bin to your PATH in ~/.zshrc, then open a new terminal and run flutter doctor.sudo xcodebuild -runFirstLaunch.sudo gem install cocoapods (or brew install cocoapods).tar -xvzf android-studio-*-linux.tar.gz) and run bin/studio.sh.tar xf flutter_linux_<version>.tar.xzflutter/bin to your PATH, then run flutter doctor.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
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.
| File | Change |
|---|---|
android/app/build.gradle.kts | namespace and applicationId |
android/app/src/main/kotlin/com/lumora/app/MainActivity.kt | Move 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/Runner.xcworkspace in Xcode.<your bundle id>.RunnerTests).pubspec.yaml is internal and never shown to learners. Leave it as it is; renaming it means updating every package: import.
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.
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:
Flutter-App/android/app/google-services.jsonFlutter-App/ios/Runner/GoogleService-Info.plist
google-services.json and replace Flutter-App/android/app/google-services.json.GoogleService-Info.plist and drag it into Runner/ in Xcode (tick "Copy items if needed"), replacing the placeholder.
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.
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.
| Where | File or setting |
|---|---|
| Android home screen | android:label="Lumora" in android/app/src/main/AndroidManifest.xml |
| iOS home screen | CFBundleDisplayName in ios/Runner/Info.plist |
| Inside the app | Admin panel > Settings > General (the academy name). No rebuild needed |
android/app/src/main/res > New > Image Asset. Choose your 1024 × 1024 image; it generates every mipmap-* size, including the adaptive icon.ios/Runner/Assets.xcassets/AppIcon.appiconset (Xcode accepts a single 1024 × 1024 image).android/app/src/main/res/drawable/launch_background.xml and drawable-v21/launch_background.xml.ios/Runner/Base.lproj/LaunchScreen.storyboard and the LaunchImage asset.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.
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"
}
| Key | Meaning |
|---|---|
API_BASE_URL | The 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. |
TENANT | Your academy slug, the DEFAULT_TENANT_SLUG you chose on the backend. Sent as the X-Tenant header. |
GOOGLE_WEB_CLIENT_ID | The 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
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.
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.
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" } }
}
}
lib/l10n/app_en.arb to lib/l10n/app_fr.arb, change "@@locale": "en" to "@@locale": "fr" and translate every value (not the keys, not the {placeholders}):
{
"@@locale": "fr",
"commonRetry": "Réessayer",
"payStoreSubtitle": "Payez avec votre compte {store}, dans votre devise locale"
}lib/src/core/localization/locale_cubit.dart:
static const List<AppLanguage> supported = [
AppLanguage('en', 'English', 'English'),
// ...
AppLanguage('fr', 'French', 'Français'),
];flutter gen-l10n
flutter run --dart-define-from-file=config/app_config.jsonapp_xx.arb file and its line in locale_cubit.dart, then run flutter gen-l10n.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.
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.
| Gateway | Fields | Where to find them | Environment variables |
|---|---|---|---|
| Stripe | Secret key, webhook secret | Developers > API keys > Secret key (sk_test_… / sk_live_…). The webhook secret (whsec_…) comes from step 2 | STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET |
| Flutterwave | Secret key, webhook secret hash | Settings > API keys > Secret key. The secret hash is a long random string you make up (step 2) | FLUTTERWAVE_SECRET_KEY, FLUTTERWAVE_WEBHOOK_HASH |
| Razorpay | Key ID, key secret, webhook secret | Account & 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.
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.
checkout.session.completed, checkout.session.async_payment_succeeded, checkout.session.async_payment_failed, checkout.session.expired, charge.refunded, charge.refund.updated, refund.updated, refund.failed. Save, reveal the Signing secret and paste it as the webhook secret.payment_link.paid, payment_link.cancelled, payment_link.expired, payment.failed, refund.processed, refund.failed.PAYMENT_SIMULATOR_ENABLED=false in production. See Payment simulator below.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:
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.POST /checkout/orders, section 17). Its answer contains "payment": { "action": "simulate", "endpoint": "/checkout/orders/<id>/simulate-payment" }.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:
.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.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.POST /checkout/orders/ANY_ORDER_ID/simulate-payment as a learner. With the simulator off the answer is 403 with Payment simulator is disabled.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.
| Platform | Paid courses and bundles | Free courses |
|---|---|---|
| Android app | Google Play in-app purchase (RevenueCat), and the web gateways Stripe, Flutterwave and Razorpay if you offer them on Android | Yes |
| Web | Stripe, Flutterwave and Razorpay | Yes |
| iOS app | Not 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) |
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.
BILLING permission, which the app already declares.course_299, course_499, course_999, course_1499, course_1999. Set each price and activate it. Google converts the price for each country.goog_…) and a secret API key (sk_…, version 1).In the admin panel open Settings > Payments > App stores > Google Play and enter:
| Field | Value | Environment variable |
|---|---|---|
| Secret key | RevenueCat secret API key (sk_…). Server only | REVENUECAT_SECRET_KEY |
| SDK key | RevenueCat public SDK key (goog_…). Sent to the app | REVENUECAT_GOOGLE_SDK_KEY |
| Webhook authorization | A 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.
In RevenueCat open Integrations > Webhooks > Add:
https://api.your-domain.com/webhooks/revenuecat/<your academy slug> (shown in the admin panel). One URL serves both stores.The webhook settles a purchase when the app closed before it could confirm, and removes access when a purchase is refunded from the store.
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:
appl_…).appl_… SDK key (environment variable REVENUECAT_APPLE_SDK_KEY), and switch it on.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.
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.
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.
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.
| Purpose | Command |
|---|---|
| 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 yourself | flutter build apk --release --split-per-abi --obfuscate --split-debug-info=build/symbols --dart-define-from-file=config/app_config.json |
| Debug APK | flutter 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.
cd ios && pod install && cd ... The minimum iOS version is 15.0 (already set in the Podfile and the Xcode project).flutter build ipa --release --dart-define-from-file=config/app_config.json and upload build/ios/ipa/*.ipa with Xcode's Organizer or the Transporter app.https addresses. Make sure API_BASE_URL uses https before you publish.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.
cd Backend
npm ci
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.
cp .env.example .env
Every variable is explained in .env.example. The ones you must look at:
| Variable | Example | What it is |
|---|---|---|
NODE_ENV | production | Use production on your server |
PORT | 3000 | Port the API listens on |
DATABASE_URL | postgresql://lumora:password@localhost:5432/lumora | Required. Your database |
JWT_SECRET | output of openssl rand -base64 48 | Required. Signs sign-in tokens; 32 characters or more |
PUBLIC_API_URL | https://api.your-domain.com | The public address of the API, used in webhook URLs and certificate links |
DEFAULT_TENANT_SLUG | acme | Your academy's short name (lowercase letters, digits, dashes). Must match the app's TENANT (section 8) |
SETUP_OWNER_EMAIL, SETUP_OWNER_PASSWORD | owner@your-domain.com, a long password | Your first admin account, created by step 4 |
SETUP_TENANT_NAME, SETUP_CURRENCY, SETUP_BUSINESS_MODE | Acme Academy, USD, academy | Optional. Academy name, currency (locked after the first order) and mode: academy (one school) or marketplace (many instructors and organizations) |
SETTINGS_ENCRYPTION_KEY | output of openssl rand -base64 48 | Needed to save payment keys, an SMTP password or a Bunny library in the admin panel. Keep it stable and backed up |
CRON_SECRET | a long random string | Protects the minute cron route (step 7) |
GOOGLE_CLIENT_IDS | your Web client ID | For Google sign-in. Must contain the app's GOOGLE_WEB_CLIENT_ID (section 5) |
FCM_SERVICE_ACCOUNT_JSON | the service account JSON on one line | For push notifications (section 4) |
S3_*, MEDIA_BUCKET, PUBLIC_MEDIA_BUCKET, PUBLIC_MEDIA_BASE_URL | see step 10 | File storage for uploads |
SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, SMTP_FROM | your mail provider's values | Password-reset and verification emails (step 11) |
TRUST_PROXY | 1 behind nginx | So 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.
npm run build
npm run db:migrate
This is the real output on an empty database:
DEFAULT_TENANT_SLUG, SETUP_TENANT_NAME and SETUP_CURRENCY.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:
npm run start:prod
$ 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.
SETUP_OWNER_PASSWORD from .env. It is only read when the owner does not exist yet..env readable only by the user that runs the server: chmod 600 .env.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.
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.
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.
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.
MEDIA_BUCKET) for lesson videos and documents. Learners get short-lived signed links (MEDIA_SIGNED_URL_SECONDS, default one hour).PUBLIC_MEDIA_BUCKET + PUBLIC_MEDIA_BASE_URL) for course pictures, banners, logos and instructor photos. PUBLIC_MEDIA_BASE_URL is the public address of that bucket or your CDN.S3_ENDPOINT, S3_REGION, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY. For R2: S3_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com, S3_REGION=auto, S3_FORCE_PATH_STYLE=true.PUT from your admin panel's address, because the browser uploads directly:
[{ "AllowedOrigins": ["https://admin.your-domain.com"],
"AllowedMethods": ["PUT", "GET"],
"AllowedHeaders": ["*"] }]Without storage you can still paste links to images and videos hosted elsewhere.
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.
| Feature | What to set | Section |
|---|---|---|
| Push notifications | FCM_SERVICE_ACCOUNT_JSON | 4 |
| Google sign-in | GOOGLE_CLIENT_IDS | 5 |
| Stripe, Flutterwave, Razorpay | Keys in Settings > Payments (or env keys) and webhooks | 10 |
| Google Play (RevenueCat) | Keys in Settings > Payments > App stores and the RevenueCat webhook | 11 |
| Bunny Stream video | Settings > Video in the admin panel, or BUNNY_STREAM_* | admin panel |
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.
Backend folder as a Vercel project. vercel.json already routes every request to the API and schedules the cron.DATABASE_POOL_MAX=1. Use a pooled connection string for DATABASE_URL (PgBouncer, Supabase or Neon pooled).npm run db:migrate once from your computer with the same DATABASE_URL (and again after each update).AUTH_RATE_LIMIT_PER_MINUTE (default 60 per client address on sign-in routes; schools often share one address, so do not set it too low).SETTINGS_ENCRYPTION_KEY. They are never shown again or logged.*_API_BASE, FCM_API_BASE, SMTP_ALLOW_PRIVATE_HOSTS) are refused, and PAYMENT_SIMULATOR_ENABLED logs an error until you turn it off.| Problem | Fix |
|---|---|
| "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:5432 | PostgreSQL is not running or listens elsewhere: sudo systemctl status postgresql, and check host and port in DATABASE_URL |
password authentication failed | The user or password in DATABASE_URL is wrong. Special characters in the password must be URL-encoded (@ = %40) |
EADDRINUSE: address already in use :::3000 | Another 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_REQUIRED | The 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 panel | Storage 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 arrives | Check 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 appear | The 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 400 | The 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/ |
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.
cd Admin-Panel
corepack enable # makes the pnpm version in package.json available
pnpm install
cp .env.example .env.local
| Variable | Example | What it is |
|---|---|---|
API_BASE_URL | http://localhost:3000 or https://api.your-domain.com | Your backend. Read on the server only |
LUMORA_TENANT | acme | Your academy slug. Leave empty to use the backend's DEFAULT_TENANT_SLUG |
pnpm dev
Open http://localhost:3001. You should see the sign-in page with your academy's name:
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.
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.
https:// link to a PNG with a transparent background. Leave empty for none.#0F766E.
USD, EUR or INR. It is locked after the first order, so set it now.LM-2026-000123.
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.
Next: publish your first course (section 15).
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.
| Role | Can |
|---|---|
| Owner | Everything, including payment keys, team and business mode |
| Admin | Everything except owner-only settings |
| Content manager | Courses, bundles, categories, exams, app home, FAQ |
| Support | Learners, reviews, questions, notifications |
| Finance | Orders, refunds, coupons, revenue |
| Instructor, organization admin | Marketplace mode only: their own courses, bundles, reviews, questions and earnings (the Studio) |
What the main pages look like, from the demo academy with sample courses.













| Problem | Fix |
|---|---|
| "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 error | API_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 effect | Restart pnpm dev; in production run pnpm build again and restart |
| Images upload but do not show | PUBLIC_MEDIA_BASE_URL on the backend does not point at the public bucket or CDN |
pnpm: command not found | Run corepack enable (Node.js 24+), or npm install -g pnpm@9 |
| Build runs out of memory | Add swap on small servers, or build on your computer and copy the .next folder |
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.
Learners browse courses by category, and every course needs one. Open Catalogue > Categories and click New category.

Open Catalogue > Courses and click New course.

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

https:// link. A 16:9 picture works best. A promo video link (YouTube, Vimeo or a video file) is optional.Open the Curriculum tab. A course is made of sections, and each section holds lessons.


Document lessons take a PDF or slide file, article lessons a formatted text, and quiz lessons their questions. Fill every lesson before you publish.
Click Publish at the top right of the course.


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.

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).
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:



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.
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.
| Who | Where they work | What they do |
|---|---|---|
| You (owner or admin) | Admin panel | Turn 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 Studio | Builds courses, sends them for review, answers questions, requests payouts |
| Organization admin (a seller) | The same Studio | Like an instructor, for an organization's page, plus adding the organization's instructors |
| Finance role (optional) | Admin panel | Can see earnings and pay sellers |
Open Settings > Business (or step 2 of the setup wizard) and click Switch to Marketplace. Only the owner can change the mode.

You can switch back to Academy mode later only while no other seller has a published course: unpublish or archive their courses first.
After the switch, the same page shows Selling on your marketplace.

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.
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.
Open People > Applications. Waiting applications are listed first.


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.
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.

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

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

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:


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


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.
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.
https://api.your-domain.com (the value of PUBLIC_API_URL).X-Tenant: acme on every request, where acme is your academy slug. Without the header the server uses DEFAULT_TENANT_SLUG; if that is empty too, the answer is 400 TENANT_REQUIRED. The demo data uses the slug demo.Content-Type: application/json). Files never pass through the API; they are uploaded straight to storage (see File uploads).Authorization: Bearer <accessToken>. Catalogue reads work without a token.?lang=es, else the Accept-Language header, limited to the languages the academy has switched on. Translatable text comes back in that language.X-App-Version. Below the minimum set in the admin panel the answer is 426 UPDATE_REQUIRED.Minor (USD 2 decimals, JPY 0, KWD 3). priceMinor: 1999 in USD is $19.99./auth/* allows AUTH_RATE_LIMIT_PER_MINUTE requests per IP (default 60). Over the limit you get 429.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.
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.
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.
| Code | Meaning |
|---|---|
| 200 / 201 | Success. 201 when a POST creates something (account, order, course) |
| 400 | Bad request: malformed ID, missing X-Tenant, wrong or expired emailed code |
| 401 | Missing, invalid or expired token; wrong email or password; suspended account |
| 403 | Not allowed: no console permission, not enrolled, feature switched off, lesson locked |
| 404 | Not found, or the academy slug is unknown |
| 409 | Conflict with the current state: email taken, order already paid, exam closed, item in use |
| 422 | Validation failed (fieldErrors), or a business rule such as an invalid coupon |
| 426 | The app version is below the minimum (minSupported, updateUrl in body) |
| 429 | Too many requests |
| 500 | Unexpected server error |
| 501 | A service is not set up: email delivery, S3 storage, Google/Apple sign-in, video streaming |
| 502 | A payment or video provider refused the call or could not be reached |
| 503 | Maintenance mode is on (MAINTENANCE), or the health check cannot reach the database |
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.
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.
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).
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
idempotencyKey (8 to 100 characters) is made by the app once per checkout attempt. Sending the same key again returns the same order.gateway must be one of the values in GET /app/config → paymentGateways, else 422 GATEWAY_UNAVAILABLE."gateway": "free" and "payment": { "action": "none" }.returnUrl, then call verify. The provider's webhook settles the order too, so verify is a shortcut, not a requirement.POST /checkout/quote takes the same courseIds / bundleIds / couponCode and returns prices without creating anything.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.
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.
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.
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).{ "mediaFileId": "uuid", "uploadUrl": "https://...", "method": "PUT", "headers": { ... }, "expiresAt": "..." }. PUT the file to uploadUrl with exactly those headers.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.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.
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.
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.
CRON_SECRET, JWT_SECRET and SETTINGS_ENCRYPTION_KEY private. Never ship them inside the Flutter app or the admin panel build.
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/).
| Group | Method and path | Access |
|---|---|---|
| Health | GET /health | public, no tenant; 503 when the database is down |
| Auth | POST /auth/registerPOST /auth/loginPOST /auth/googlePOST /auth/applePOST /auth/refreshPOST /auth/logoutPOST /auth/password/forgotPOST /auth/password/verify-codePOST /auth/password/reset | public |
| App config | GET /app/configGET /app/onboardingGET /app/faqGET /app/legal/:kind | public |
| Catalogue | GET /homeGET /home/sections/:id/coursesGET /categoriesGET /coursesGET /courses/:idOrSlugGET /courses/:idOrSlug/reviewsGET /courses/:idOrSlug/similarGET /instructorsGET /instructors/:idGET /organizationsGET /organizations/:slugGET /bundlesGET /bundles/:idOrSlugGET /search/trendingPOST /search/queriesGET /recommendations/guest | public |
| Profile | GET /mePATCH /meDELETE /mePOST /me/passwordPOST /me/email/codePOST /me/email/verifyPOST /me/avatar/uploadGET /me/instructor-applicationPOST /me/instructor-application | token |
| Personalization | GET /me/preferencesPUT /me/preferencesGET /me/recommendationsGET /me/recommendations/sections/:idPOST /me/recommendations/dismissDELETE /me/recommendations/dismiss/:courseIdPOST /me/recommendations/reset | token |
| My learning | GET /me/learningGET /me/courses/:courseId/accessPOST /me/enrollments | token |
| Player | GET /me/courses/:courseId/playerGET /me/courses/:courseId/lessons/:lessonIdPUT /me/courses/:courseId/lessons/:lessonId/progressGET /me/courses/:courseId/resourcesGET /me/courses/:courseId/announcementsGET /me/courses/:courseId/notesPOST /me/courses/:courseId/notesPATCH /me/notes/:noteIdDELETE /me/notes/:noteIdPOST /me/courses/:courseId/review | enrolled |
| Q&A | GET /me/courses/:courseId/questionsPOST /me/courses/:courseId/questionsGET /me/questions/:threadIdPOST /me/questions/:threadId/repliesPUT /me/questions/:threadId/voteDELETE /me/questions/:threadId/vote | enrolled |
| Quizzes | GET /me/courses/:courseId/quizzes/:quizIdGET /me/courses/:courseId/quizzes/:quizId/attemptsPOST /me/courses/:courseId/quizzes/:quizId/attempts | enrolled |
| Live exams | GET /me/examsGET /me/exams/:examIdPUT /me/exams/:examId/reminderDELETE /me/exams/:examId/reminderPOST /me/exams/:examId/attemptGET /me/exams/:examId/attemptPUT /me/exams/:examId/attempt/answers/:questionIdPOST /me/exams/:examId/attempt/submitPOST /me/exams/:examId/attempt/eventsGET /me/exams/:examId/leaderboardGET /me/exams/:examId/review | token / enrolled |
| Live classes | GET /me/live-sessionsGET /me/courses/:courseId/live-sessionsPOST /me/live-sessions/:id/join | token / enrolled |
| Wishlist and cart | GET /me/wishlistPUT /me/wishlist/:courseIdDELETE /me/wishlist/:courseIdGET /me/cartPUT /me/cart/:courseIdDELETE /me/cart/:courseIdPUT /me/cart/bundles/:bundleIdDELETE /me/cart/bundles/:bundleIdDELETE /me/cart | token |
| Checkout | GET /checkout/couponsPOST /checkout/quotePOST /checkout/ordersPOST /checkout/orders/:id/payPOST /checkout/orders/:id/verifyGET /checkout/gatewaysGET /checkout/courses/:courseId/gatewaysPOST /checkout/store/ordersPOST /checkout/orders/:id/store-verify | token |
| Orders | GET /me/ordersGET /me/orders/:idPOST /me/orders/:id/cancel | token |
| Notifications and devices | GET /me/notificationsGET /me/notifications/unread-countPOST /me/notifications/:id/readPOST /me/notifications/read-allPOST /me/devicesPOST /me/devices/unregister | token |
| Certificates | GET /me/certificatesGET /me/certificates/:idPATCH /me/certificates/:id/nameGET /certificates/verify/:codeGET /certificates/:id/pdf | token for /me; the rest public, no tenant |
| Console: dashboard | GET /console/dashboardGET /console/analytics/homeGET /console/analytics/campaigns | staff |
| Console: courses | GET /console/coursesPOST /console/coursesGET /console/courses/:idPATCH /console/courses/:idPOST /console/courses/:id/statusPOST /console/courses/:id/sectionsPUT /console/courses/:id/orderPATCH /console/sections/:idDELETE /console/sections/:idPOST /console/sections/:id/lessonsPATCH /console/lessons/:idDELETE /console/lessons/:idGET /console/quizzes/:idPUT /console/quizzes/:idGET /console/courses/:id/resourcesPOST /console/courses/:id/resources | staff (Courses) or seller for own courses |
| Console: uploads | POST /console/uploadsPOST /console/uploads/imagePOST /console/uploads/:id/completePOST /console/uploads/multipartPOST /console/uploads/multipart/:id/partsPOST /console/uploads/multipart/:id/completeDELETE /console/uploads/multipart/:id | staff or seller |
| Console: categories and bundles | GET /console/categoriesPOST /console/categoriesPATCH /console/categories/:idDELETE /console/categories/:idGET /console/bundlesPOST /console/bundlesPATCH /console/bundles/:idPUT /console/bundles/:id/coursesDELETE /console/bundles/:id | staff |
| Console: exams | GET /console/examsPOST /console/examsGET /console/exams/:idPATCH /console/exams/:idPUT /console/exams/:id/paperPOST /console/exams/:id/statusGET /console/exams/:id/monitor | staff |
| Console: live classes | GET /console/courses/:courseId/live-sessionsPOST /console/courses/:courseId/live-sessionsPATCH /console/live-sessions/:idPOST /console/live-sessions/:id/cancelGET /console/live-sessions/:id/attendance | staff |
| Console: learners | GET /console/learnersGET /console/learners/:idPOST /console/learners/:id/enrollmentsPOST /console/enrollments/:id/revokePOST /console/learners/:id/statusPOST /console/learners/:id/password-resetDELETE /console/learners/:id | staff |
| Console: sales | GET /console/ordersGET /console/orders/:idPOST /console/orders/:id/refundsGET /console/couponsPOST /console/couponsPATCH /console/coupons/:idDELETE /console/coupons/:idGET /console/reports/revenueGET /console/sale-campaignsPOST /console/sale-campaigns | staff |
| Console: store products | GET /console/store-productsPOST /console/store-productsPATCH /console/store-products/:idGET /console/courses/:id/payment-methodsPUT /console/courses/:id/payment-methods | staff |
| Console: certificates | GET /console/certificatesPOST /console/certificates/issuePOST /console/certificates/:id/revokePOST /console/certificates/:id/restore | staff |
| Console: engagement | GET /console/campaignsPOST /console/campaignsGET /console/reviewsPOST /console/reviews/:id/moderateGET /console/questionsPOST /console/questions/:id/replies | staff |
| Console: home content and FAQ | GET /console/home-contentPOST /console/home-content/bannersPOST /console/home-content/sectionsPUT /console/home-content/orderGET /console/faqPOST /console/faq | staff |
| Console: settings | GET /console/settingsPATCH /console/settingsPUT /console/settings/appPUT /console/settings/featuresPUT /console/settings/emailPUT /console/settings/gateways/:providerPOST /console/settings/gateways/:provider/testPOST /console/settings/business-mode | staff (Settings); owner only for gateways and business mode |
| Console: team | GET /console/teamPOST /console/teamPUT /console/team/:id/rolesPOST /console/team/:id/suspendGET /console/custom-rolesPOST /console/custom-rolesGET /console/activity | owner/admin; suspend: owner; activity: staff |
| Console: sellers and payouts | GET /console/sellersPATCH /console/sellers/:idGET /console/instructor-applicationsPOST /console/instructor-applications/:id/approveGET /console/payouts/balancesPOST /console/payouts | staff (Sellers, Payouts) |
| Console: Seller Studio | GET /console/studioGET /console/studio/coursesPOST /console/studio/coursesPOST /console/studio/payoutsPOST /console/studio/announcements | seller |
| Console: CSV exports | GET /console/exports/orders.csvGET /console/exports/revenue.csvGET /console/exports/learners.csv | staff (Reports); learners: owner/admin |
| Webhooks | POST /webhooks/:provider/:tenantSlug | signature |
| Cron | GET /internal/cron/minute | cron |
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.
Backend/db/migrations/*.sql, numbered in the order they run. One file, 0052_legal_pages_html.js, is a JavaScript data step that runs the same way.npm run db:migrate applies only the files that have not run yet, each in its own transaction, and records each file name in the schema_migrations table. Running it again is safe: it prints database is up to date.SETUP_OWNER_EMAIL and SETUP_OWNER_PASSWORD are set, db:migrate also creates your academy and its first owner account, once.npm run db:seed loads Backend/db/seed.sql: the demo academy (slug demo) with 14 courses, instructors, exams, coupons and the accounts owner@demo.lumora.test and learner@demo.lumora.test (password lumora-demo-123). It refuses to run with NODE_ENV=production.pgcrypto and pg_trgm extensions. Both are created automatically when the database user may do so. If not, run CREATE EXTENSION IF NOT EXISTS pg_trgm; once as a superuser before migrating.uuid with gen_random_uuid().tenant_id referencing tenants, and every query filters by it._minor and are bigint in the currency's smallest unit (price_minor, total_minor, amount_minor). Currency is a 3-letter code (char(3)).timestamptz (created_at, updated_at). A shared trigger, set_updated_at(), keeps updated_at current.users, courses, lessons and coupons have a deleted_at column. Deleting a learner scrubs their personal data but keeps orders and payments as anonymous records.jsonb, for example {"en": "Design", "es": "Diseño"}.CHECK constraints on text columns, not PostgreSQL enum types.lesson_count, total_duration_sec, enrollment_count, rating_avg, rating_count), refuse refunds above the amount paid, and make activity_log append-only.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.
users → orders → order_items (one per course) → payments (one per payment attempt) → enrollments (access to the course). A refund adds a row to refunds and ends the enrollment.enrollments unlock the course's course_sections and lessons; each finished lesson is a row in lesson_progress; finishing the course creates a row in certificates when the course gives a certificate.quizzes (lessons.quiz_id); each try is a quiz_attempts row. Live exams live in exams and exam_attempts, with questions from questions.seller_id. In Academy mode there is one seller, your academy. In Marketplace mode instructors and organizations get their own sellers rows; order_items.seller_id and the seller's share on each item feed payouts.tenants holds each academy and its settings; every query is scoped by tenant_id.The migrations create 92 tables, plus schema_migrations created by the migration runner.
| Area | Tables |
|---|---|
| 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 |
| Table | Important columns |
|---|---|
users | tenant_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 |
courses | tenant_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 |
lessons | course_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 |
orders | tenant_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_items | order_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 |
payments | One 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) |
enrollments | tenant_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 |
certificates | user_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_products | tenant_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_gateways | tenant_id, provider, kind (hosted or store, derived), environment, enabled, platforms, display_name, config_encrypted (keys sealed with SETTINGS_ENCRYPTION_KEY) |
| Column | Values |
|---|---|
| Order status | pending, paid, failed, cancelled, refunded, partially_refunded |
| Payment status | initiated, success, failed, cancelled, unapplied (money that arrived for an order that could not take it), refunded |
| Refund status / method | requested, processed, failed / gateway, manual |
| Gateway provider | stripe, flutterwave, razorpay, google_play, app_store (google_play only on android, app_store only on ios) |
| Enrollment status / source | active, revoked, refunded, expired / purchase, free, admin_grant |
| Course status | draft, in_review, changes_requested, published, unpublished, archived |
| Course level / progression | beginner, intermediate, advanced, all / free, sequential |
| Lesson type | video, document, quiz, article |
| Video source | upload, stream, youtube, vimeo, url |
| Console role | owner, admin, content_manager, support, finance, instructor, org_admin, operator, custom (a custom role points at custom_roles) |
| User status / auth provider | active, suspended, deleted / email, phone, google, apple |
| Business mode | academy, marketplace |
| Store product status | active, archived |
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.
| Function | What it does |
|---|---|
create_order | Prices 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_order | Finds the learner's pending order with exactly the same courses, bundles and coupon (never a store order) |
confirm_order_payment | Marks the order paid (once), creates the enrollments with their expiry, clears the cart and posts a purchase notification |
settle_gateway_payment | Applies 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_refunds | Completes 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_order | Cancels an unpaid order and gives its coupon use back |
course_price | The one pricing function: list price, course sale and sale campaigns |
record_lesson_progress, record_player_progress, refresh_enrollment_progress | Save the player heartbeat, unlock the next lessons, update the course percentage and issue the certificate on completion (issue_certificate) |
start_quiz_attempt, submit_quiz_attempt | Quiz rules (attempt limit, cool-down, time limit) under a per-learner lock |
start_exam_attempt, save_exam_answer, close_exam_attempt, finalize_exam, sweep_exams | The live exam engine: server-side deadline, grading in SQL, final ranks |
# 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.
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.
flutter doctor and fix every item it reports.flutter clean then flutter pub get, and try again.curl https://api.your-domain.com/health.| Error or problem | Fix |
|---|---|
| "Unsupported class file major version" / Gradle fails to start | Your 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 build | The 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 error | The backend refused the token: its GOOGLE_CLIENT_IDS must contain the app's GOOGLE_WEB_CLIENT_ID |
| Google sign-in crashes on iOS | Add the REVERSED_CLIENT_ID URL scheme (section 5) |
| Nothing loads; every screen shows an error | Check 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 build | Release builds only allow https. Put the backend behind HTTPS (section 13, step 9) |
| A payment method does not appear on the Payment page | It 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 price | Install 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 locked | Check 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 arrive | Check 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 ones | The app caches its settings. Close it fully and open it again |
See the troubleshooting tables in section 13 and section 14.
| Question | Answer |
|---|---|
| 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.) |
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.
A complete first message lets us answer in one reply instead of several:
| Information | How to get it |
|---|---|
| Your purchase code | CodeCanyon > Downloads > Lumora > License certificate and purchase code |
| Which part | Flutter app, backend or admin panel, and the documentation section you were following |
| Platform and versions | Android 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 message | Copy and paste the text, not a summary. A screenshot of the full screen or terminal helps too |
| Log output | App: 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 reproduce | What you did, what you expected, and what happened instead |
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.
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.
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.
pg_dump -Fc -d lumora -f lumora-before-upgrade.dump| Project | Keep your copy of |
|---|---|
| Backend | .env (above all SETTINGS_ENCRYPTION_KEY and JWT_SECRET), prod.config.js if you changed it |
| Admin panel | .env.local |
| Flutter app | config/app_config.json, android/app/google-services.json, ios/Runner/GoogleService-Info.plist, android/key.properties and your keystore, your package name in build.gradle.kts and MainActivity.kt, app icons, splash files, AndroidManifest.xml and Info.plist changes |
.env.example with your .env and add any new variables.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.
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
npm run db:migrate applies only the migration files that are new. Each file runs once and is recorded in the schema_migrations table.db/migrations/; add a new numbered file instead.pg_restore -d lumora --clean lumora-before-upgrade.dump and go back to the old code.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.
lib/, pubspec.yaml and assets/ over your project, then restore the files you customised (list above). If you use Git, commit first and review the diff.flutter clean
flutter pub get
cd ios && pod install && cd ..
flutter run --dart-define-from-file=config/app_config.jsonversion: in pubspec.yaml (for example 1.0.1+2) and publish the update as in section 12. Learners keep their courses and progress because these are stored on the server.
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.google-services.jsonagain afterwards.google-services.jsonit is theoauth_cliententry with"client_type": 3). Put it in the app'sGOOGLE_WEB_CLIENT_ID(section 8) and in the backend'sGOOGLE_CLIENT_IDS. The two must match, or the backend refuses the sign-in.REVERSED_CLIENT_IDfromGoogleService-Info.plistas a URL scheme in Xcode (Runner > Info > URL Types).Push notifications
google-services.jsonalone. On Android 13 and newer the app asks for the notification permission after sign-in.FCM_SERVICE_ACCOUNT_JSON(section 4, step 5) and make sure the minute cron runs (section 13); push is delivered by the cron.all, so the admin panel's "all learners" notifications need no token list. Notifications to one course's learners or to inactive learners use the device tokens the app registers after sign-in.