# phonetic1018/lms-platform architecture

> Architecture diagram of the GitHub repository phonetic1018/lms-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/phonetic1018/lms-platform
- Repository: https://github.com/phonetic1018/lms-platform
- Video tour (about a minute): https://gitdiagram.com/phonetic1018/lms-platform/video

## Overview

This repository is a Next.js education and training platform, with learner and instructor experiences alongside administrative operations. The learner workflow spans enrollment and program content, practice or scheduled quizzes, and results; other major product areas include live quizzes, events, game-based aptitude activities, and subscription or event payments. Admin pages manage learning operations, finance, and site settings. Sampled code supports concrete payment, consent, and game-session interactions; the README offers no product-specific architecture detail, so several route-level connections are intentionally left unspecified.

Main entry points: [`src/lib/supabase/admin.ts`](https://github.com/phonetic1018/lms-platform/blob/main/src/lib/supabase/admin.ts) (Supabase data store), [`src/app/api/razorpay/plan/order/route.ts`](https://github.com/phonetic1018/lms-platform/blob/main/src/app/api/razorpay/plan/order/route.ts) (Plan order API), [`src/app/api/razorpay/payments/verify/route.ts`](https://github.com/phonetic1018/lms-platform/blob/main/src/app/api/razorpay/payments/verify/route.ts) (Payment verification), [`src/app/api/razorpay/refund/route.ts`](https://github.com/phonetic1018/lms-platform/blob/main/src/app/api/razorpay/refund/route.ts) (Refund handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning and quizzes"]
  node_programs["Program content<br/>[page.tsx]"]
  node_practice["Practice quizzes<br/>[page.tsx]"]
  node_quiz["Scheduled quizzes<br/>[page.tsx]"]
  node_results["Quiz results<br/>[page.tsx]"]
end

subgraph group_operations["Teaching operations"]
  node_instructor_ops["Batch teaching<br/>[page.tsx]"]
  node_admin_ops["Learning administration<br/>[page.tsx]"]
  node_live_quiz["Live quizzes<br/>[page.tsx]"]
end

subgraph group_commerce["Payments and plans"]
  node_checkout["Payment checkout"]
  node_order_api["Plan order API<br/>[route.ts]"]
  node_payment_verify["Payment verification<br/>[route.ts]"]
  node_refund["Refund handling<br/>[route.ts]"]
  node_plans["Plan management<br/>[page.tsx]"]
end

subgraph group_engagement["Events and games"]
  node_events["Events<br/>[page.tsx]"]
  node_game_zone["Aptitude games<br/>[page.tsx]"]
  node_game_session["Game session hook<br/>[useGameSession.ts]"]
  node_game_actions["Game tracking actions<br/>[actions.ts]"]
end

subgraph group_platform["Platform services"]
  node_consent_api["Consent API<br/>[route.ts]"]
  node_supabase[("Supabase data store<br/>[admin.ts]")]
end

node_learner(("Learner"))
node_instructor(("Instructor"))
node_admin(("Administrator"))
node_razorpay["Razorpay"]

node_learner -->|"opens content"| node_programs
node_learner -->|"starts practice"| node_practice
node_learner -->|"takes quiz"| node_quiz
node_practice -->|"views results"| node_results
node_instructor -->|"manages batches"| node_instructor_ops
node_admin -->|"manages programs"| node_admin_ops
node_learner -->|"joins quiz"| node_live_quiz
node_learner -->|"starts payment"| node_checkout
node_checkout -->|"requests order"| node_order_api
node_order_api -->|"reads and writes"| node_supabase
node_order_api -->|"creates order"| node_razorpay
node_razorpay -->|"returns payment"| node_payment_verify
node_payment_verify -->|"verifies signature"| node_razorpay
node_payment_verify -->|"provisions records"| node_supabase
node_admin -->|"requests refund"| node_refund
node_refund -->|"issues refund"| node_razorpay
node_refund -->|"updates records"| node_supabase
node_admin -->|"manages plans"| node_plans
node_learner -->|"browses events"| node_events
node_learner -->|"plays games"| node_game_zone
node_game_zone -->|"tracks session"| node_game_session
node_game_session -->|"loads and submits"| node_game_actions
node_game_actions -->|"persists results"| node_supabase
node_learner -->|"records consent"| node_consent_api
node_consent_api -->|"reads and writes logs"| node_supabase

click node_programs "https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/student/content/programs/page.tsx"
click node_practice "https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/student/practice/page.tsx"
click node_quiz "https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/student/(Quiz-Pages)/quizzes/page.tsx"
click node_results "https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/student/quiz/%5BquizId%5D/results/page.tsx"
click node_instructor_ops "https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/instructor/my-batches/page.tsx"
click node_admin_ops "https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/admin/(programs)/programs/page.tsx"
click node_live_quiz "https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/student/(LiveQuiz-Pages)/live-quizzes/page.tsx"
click node_checkout "https://github.com/phonetic1018/lms-platform/blob/main/src/components/payment/PaymentCheckoutClient.tsx"
click node_order_api "https://github.com/phonetic1018/lms-platform/blob/main/src/app/api/razorpay/plan/order/route.ts"
click node_payment_verify "https://github.com/phonetic1018/lms-platform/blob/main/src/app/api/razorpay/payments/verify/route.ts"
click node_refund "https://github.com/phonetic1018/lms-platform/blob/main/src/app/api/razorpay/refund/route.ts"
click node_plans "https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/admin/subscription-plans/page.tsx"
click node_events "https://github.com/phonetic1018/lms-platform/blob/main/src/app/events/%5Bslug%5D/page.tsx"
click node_game_zone "https://github.com/phonetic1018/lms-platform/blob/main/src/app/game-zone/game-based-aptitude/page.tsx"
click node_game_session "https://github.com/phonetic1018/lms-platform/blob/main/src/hooks/useGameSession.ts"
click node_game_actions "https://github.com/phonetic1018/lms-platform/blob/main/src/lib/game-tracking/actions.ts"
click node_consent_api "https://github.com/phonetic1018/lms-platform/blob/main/src/app/api/consent/route.ts"
click node_supabase "https://github.com/phonetic1018/lms-platform/blob/main/src/lib/supabase/admin.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_programs,node_practice,node_quiz,node_results toneBlue
class node_instructor_ops,node_admin_ops,node_live_quiz toneAmber
class node_checkout,node_order_api,node_payment_verify,node_refund,node_plans toneMint
class node_events,node_game_zone,node_game_session,node_game_actions toneRose
class node_consent_api,node_supabase,node_learner,node_instructor,node_admin,node_razorpay toneIndigo
```

## Components

### Learning and quizzes

- [Program content](https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/student/content/programs/page.tsx): `src/app/(dashboard)/dashboard/student/content/programs/page.tsx`
- [Practice quizzes](https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/student/practice/page.tsx): `src/app/(dashboard)/dashboard/student/practice/page.tsx`
- [Scheduled quizzes](https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/student/(Quiz-Pages)/quizzes/page.tsx): `src/app/(dashboard)/dashboard/student/(Quiz-Pages)/quizzes/page.tsx`
- [Quiz results](https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/student/quiz/%5BquizId%5D/results/page.tsx): `src/app/(dashboard)/dashboard/student/quiz/[quizId]/results/page.tsx`

### Teaching operations

- [Batch teaching](https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/instructor/my-batches/page.tsx): `src/app/(dashboard)/dashboard/instructor/my-batches/page.tsx`
- [Learning administration](https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/admin/(programs)/programs/page.tsx): `src/app/(dashboard)/dashboard/admin/(programs)/programs/page.tsx`
- [Live quizzes](https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/student/(LiveQuiz-Pages)/live-quizzes/page.tsx): `src/app/(dashboard)/dashboard/student/(LiveQuiz-Pages)/live-quizzes/page.tsx`

### Payments and plans

- [Payment checkout](https://github.com/phonetic1018/lms-platform/blob/main/src/components/payment/PaymentCheckoutClient.tsx): `src/components/payment/PaymentCheckoutClient.tsx`
- [Plan order API](https://github.com/phonetic1018/lms-platform/blob/main/src/app/api/razorpay/plan/order/route.ts): `src/app/api/razorpay/plan/order/route.ts`
- [Payment verification](https://github.com/phonetic1018/lms-platform/blob/main/src/app/api/razorpay/payments/verify/route.ts): `src/app/api/razorpay/payments/verify/route.ts`
- [Refund handling](https://github.com/phonetic1018/lms-platform/blob/main/src/app/api/razorpay/refund/route.ts): `src/app/api/razorpay/refund/route.ts`
- [Plan management](https://github.com/phonetic1018/lms-platform/blob/main/src/app/(dashboard)/dashboard/admin/subscription-plans/page.tsx): `src/app/(dashboard)/dashboard/admin/subscription-plans/page.tsx`

### Events and games

- [Events](https://github.com/phonetic1018/lms-platform/blob/main/src/app/events/%5Bslug%5D/page.tsx): `src/app/events/[slug]/page.tsx`
- [Aptitude games](https://github.com/phonetic1018/lms-platform/blob/main/src/app/game-zone/game-based-aptitude/page.tsx): `src/app/game-zone/game-based-aptitude/page.tsx`
- [Game session hook](https://github.com/phonetic1018/lms-platform/blob/main/src/hooks/useGameSession.ts): `src/hooks/useGameSession.ts`
- [Game tracking actions](https://github.com/phonetic1018/lms-platform/blob/main/src/lib/game-tracking/actions.ts): `src/lib/game-tracking/actions.ts`

### Platform services

- [Consent API](https://github.com/phonetic1018/lms-platform/blob/main/src/app/api/consent/route.ts): `src/app/api/consent/route.ts`
- [Supabase data store](https://github.com/phonetic1018/lms-platform/blob/main/src/lib/supabase/admin.ts): `src/lib/supabase/admin.ts`

### Other components

- **Learner**
- **Instructor**
- **Administrator**
- **Razorpay**

## Connections

- Learner → Program content: opens content
- Learner → Practice quizzes: starts practice
- Learner → Scheduled quizzes: takes quiz
- Practice quizzes → Quiz results: views results
- Instructor → Batch teaching: manages batches
- Administrator → Learning administration: manages programs
- Learner → Live quizzes: joins quiz
- Learner → Payment checkout: starts payment
- Payment checkout → Plan order API: requests order
- Plan order API → Supabase data store: reads and writes
- Plan order API → Razorpay: creates order
- Razorpay → Payment verification: returns payment
- Payment verification → Razorpay: verifies signature
- Payment verification → Supabase data store: provisions records
- Administrator → Refund handling: requests refund
- Refund handling → Razorpay: issues refund
- Refund handling → Supabase data store: updates records
- Administrator → Plan management: manages plans
- Learner → Events: browses events
- Learner → Aptitude games: plays games
- Aptitude games → Game session hook: tracks session
- Game session hook → Game tracking actions: loads and submits
- Game tracking actions → Supabase data store: persists results
- Learner → Consent API: records consent
- Consent API → Supabase data store: reads and writes logs
