# harikrishnaraj/lernoviq-lms architecture

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

- Interactive diagram: https://gitdiagram.com/harikrishnaraj/lernoviq-lms
- Repository: https://github.com/harikrishnaraj/lernoviq-lms

## Overview

LERNOVIQ is a multi-role learning platform with learner, instructor, and administrator portals. A learner discovers a course, enrolls, studies lessons, completes assessments, and can earn a certificate; instructors author and review courses and grade work, while administrators manage users, organizations, and platform operations. The graph includes the shared Supabase-backed data layer and documented SCORM, API, reporting, and privacy branches. Sampled excerpts show selected calls; dashed edges mark plausible subsystem relationships whose wiring was not shown.

Main entry points: [`src/app/admin`](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/app/admin) (Admin portal), [`src/app/learner`](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/app/learner) (Learner portal), [`src/lib/supabase/server.ts`](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/lib/supabase/server.ts) (Supabase data), [`src/app/instructor`](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/app/instructor) (Instructor portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["User portals"]
  node_learner["Learner portal"]
  node_instructor["Instructor portal"]
  node_admin["Admin portal"]
  node_auth["Authentication<br/>[route.ts]"]
end

subgraph group_learning["Learning lifecycle"]
  node_catalog["Course catalog"]
  node_enrollment["Enrollment"]
  node_authoring["Course authoring"]
  node_player["Lesson player"]
  node_assessment["Assessment attempts<br/>[server.ts]"]
  node_completion["Completion"]
  node_certificates["Certificates"]
  node_engagement["Learner engagement"]
  node_reviews["Course reviews<br/>[reviews.ts]"]
end

subgraph group_operations["Platform operations"]
  node_organizations["Organizations and SSO"]
  node_adminops["Admin operations"]
  node_analytics["Analytics and reports<br/>[analytics.ts]"]
  node_privacy["Privacy export<br/>[account.ts]"]
  node_scorm["SCORM delivery<br/>[route.ts]"]
  node_publicapi["Versioned API<br/>[route.ts]"]
end

subgraph group_foundation["Shared services"]
  node_supabase[("Supabase data<br/>[server.ts]")]
  node_privileged[("Privileged data access<br/>[admin.ts]")]
  node_audit["Audit logging<br/>[index.ts]"]
  node_ratelimit["Rate limiting<br/>[index.ts]"]
end

node_externaluser(("Users"))

node_externaluser -->|"signs in"| node_auth
node_auth -->|"exchanges code"| node_supabase
node_auth -->|"joins via SSO"| node_organizations
node_externaluser -->|"uses portal"| node_learner
node_externaluser -->|"uses portal"| node_instructor
node_externaluser -->|"uses portal"| node_admin
node_learner -.->|"browses courses"| node_catalog
node_catalog -.->|"enrolls"| node_enrollment
node_instructor -.->|"authors courses"| node_authoring
node_learner -.->|"studies lessons"| node_player
node_player -.->|"starts assessments"| node_assessment
node_assessment -->|"evaluates completion"| node_completion
node_completion -.->|"may issue"| node_certificates
node_learner -.->|"participates"| node_engagement
node_admin -.->|"manages platform"| node_adminops
node_admin -.->|"manages organizations"| node_organizations
node_admin -.->|"views reports"| node_analytics
node_instructor -.->|"views analytics"| node_analytics
node_externaluser -->|"requests export"| node_privacy
node_privacy -->|"reads account data"| node_supabase
node_privacy -->|"records export"| node_audit
node_admin -->|"exports audit log"| node_audit
node_admin -->|"limits exports"| node_ratelimit
node_scorm -->|"uses service role"| node_privileged
node_scorm -->|"uses storage"| node_supabase
node_publicapi -->|"uses service role"| node_privileged
node_publicapi -->|"checks API limits"| node_ratelimit
node_learner -.->|"reviews courses"| node_reviews
node_reviews -->|"loads reviews"| node_supabase
node_supabase -.->|"backs server access"| node_privileged

click node_learner "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/app/learner"
click node_instructor "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/app/instructor"
click node_admin "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/app/admin"
click node_auth "https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/app/auth/callback/route.ts"
click node_catalog "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/catalog"
click node_enrollment "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/enrollment"
click node_authoring "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/course-authoring"
click node_player "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/player"
click node_assessment "https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/features/assessments/server.ts"
click node_completion "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/completion"
click node_certificates "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/certificates"
click node_engagement "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/discussions"
click node_organizations "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/organizations"
click node_adminops "https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/admin"
click node_analytics "https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/features/admin/analytics.ts"
click node_privacy "https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/features/privacy/account.ts"
click node_scorm "https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/app/api/scorm/%5BlessonId%5D/%5B...path%5D/route.ts"
click node_publicapi "https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/app/api/v1/courses/route.ts"
click node_reviews "https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/features/reviews/reviews.ts"
click node_supabase "https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/lib/supabase/server.ts"
click node_privileged "https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/services/supabase/admin.ts"
click node_audit "https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/services/audit/index.ts"
click node_ratelimit "https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/services/rate-limit/index.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_learner,node_instructor,node_admin,node_auth,node_externaluser toneBlue
class node_catalog,node_enrollment,node_authoring,node_player,node_assessment,node_completion,node_certificates,node_engagement,node_reviews toneAmber
class node_organizations,node_adminops,node_analytics,node_privacy,node_scorm,node_publicapi toneMint
class node_supabase,node_privileged,node_audit,node_ratelimit toneRose
```

## Components

### User portals

- [Learner portal](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/app/learner): `src/app/learner`
- [Instructor portal](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/app/instructor): `src/app/instructor`
- [Admin portal](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/app/admin): `src/app/admin`
- [Authentication](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/app/auth/callback/route.ts): `src/app/auth/callback/route.ts`

### Learning lifecycle

- [Course catalog](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/catalog): `src/features/catalog`
- [Enrollment](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/enrollment): `src/features/enrollment`
- [Course authoring](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/course-authoring): `src/features/course-authoring`
- [Lesson player](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/player): `src/features/player`
- [Assessment attempts](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/features/assessments/server.ts): `src/features/assessments/server.ts`
- [Completion](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/completion): `src/features/completion`
- [Certificates](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/certificates): `src/features/certificates`
- [Learner engagement](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/discussions): `src/features/discussions`
- [Course reviews](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/features/reviews/reviews.ts): `src/features/reviews/reviews.ts`

### Platform operations

- [Organizations and SSO](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/organizations): `src/features/organizations`
- [Admin operations](https://github.com/harikrishnaraj/lernoviq-lms/tree/main/src/features/admin): `src/features/admin`
- [Analytics and reports](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/features/admin/analytics.ts): `src/features/admin/analytics.ts`
- [Privacy export](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/features/privacy/account.ts): `src/features/privacy/account.ts`
- [SCORM delivery](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/app/api/scorm/%5BlessonId%5D/%5B...path%5D/route.ts): `src/app/api/scorm/[lessonId]/[...path]/route.ts`
- [Versioned API](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/app/api/v1/courses/route.ts): `src/app/api/v1/courses/route.ts`

### Shared services

- [Supabase data](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- [Privileged data access](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/services/supabase/admin.ts): `src/services/supabase/admin.ts`
- [Audit logging](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/services/audit/index.ts): `src/services/audit/index.ts`
- [Rate limiting](https://github.com/harikrishnaraj/lernoviq-lms/blob/main/src/services/rate-limit/index.ts): `src/services/rate-limit/index.ts`

### Other components

- **Users**

## Connections

- Users → Authentication: signs in (evidence: `src/app/auth/callback/route.ts`)
- Authentication → Supabase data: exchanges code (evidence: `src/app/auth/callback/route.ts`)
- Authentication → Organizations and SSO: joins via SSO (evidence: `src/app/auth/callback/route.ts`)
- Users → Learner portal: uses portal (evidence: `README.md`)
- Users → Instructor portal: uses portal (evidence: `README.md`)
- Users → Admin portal: uses portal (evidence: `README.md`)
- Learner portal → Course catalog: browses courses
- Course catalog → Enrollment: enrolls
- Instructor portal → Course authoring: authors courses
- Learner portal → Lesson player: studies lessons
- Lesson player → Assessment attempts: starts assessments
- Assessment attempts → Completion: evaluates completion (evidence: `src/features/assessments/server.ts`)
- Completion → Certificates: may issue
- Learner portal → Learner engagement: participates
- Admin portal → Admin operations: manages platform (evidence: `src/app/admin/audit/export/route.ts`)
- Admin portal → Organizations and SSO: manages organizations
- Admin portal → Analytics and reports: views reports
- Instructor portal → Analytics and reports: views analytics
- Users → Privacy export: requests export
- Privacy export → Supabase data: reads account data (evidence: `src/app/privacy/export/route.ts`)
- Privacy export → Audit logging: records export (evidence: `src/app/privacy/export/route.ts`)
- Admin portal → Audit logging: exports audit log (evidence: `src/app/admin/audit/export/route.ts`)
- Admin portal → Rate limiting: limits exports (evidence: `src/app/admin/audit/export/route.ts`)
- SCORM delivery → Privileged data access: uses service role (evidence: `src/app/api/scorm/[lessonId]/[...path]/route.ts`)
- SCORM delivery → Supabase data: uses storage (evidence: `src/app/api/scorm/[lessonId]/[...path]/route.ts`)
- Versioned API → Privileged data access: uses service role (evidence: `src/app/api/v1/courses/route.ts`)
- Versioned API → Rate limiting: checks API limits
- Learner portal → Course reviews: reviews courses
- Course reviews → Supabase data: loads reviews (evidence: `src/features/reviews/reviews.ts`)
- Supabase data → Privileged data access: backs server access
