# Luminary AI — Complete Product Documentation

> **Luminary AI** is Archana Info Solutions' multi-tenant SaaS platform for speakers, coaches, trainers and authors. Each expert gets a branded website, a full LMS, events & ticketing, a book store, 1:1 coaching, a private community, marketing automation, a referral program, and native Android & iPhone apps — all managed from one dashboard, on one shared backend, with super-admin oversight across every tenant.

- **Product:** Luminary AI · **Vendor:** Archana Info Solutions
- **Company site:** https://archanainfo.com/Luminary/
- **Live tenants:** Ram Jaladurgam — https://archanainfo.com/RamJaladurgam · Shreans Daga — https://archanainfo.com/ShreansDaga
- **Version:** 2.0 · **Last updated:** 17 June 2026

---

## 1. At a glance

| Layer | Technology |
|---|---|
| Web | ASP.NET Web Forms, VB.NET, .NET Framework 4.7.2 |
| UI | MasterPage + ContentPlaceHolders, Tailwind (CDN), glassmorphism, Font Awesome, Playfair Display + Inter; ⌘K command palette; dark/light mode |
| API | ASHX `IHttpHandler` JSON endpoints (session-aware) |
| Data | SQL Server (shared DB, connection `AisConn`) |
| Auth | Session-based, SHA-256 + salt; optional **TOTP 2FA** for super-admin |
| AI | Shared `Ais_AI_Service` (Groq → Gemini → Claude fallback) powering copilots, studio & course builder |
| Payments | Razorpay (orders API, checkout, HMAC verify, webhooks) |
| Docs/PDF | iTextSharp (certificates & invoices) · Chart.js (analytics) |
| Mobile | PWA + Capacitor · **Native Android** (Kotlin/Compose) · **Native iOS** (SwiftUI) with native Razorpay + push |

**Conventions:** all objects prefixed `LUM_`; CDATA parameterized SQL; `&` concatenation; Try/Catch with `Ais_DBHelper.LogError`; HTML entities not emoji; new tables self-provision via `IF NOT EXISTS`.

---

## 2. Architecture

```
Browser / PWA / Native apps
        │  (HTTPS JSON)
        ▼
ASHX API handlers  ── App_Code helpers ──▶  SQL Server (AisConn)
        │                  │
   .aspx pages        Shared services: AI, Email, WhatsApp, Telegram
   (Master pages)     + scheduler (LUM_AutoRun, cron-pinged)
```

- **Multi-tenant by `SpeakerID`** — each tenant is one row in `LUM_Speakers`, resolved from the URL slug (`?s=ramjaladurgam`); every query is tenant-scoped. Proven with two live tenants and verified data isolation.
- **Per-tenant theming** — accent colours from `LUM_Speakers` injected as CSS variables over a glossy light public canvas.
- **Shared infra reused** (not duplicated): `Ais_DBHelper`, `Ais_Security`, `Ais_AI_Service`, `Ais_EmailService`, `QRC_WhatsAppService`, `Ais_TelegramService`.

---

## 3. Roles & access model

Three control levels, each with a purpose-built console:

| Role | Who | Entry point |
|---|---|---|
| **Member** | Audience / learners | `Member/LUM_MemberLogin.aspx?s=<slug>` |
| **Admin** | The speaker/coach & team | `LUM_Login.aspx?s=<slug>` |
| **Super Admin** | Platform owner | `Admin/LUM_Super.aspx` → control center |

Auth: `App_Code/LUM_Auth.vb`. Session keys `LUM_UserID/SpeakerID/Slug/Role/UserName/Email`. Super-admin can optionally enforce **TOTP 2FA** and **impersonate** any tenant (audited). Every sensitive action is recorded in the audit log.

---

## 4. Database

All tables `LUM_`-prefixed, tenant-scoped where relevant, with audit columns + `IsActive` soft delete.

| Group | Tables |
|---|---|
| Tenancy & users | `LUM_Speakers`, `LUM_Users`, `LUM_Plans`, `LUM_Subscriptions`, `LUM_Settings`, `LUM_Modules` |
| Public content | `LUM_Programs`, `LUM_Events`, `LUM_Books`, `LUM_Blogs`, `LUM_MediaItems`, `LUM_Testimonials`, `LUM_DailyContent` |
| Learning (LMS) | `LUM_Courses`, `LUM_Lessons`, `LUM_Enrollments`, `LUM_LessonProgress` (+ reviews, quiz attempts) |
| Commerce | `LUM_Orders`, `LUM_Coupons` |
| Coaching & community | `LUM_Slots`, `LUM_Bookings`, community posts, direct messages |
| CRM | `LUM_SpeakingEnquiries`, `LUM_Leads`, `LUM_EventRegistrations` |
| Engagement | `LUM_Notifications`, `LUM_PushTokens` |
| Marketing automation | `LUM_Automations`, `LUM_AutomationSent`, `LUM_Sequences`, `LUM_SequenceSteps`, `LUM_SequenceSent` |
| Growth | `LUM_Referrals`, `LUM_Resources` (lead magnets) |
| Platform/security | `LUM_AuditLog`, `LUM_TwoFactor` |

---

## 5. Backend — App_Code helpers (shared)

| File | Responsibility |
|---|---|
| `LUM_Config.vb` | Settings get/save (per tenant + platform), API-key access |
| `LUM_Helper.vb` | Safe getters, slug/YouTube utils, notifications |
| `LUM_Auth.vb` | Authenticate / register / sign-in / role guards |
| `LUM_Modules.vb` | Per-tenant module registry + enable/disable |
| `LUM_Pay.vb` | Razorpay order create / signature & webhook verify |
| `LUM_Audit.vb` | Shared audit writer (self-provisions `LUM_AuditLog`) |
| `LUM_Totp.vb` | RFC-6238 TOTP for super-admin 2FA |

> `App_Code` is shared by every product on the server — always compile-check before upload.

---

## 6. Backend — API endpoints (`/Luminary/api/*.ashx`)

**Public & site:** `LUM_Lead` (enquiry), `LUM_Register` (event reg), `LUM_AppApi` (app feed/config), `LUM_Ics` (calendar export), `LUM_Resource` (lead-magnet list + email-gated download), `LUM_Referral` (code + click), `LUM_RazorpayWebhook`.

**Members:** `LUM_AppAuth` (login/register/me + referral attribution), `LUM_Member` (enroll, progress, notes, quiz, review, course detail), `LUM_Coach` (Spark AI coach + gamification stats), `LUM_Leaderboard`, `LUM_Booking`, `LUM_Community`, `LUM_Msg`, `LUM_Notify`, `LUM_PushRegister`, `LUM_Pay`, `LUM_Invoice`, `LUM_Certificate`.

**Admin:** `LUM_Content` (generic CRUD engine), `LUM_Admin` (status actions), `LUM_LessonApi`, `LUM_CourseGen` (AI course builder), `LUM_AI` (content studio), `LUM_Copilot` (Lumina AI), `LUM_Broadcast`, `LUM_AutoApi` (automations) + `LUM_AutoRun` (scheduler), `LUM_Seq` (drip sequences), `LUM_Referral` (board/reward config), `LUM_Resource` (lead magnets), `LUM_Team`, `LUM_Stats` (analytics), `LUM_AuditMy` (own activity log), `LUM_ApiTest`.

**Super admin:** `LUM_SuperApi` (tenants/users/modules/plans/app-config), `LUM_SuperHealth` (tenant health board), `LUM_SuperFlags` (feature-flag matrix), `LUM_Impersonate` (view-as-tenant), `LUM_Audit` (platform audit + CSV export), `LUM_SuperConfig` (scheduler token + audit retention), `LUM_TwoFA` (2FA setup/confirm/disable).

---

## 7. Admin console

Shell `LUM_AppMaster.master` — glass topbar, **⌘K command palette** (auto-indexes nav + actions), **Lumina AI copilot** (floating assistant), **dark/light toggle**, notification bell, impersonation banner.

| Area | Pages |
|---|---|
| Overview | `LUM_Dashboard`, `LUM_Analytics` (Chart.js) |
| Engagement | `LUM_Enquiries`, `LUM_Leads`, `LUM_Pipeline` (kanban), `LUM_Registrations`, `LUM_Reviews`, `LUM_Inbox` |
| Content | `LUM_Manage` (8 types), `LUM_LessonsAdmin`, **`LUM_CourseGen` (AI Course Builder)**, **`LUM_Resources` (Lead Magnets)** |
| Growth | `LUM_AIStudio`, `LUM_Broadcast`, **`LUM_Automations`**, **`LUM_Sequences` (drip)**, **`LUM_Referrals`**, coupons |
| Coaching & community | `LUM_Book`, `LUM_Bookings`, `LUM_CommunityAdmin` |
| Account | `LUM_Settings` (+ Team), `LUM_Integrations`, **`LUM_AuditLog` (own activity)** |

---

## 8. Member portal (`/Luminary/Member/`)

Shell `LUM_MemberMaster.master` — **gamification chip** (XP · level · streak), **Spark AI learning coach** (floating).

`LUM_MyDashboard`, `LUM_MyCourses`, `LUM_MyEvents`, `LUM_MyBookings`, `LUM_Community`, `LUM_Messages`, `LUM_MyCertificates`, `LUM_MyOrders`, `LUM_MyAccount`, **`LUM_Leaderboard`**, **`LUM_Refer` (Refer & Earn)**.

Gamification: XP from completed lessons/courses/enrolments, levels, day-streaks, badges — all derived from real progress.

---

## 9. Super Admin control center (`/Luminary/Admin/`)

Shell `LUM_SuperMaster.master`.

- **`LUM_SDashboard`** — tenants overview
- **`LUM_SCommand` (Command Center)** — tenant **health board** (members/courses/enrolments/leads/revenue/health score), platform KPIs, **scheduler token** + cron URL, **audit retention**, **2FA setup**, and **"view as tenant"** impersonation
- **`LUM_STenants`** — onboard / manage tenants
- **`LUM_SUsers`**, **`LUM_SContent`**, **`LUM_SModules`**
- **`LUM_SFlags`** — tenants × modules **feature-flag matrix** (instant per-tenant toggles)
- **`LUM_SPlans`**, **`LUM_SAppControl`**
- **`LUM_SAudit`** — platform **audit log** with filters + CSV export

---

## 10. Marketing automation

**Single-step automations** (`LUM_Automations`): trigger → wait → channel → message. Triggers: new member, course completion, event registration, new lead. Channels: email + WhatsApp.

**Multi-step drip sequences** (`LUM_Sequences` + steps): ordered messages each with their own delay (days after the trigger); per-step delivery + idempotency. Visual builder at `LUM_Sequences.aspx`.

**Scheduler** (`LUM_AutoRun.ashx`): fires due automations and sequence steps. Driven by a cron/uptime ping (token from Command Center) **or** an admin's "Run due now". Idempotent via the `*Sent` tables; also purges aged audit rows per retention setting.

---

## 11. Growth: referrals & lead magnets

- **Referral program** — every member gets a code + share link (Refer & Earn); clicks tracked; signups attributed across **all** signup paths (web form, PWA, app API). **Rewards**: admin sets a signup threshold + reward code; members see a progress bar and unlock the code. Admin **leaderboard** of top referrers.
- **Lead magnets** — admin publishes free downloads; a public landing page (`LUM_Freebies.aspx?s=<slug>`) captures name + email behind each download, creating a CRM lead (`Source = Lead Magnet`).

---

## 12. Payments (Razorpay)

Create order (`LUM_Pay`) → checkout (web `checkout.razorpay.com` / native SDK) → verify `HMAC-SHA256(order_id|payment_id, secret)` → fulfil (enrol / ticket / order). Webhook `LUM_RazorpayWebhook` validates `HMAC(rawBody, secret)`. Coupons, PDF invoices and certificates included.

> **Store note:** Apple requires StoreKit IAP for *digital* content in-app; Razorpay suits web/Android & physical/real-world services. See `STORE_SUBMISSION.md`.

---

## 13. Public site & glossy light theme

`LUM_Master.master` + `LUM_Home.aspx` render the tenant's site on a **glossy light executive theme** (warm-pearl canvas, white glossy cards, gradient-gold accents, frosted nav, deep-navy footer). Accent colours are **per-tenant** (Admin → Settings). Public pages: home, `LUM_Course`, `LUM_Book`, `LUM_Freebies`, plus `privacy.html` / `terms.html`. Clean tenant URLs via root redirect folders (e.g. `/RamJaladurgam`, `/ShreansDaga`).

---

## 14. Mobile apps

| App | Stack | Location |
|---|---|---|
| PWA / hybrid | Capacitor SPA | `Luminary/app/` |
| Native Android | Kotlin, Compose, Media3, Retrofit, FCM, Razorpay | `LuminaryAndroid/` |
| Native iOS | SwiftUI, AVKit, URLSession, APNs, razorpay-pod | `LuminaryiOS/` |

Both consume the live JSON APIs, play video in-app, run native Razorpay checkout, and register push tokens. App id `com.archanainfo.luminary`. Store kit + assets in `LuminaryAssets/` (`STORE_SUBMISSION.md`, `png/`).

---

## 15. Security & audit

- **TOTP 2FA** for super-admin (authenticator app; opt-in; only activates after a confirmed code so it can't lock you out).
- **Audit log** records logins, impersonation, feature-flag changes, content deletes, payments, automation runs, 2FA & token changes — filterable + CSV export (super), plus a tenant-scoped **own activity log** for admins. Configurable retention with auto-purge.
- **Impersonation** is super-only, fully restorable, and shows a banner while active.

---

## 16. Deployment & go-live

- **Host:** FTP to the site root; app under `/Luminary`, shared code under `/App_Code`.
- **Process:** compile-verify `App_Code` + `.ashx` (`vbc`) → FTP → verify live over HTTPS with authenticated sessions. Page code-behind compiles at runtime.
- **New tables** self-provision on first use — no migration step for the automation/audit/referral/2FA/lead-magnet features.
- **Secrets** live in `LUM_Settings` (per tenant) + `web.config` (server) — never in code.
- **Go-live checklist:** [GOLIVE.md](GOLIVE.md) — payments→live keys, integrations test, scheduler cron, 2FA, data hygiene, mobile/store, final smoke.

---

## 17. White-labelling a new tenant

1. Super → **Clients/Tenants** → create (name, slug, theme colours, admin email + password). (Verified live with a second tenant.)
2. Optionally add a clean root redirect folder `/<Name>/` → `LUM_Home.aspx?s=<slug>`.
3. New admin signs in, sets profile/theme/photo, adds content.
4. Toggle modules per tenant in **Feature Flags**.
5. Point the apps at the slug (or run a branded build).

---

## 18. File map

```
Luminary/
├─ Default.aspx                 Company marketing site
├─ LUM_Master.master(.vb)       Public tenant master (glossy light)
├─ LUM_Home / LUM_Course / LUM_Book / LUM_Freebies   Public pages
├─ LUM_AppMaster.master         Admin shell (⌘K, Lumina, dark mode)
├─ LUM_*.aspx                   Admin console (see §7)
├─ Member/                      Member portal + LUM_MemberMaster (Spark, gamification)
├─ Admin/                       Super-admin control center (see §9)
├─ api/LUM_*.ashx               JSON API (see §6)
├─ app/                         PWA / Capacitor
├─ Database/LUM_*.sql           Schema + seed
├─ privacy.html · terms.html · GOLIVE.md · DOCUMENTATION.md · docs.html

App_Code/LUM_*.vb               Shared helpers (see §5)
LuminaryAndroid/ · LuminaryiOS/ Native apps
LuminaryAssets/                 Store assets, PNGs, STORE_SUBMISSION.md
```

---

© 2026 Archana Info Solutions · Luminary AI · For internal & client use.
