Internal Documentation

Website Guide

Languages Academy — Features, Portals, Flows & Testing

🌐 Live: https://languagesacademy.co.in📅 Generated: September 2026
0

Table of Contents

1Public Website Pages
2Lead Capture & Pre-Payment Flow
3Demo Class Payment Flow
4Course Enrolment Payment Flow
5Booking & Scheduling Flow
6Student Portal (LMS)
7Admin Portal
8Instructor Portal
9Notifications & Emails
10Invoicing & GST
11Test Accounts
12End-to-End Testing Guide
13Admin Workflows Reference
14Known Configurations & Flags
1

Public Website Pages

URLPageDescription
/HomepageHero, stats, course overview, Google Reviews (10 reviews, 5★), FAQ, CTA sections. AggregateRating + FAQ + BreadcrumbList JSON-LD.
/coursesCoursesTabbed layout: Group Classes · 1-on-1 Classes · Packages · Custom. Dynamic CAD prices via Frankfurter API. Lead capture modal on every Enrol/Book button.
/aboutAboutFounder (Priya Sharma) + Academic Director (Ravi Mehta) profiles, academy story, values, accreditations.
/contactContactContact form (→ email + WhatsApp), hours (Mon–Sun, 24 hrs), location, social links.
/blogBlog IndexArticle listing with featured images. 3 published posts.
/blog/[slug]Blog PostIndividual article pages with SEO metadata.
/booking/scheduleBooking SchedulerToken-gated slot picker (14 IST slots, 30 days). Accessible only after payment. noindex.
/privacyPrivacy Policy13-section GDPR-compliant policy. noindex.
/termsTerms of Service12-section terms. noindex.
/docs/tech-stackTech Stack DocsThis documentation (internal). noindex.
/docs/website-guideWebsite GuideThis page (internal). noindex.
2

Lead Capture & Pre-Payment Flow

Every "Book Demo" and "Enrol Now" button on the Courses page opens the Lead Capture Modal before any payment is initiated. This ensures contact details are saved even if the student abandons checkout.

1
Student clicks "Book Demo" or "Enrol Now" — LeadCaptureModal opens with course title + amount pre-filled
2
Student fills form — Full name, email, phone (country code + number), city, referral source, consent checkbox
3
Form auto-saves to sessionStorage — Prevents data loss if browser refreshes mid-form
4
POST /api/leads — Lead record created in DB with status = "pending"; returns lead ID
5
Modal closes → Razorpay opens — Lead ID passed to checkout flow; Razorpay order created
6
On payment success — Lead status updated to "paid"; razorpayOrderId + razorpayPaymentId linked
7
On payment failure/abandon — Lead remains with status = "pending" or "failed" — visible in Admin → Leads
Admin action: Leads with status "paid" can be converted to LMS accounts from /lms/admin/leads using the "Convert to Account" button.
3

Demo Class Payment Flow (₹749)

1
"Book Demo Class" button clicked — LeadCaptureModal opens (recordType = DEMO, amount = ₹749)
2
Lead saved → POST /api/razorpay/demo-order — Razorpay order created for ₹749 (74,900 paise); order ID returned
3
Razorpay checkout opens — Student enters card/UPI/netbanking details
4
Payment success → POST /api/razorpay/demo-verify — HMAC-SHA256 signature verified; invoice created; booking token generated
5
Invoice generated — Sequential invoice number; HTML invoice with 18% GST breakdown; saved to /shared-storage/public/assets/invoices/
6
Email sent to student — Invoice attached; booking link included: /booking/schedule?token=<token>
7
WhatsApp alert to admin — Payment amount, student name, course title via CallMeBot
8
Student redirected to /checkout/demo-success — Booking link shown; instructions to schedule slot
4

Course Enrolment Payment Flow

1
"Enrol Now" button clicked on any course — LeadCaptureModal opens (recordType = ENROLMENT, amount = course price in INR)
2
Lead saved → POST /api/razorpay/course-order — Razorpay order created for course amount; searches all 5 course collections for correct price
3
Razorpay checkout opens — Student completes payment
4
Payment success → POST /api/razorpay/course-verify — HMAC verified; invoice created; LMS account auto-created (or linked if exists)
5
LMS account created — BetterAuth user created with role = "student"; random password generated; credentials emailed
6
Invoice + welcome email sent — Invoice with GST breakdown; login credentials; portal link
7
Admin WhatsApp alert — Enrolment details sent to admin phone
8
Student redirected to /checkout/course-success — Login instructions shown; portal link provided
Note: Course prices are sourced from src/content/pages/courses.json. The checkout searches all 5 collections: individual_courses, one_on_one_courses, one_on_one_packages, packages, custom_packages.
5

Booking & Scheduling Flow

1
Student receives booking link via email — URL: /booking/schedule?token=<64-char-token>
2
Token validated → GET /api/bookings/schedule — Returns available slots (14 per day, 30 days ahead, IST timezone)
3
Student selects date + time slot — Calendar picker shows next 30 days; 14 IST time slots (e.g. 9:00 AM – 9:00 PM)
4
POST /api/bookings/schedule — Slot confirmed; Google Calendar event created; Meet link generated
5
Confirmation emails sent — Student email: date, time, Meet link. Trainer email: same details.
6
WhatsApp notification — Admin + trainer notified via CallMeBot
7
Booking record updated — DB: status = "scheduled", meetLink, scheduledDate, scheduledTime saved
Prerequisite: Google Calendar OAuth must be connected at /lms/admin/google-auth for Meet links to be auto-generated. Without it, booking confirmation still works but no Meet link is created.
6

Student Portal (LMS)

Accessible at /lms/login after receiving credentials via email.

URLPageDescription
/lms/dashboardDashboardOverview: enrolled courses, upcoming classes, attendance %, recent announcements
/lms/classesMy ClassesList of all scheduled classes with date, time, Meet link, status
/lms/scheduleScheduleCalendar view of upcoming and past classes
/lms/attendanceAttendancePer-class attendance record (Present / Absent / Late)
/lms/performancePerformanceAssessment scores by skill: Reading, Writing, Listening, Speaking, Overall
/lms/progressProgressVisual progress tracker across CEFR levels (A1 → B2)
/lms/recordingsRecordingsClass recording links (uploaded by admin/instructor)
/lms/announcementsAnnouncementsGlobal and course-specific announcements from admin
/lms/vocabularyVocabulary NotebookPersonal vocabulary list; add/edit/delete entries
/lms/resourcesResource LibraryStudy materials, PDFs, links uploaded by admin
7

Admin Portal

Accessible at /lms/admin — requires admin or super_admin role.

URLPageDescription
/lms/adminDashboardStats: total students, active enrolments, revenue, recent payments
/lms/admin/studentsStudentsFull student list; view profile, enrolments, attendance
/lms/admin/classesClassesCreate, edit, cancel classes; assign to courses; add Meet links
/lms/admin/attendanceAttendanceMark attendance per class; bulk mark entire class
/lms/admin/performancePerformanceAdd/edit assessment scores for any student
/lms/admin/recordingsRecordingsUpload recording links; toggle visibility
/lms/admin/announcementsAnnouncementsCreate global or course-specific announcements
/lms/admin/leadsLeadsPaginated leads table; DEMO/ENROLMENT badges; status filter; Convert to Account modal
/lms/admin/paymentsPayments AuditFull payment audit log: all checkout + webhook events
/lms/admin/environmentEnvironmentToggle Razorpay Live ↔ Test mode; view current mode
/lms/admin/google-authGoogle AuthConnect Google Calendar OAuth for Meet link generation
/lms/admin/teamTeamManage admin and instructor accounts (super_admin only)
/lms/admin/dbDB BrowserView and edit raw database rows (super_admin only)
8

Instructor Portal

Accessible at /lms/instructor — requires admin role (instructors share the admin role).

URLPageDescription
/lms/instructorDashboardOverview of assigned classes, upcoming sessions, student count
/lms/instructor/classesMy ClassesView all classes; update status (scheduled/completed/cancelled)
/lms/instructor/studentsStudentsView enrolled students for assigned courses
/lms/instructor/attendanceAttendanceMark attendance for own classes
/lms/instructor/recordingsRecordingsUpload recording links for completed classes
/lms/instructor/announcementsAnnouncementsPost announcements to assigned courses
/lms/instructor/scheduleScheduleCalendar view of upcoming classes
9

Notifications & Emails

TriggerRecipientChannelContent
Demo payment successStudentEmailInvoice (HTML) + booking link
Demo payment successAdminWhatsAppStudent name, amount, course via CallMeBot
Course payment successStudentEmailInvoice + LMS login credentials + portal link
Course payment successAdminWhatsAppEnrolment details
Booking confirmedStudentEmailDate, time, Google Meet link
Booking confirmedTrainerEmail + WhatsAppSession details + Meet link
Contact form submittedAdminEmail + WhatsAppForm contents forwarded
Lead converted to accountStudentEmailLogin credentials (email + password)
10

Invoicing & GST

Every successful payment generates a sequential, GST-compliant HTML invoice automatically.

ItemDetail
Invoice numberSequential (DB auto-increment via invoice_sequence table) — never reused, never skipped
GST rate18% inclusive (CGST 9% + SGST 9%) for Indian customers
GSTIN06AJNPT3740Q1ZE — printed on every invoice
GST calculationBase = Total ÷ 1.18 · GST = Total − Base (rounded to paise)
InternationalGST = ₹0 for non-Indian payments (currency detection)
Storage/shared-storage/public/assets/invoices/invoice-<number>.html
Email deliveryInvoice HTML attached to confirmation email on every payment
Test modeInvoices generated in test mode carry a "TEST" watermark badge
11

Test Accounts (Seeded)

Student

student@test.la

TestStudent@2026

Portal: /lms/dashboard

Instructor

instructor@test.la

TestInstructor@2026

Portal: /lms/instructor

Admin

admin@test.la

TestAdmin@2026

Portal: /lms/admin

⚠️ Important: These accounts are for testing only. Do not use them in production.
Seed script: npx tsx src/server/scripts/seed-test-accounts.ts
12

End-to-End Testing Guide

12.1 Automated E2E Test Suite

Run the full suite (39 tests) with:

npx tsx src/server/scripts/e2e-test.ts

Tests cover: DB connectivity, all 6 tables, 7 secrets, Razorpay mode, invoice create/file/HTML/DB, GST calculation, HMAC signing, audit log idempotency, invoice sequence atomicity.

12.2 Manual Payment Testing (Razorpay Test Mode)

1
Switch to Test mode — Go to /lms/admin/environment → click "Switch to Test Mode"
2
Verify mode — Page shows "TEST MODE ACTIVE" badge; API uses RAZORPAY_TEST_KEY_ID
3
Go to /courses — Click any "Enrol Now" or "Book Demo Class" button
4
Fill lead form — Use any name/email/phone; submit
5
Razorpay test checkout opens — Use test card: 4111 1111 1111 1111, any future expiry, any CVV
6
Complete payment — Razorpay processes in test mode — no real charge
7
Verify invoice created — Check /lms/admin/payments for audit log entry
8
Verify email sent — Check PAYMENT_ALERT_EMAIL inbox for invoice
9
Switch back to Live mode — /lms/admin/environment → "Switch to Live Mode"

12.3 Razorpay Test Card Numbers

Card TypeNumberExpiryCVV
Visa (success)4111 1111 1111 1111Any future dateAny 3 digits
Mastercard (success)5267 3181 8797 5449Any future dateAny 3 digits
Rupay (success)6076 0000 0000 0002Any future dateAny 3 digits
Card (failure)4000 0000 0000 0002Any future dateAny 3 digits

12.4 Testing the Booking Flow

1
Complete a demo payment (test mode) — Note the booking token from the success page or email
2
Visit /booking/schedule?token=<token> — Slot picker should load with 14 daily slots
3
Select a date and time — Click "Confirm Booking"
4
Verify Google Calendar event created — Check admin Google Calendar for the event + Meet link
5
Verify confirmation emails — Student + trainer should receive emails with Meet link
6
Check DB — /lms/admin/db → bookings table → verify status = "scheduled"

12.5 Testing Lead Conversion

1
Complete a course payment (test mode) — Lead created with status = "paid"
2
Go to /lms/admin/leads — Find the lead; it should show ENROLMENT badge + "paid" status
3
Click "Convert to Account" — Modal opens; confirm email address
4
Submit conversion — BetterAuth user created; credentials emailed to student
5
Login as student — Use credentials from email at /lms/login
6
Verify portal access — Student should see dashboard with enrolled course

12.6 Webhook Testing

# Test HMAC signature locally
npx tsx src/server/scripts/e2e-test.ts
# Look for: ✅ Correct HMAC signature computable
# Look for: ✅ Audit log INSERT IGNORE deduplicates

For live webhook testing, configure the Razorpay dashboard to point to https://languagesacademy.co.in/api/razorpay/webhook with the secret matching RAZORPAY_WEBHOOK_SECRET.

13

Admin Workflows Reference

13.1 Adding a New Student Manually

1
Go to /lms/admin/leads — Click "Add Lead" or use the Convert flow
2
Or: /lms/admin/students → "Invite Student" — POST /api/lms/admin/invite — creates BetterAuth user + emails credentials
3
Assign to course — /lms/admin/students → student profile → "Enrol in Course"

13.2 Scheduling a Class

1
Go to /lms/admin/classes — Click "New Class"
2
Fill: course, title, date, time, duration, Meet link — POST /api/lms/classes
3
Students see it in /lms/classes and /lms/schedule — Immediately visible after creation

13.3 Marking Attendance

1
Go to /lms/admin/attendance — Select class from dropdown
2
Mark each student: Present / Absent / Late — Or use "Bulk Mark" to set all at once
3
Save — POST /api/lms/attendance/bulk

13.4 Uploading a Recording

1
Go to /lms/admin/recordings — Click "Add Recording"
2
Select class, enter title + video URL (Google Drive / YouTube) — POST /api/lms/recordings
3
Toggle visibility — isVisible = true makes it appear in student portal

13.5 Posting an Announcement

1
Go to /lms/admin/announcements — Click "New Announcement"
2
Set title, body, target (Global or specific course) — POST /api/lms/announcements
3
Students see it in /lms/announcements — Global announcements visible to all; course-specific to enrolled students only

13.6 Toggling Razorpay Mode

1
Go to /lms/admin/environment — Current mode shown (LIVE / TEST)
2
Click "Switch to Test Mode" or "Switch to Live Mode" — Writes to /private/razorpay-mode.txt
3
Verify — Demo order API returns mode: "test" or "live" in response
14

Configurations & Flags

ConfigLocationNotes
Razorpay mode/private/razorpay-mode.txt"live" or "test". Absence = live (default on first boot).
Super admin emailssrc/server/auth.ts (hardcoded)Only these 2 emails can access /lms/admin/team and DB browser.
GSTINsrc/server/invoice-service.ts06AJNPT3740Q1ZE — update here if GSTIN changes.
GST ratesrc/server/invoice-service.ts18% (0.18) — update for rate changes.
Demo pricesrc/content/pages/courses.json → demo.price_inr₹749 (74,900 paise). Also hardcoded in courses.tsx handleDemoCheckout.
Booking slotssrc/server/api/bookings/schedule/GET.ts14 IST slots; 30-day window. Edit to change available times.
CAD rate cachesrc/server/api/currency/inr-cad/GET.ts1-hour in-memory cache. Restart server to force refresh.
Invoice storage pathsrc/server/invoice-service.ts/shared-storage/public/assets/invoices/
Email sendersrc/server/email.tsAiro email gateway — no SMTP config needed.
WhatsApp numberCALLMEBOT_PHONE_NUMBER secretAdmin phone for all WhatsApp alerts.

Languages Academy — Internal Website Guide

To save as PDF: File → Print → Save as PDF in your browser

https://languagesacademy.co.in/docs/website-guide · September 2026