# yadavsonur/vidyapith architecture

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

- Interactive diagram: https://gitdiagram.com/yadavsonur/vidyapith
- Repository: https://github.com/yadavsonur/vidyapith

## Overview

Vidhyapith is a role-aware LMS. Learners browse published courses, enroll free or pay through Stripe, study lessons and quizzes, track progress, and receive certificates after server-checked completion. Teachers author and publish courses; administrators govern users, content, payments, and moderation. The map combines sampled call references with README-documented capabilities; many unsampled routes are represented by their exact route directories, so their internal call wiring is not inferred.

Main entry points: [`lib/db.js`](https://github.com/yadavsonur/vidyapith/blob/main/lib/db.js) (Prisma application data), [`app/(course)/courses/[courseId]/page.jsx`](https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/page.jsx) (Course overview), [`app/(course)/courses/[courseId]/chapters/[chapterId]/page.jsx`](https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/chapters/%5BchapterId%5D/page.jsx) (Lesson player), [`app/api/webhook/route.js`](https://github.com/yadavsonur/vidyapith/blob/main/app/api/webhook/route.js) (Payment event handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learner experience"]
  node_catalog["Course discovery<br/>[get-courses.js]"]
  node_course["Course overview<br/>[page.jsx]"]
  node_enrollment["Enrollment and checkout<br/>[route.js]"]
  node_lesson["Lesson player<br/>[page.jsx]"]
  node_video["Protected video<br/>[video-player.jsx]"]
  node_quiz["Quiz attempts<br/>[quiz-player.jsx]"]
  node_certificates["Certificates<br/>[route.js]"]
  node_student_tools["Notes and bookmarks<br/>[route.js]"]
  node_community["Reviews and discussions"]
end

subgraph group_authoring["Teaching workspace"]
  node_teacher["Course authoring<br/>[chapters-form.jsx]"]
  node_teacher_analytics["Teacher analytics<br/>[page.jsx]"]
end

subgraph group_governance["Administration"]
  node_admin["Governance and moderation<br/>[page.jsx]"]
  node_admin_routes["Admin APIs"]
end

subgraph group_platform["Application services"]
  node_auth["Identity and access<br/>[auth.js]"]
  node_stripe{{"Stripe payments"}}
  node_webhook["Payment event handling<br/>[route.js]"]
  node_progress["Learning progress<br/>[progress.js]"]
  node_completion["Completion evaluator<br/>[completion.js]"]
  node_notifications["Notifications<br/>[route.js]"]
  node_db[("Prisma application data<br/>[db.js]")]
  node_mux{{"Mux video service"}}
end

node_learner(("Learner"))

node_learner -->|"signs in"| node_auth
node_learner -->|"browses courses"| node_catalog
node_catalog -->|"opens course"| node_course
node_course -.->|"starts enrollment"| node_enrollment
node_enrollment -->|"creates checkout"| node_stripe
node_stripe -->|"sends events"| node_webhook
node_webhook -->|"records purchases"| node_db
node_webhook -->|"creates alerts"| node_notifications
node_course -->|"opens lesson"| node_lesson
node_lesson -->|"renders player"| node_video
node_lesson -->|"signs playback"| node_mux
node_learner -.->|"takes assessment"| node_quiz
node_learner -.->|"uses study tools"| node_student_tools
node_learner -->|"reviews and discusses"| node_community
node_lesson -.->|"updates progress"| node_progress
node_quiz -.->|"supplies results"| node_completion
node_progress -.->|"supplies progress"| node_completion
node_completion -->|"issues credentials"| node_certificates
node_learner -->|"verifies credential"| node_certificates
node_teacher -.->|"manages courses"| node_db
node_teacher -.->|"reviews analytics"| node_teacher_analytics
node_admin -.->|"governs platform"| node_admin_routes
node_admin_routes -.->|"updates records"| node_db
node_auth -->|"loads app user"| node_db
node_course -->|"loads course data"| node_db
node_webhook -->|"deduplicates events"| node_db

click node_auth "https://github.com/yadavsonur/vidyapith/blob/main/lib/auth.js"
click node_catalog "https://github.com/yadavsonur/vidyapith/blob/main/actions/get-courses.js"
click node_course "https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/page.jsx"
click node_enrollment "https://github.com/yadavsonur/vidyapith/blob/main/app/api/courses/%5BcourseId%5D/checkout/route.js"
click node_webhook "https://github.com/yadavsonur/vidyapith/blob/main/app/api/webhook/route.js"
click node_lesson "https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/chapters/%5BchapterId%5D/page.jsx"
click node_video "https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/chapters/%5BchapterId%5D/_components/video-player.jsx"
click node_quiz "https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/quizzes/%5BquizId%5D/_components/quiz-player.jsx"
click node_progress "https://github.com/yadavsonur/vidyapith/blob/main/lib/progress.js"
click node_completion "https://github.com/yadavsonur/vidyapith/blob/main/lib/services/completion.js"
click node_certificates "https://github.com/yadavsonur/vidyapith/blob/main/app/api/certificates/verify/route.js"
click node_student_tools "https://github.com/yadavsonur/vidyapith/blob/main/app/api/courses/%5BcourseId%5D/notes/route.js"
click node_community "https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/_components/discussion-panel.jsx"
click node_notifications "https://github.com/yadavsonur/vidyapith/blob/main/app/api/notifications/route.js"
click node_teacher "https://github.com/yadavsonur/vidyapith/blob/main/app/(dashboard)/(routes)/teacher/courses/%5BcourseId%5D/_components/chapters-form.jsx"
click node_teacher_analytics "https://github.com/yadavsonur/vidyapith/blob/main/app/(dashboard)/(routes)/teacher/analytics/page.jsx"
click node_admin "https://github.com/yadavsonur/vidyapith/blob/main/app/(dashboard)/(routes)/admin/page.jsx"
click node_admin_routes "https://github.com/yadavsonur/vidyapith/tree/main/app/api/admin"
click node_db "https://github.com/yadavsonur/vidyapith/blob/main/lib/db.js"

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_catalog,node_course,node_enrollment,node_lesson,node_video,node_quiz,node_certificates,node_student_tools,node_community toneBlue
class node_teacher,node_teacher_analytics toneAmber
class node_admin,node_admin_routes toneMint
class node_auth,node_stripe,node_webhook,node_progress,node_completion,node_notifications,node_db,node_mux toneRose
class node_learner toneIndigo
```

## Components

### Learner experience

- [Course discovery](https://github.com/yadavsonur/vidyapith/blob/main/actions/get-courses.js): `actions/get-courses.js`
- [Course overview](https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/page.jsx): `app/(course)/courses/[courseId]/page.jsx`
- [Enrollment and checkout](https://github.com/yadavsonur/vidyapith/blob/main/app/api/courses/%5BcourseId%5D/checkout/route.js): `app/api/courses/[courseId]/checkout/route.js`
- [Lesson player](https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/chapters/%5BchapterId%5D/page.jsx): `app/(course)/courses/[courseId]/chapters/[chapterId]/page.jsx`
- [Protected video](https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/chapters/%5BchapterId%5D/_components/video-player.jsx): `app/(course)/courses/[courseId]/chapters/[chapterId]/_components/video-player.jsx`
- [Quiz attempts](https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/quizzes/%5BquizId%5D/_components/quiz-player.jsx): `app/(course)/courses/[courseId]/quizzes/[quizId]/_components/quiz-player.jsx`
- [Certificates](https://github.com/yadavsonur/vidyapith/blob/main/app/api/certificates/verify/route.js): `app/api/certificates/verify/route.js`
- [Notes and bookmarks](https://github.com/yadavsonur/vidyapith/blob/main/app/api/courses/%5BcourseId%5D/notes/route.js): `app/api/courses/[courseId]/notes/route.js`
- [Reviews and discussions](https://github.com/yadavsonur/vidyapith/blob/main/app/(course)/courses/%5BcourseId%5D/_components/discussion-panel.jsx): `app/(course)/courses/[courseId]/_components/discussion-panel.jsx`

### Teaching workspace

- [Course authoring](https://github.com/yadavsonur/vidyapith/blob/main/app/(dashboard)/(routes)/teacher/courses/%5BcourseId%5D/_components/chapters-form.jsx): `app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/chapters-form.jsx`
- [Teacher analytics](https://github.com/yadavsonur/vidyapith/blob/main/app/(dashboard)/(routes)/teacher/analytics/page.jsx): `app/(dashboard)/(routes)/teacher/analytics/page.jsx`

### Administration

- [Governance and moderation](https://github.com/yadavsonur/vidyapith/blob/main/app/(dashboard)/(routes)/admin/page.jsx): `app/(dashboard)/(routes)/admin/page.jsx`
- [Admin APIs](https://github.com/yadavsonur/vidyapith/tree/main/app/api/admin): `app/api/admin`

### Application services

- [Identity and access](https://github.com/yadavsonur/vidyapith/blob/main/lib/auth.js): `lib/auth.js`
- **Stripe payments**
- [Payment event handling](https://github.com/yadavsonur/vidyapith/blob/main/app/api/webhook/route.js): `app/api/webhook/route.js`
- [Learning progress](https://github.com/yadavsonur/vidyapith/blob/main/lib/progress.js): `lib/progress.js`
- [Completion evaluator](https://github.com/yadavsonur/vidyapith/blob/main/lib/services/completion.js): `lib/services/completion.js`
- [Notifications](https://github.com/yadavsonur/vidyapith/blob/main/app/api/notifications/route.js): `app/api/notifications/route.js`
- [Prisma application data](https://github.com/yadavsonur/vidyapith/blob/main/lib/db.js): `lib/db.js`
- **Mux video service**

### Other components

- **Learner**

## Connections

- Learner → Identity and access: signs in
- Learner → Course discovery: browses courses
- Course discovery → Course overview: opens course (evidence: `app/(course)/courses/[courseId]/page.jsx`)
- Course overview → Enrollment and checkout: starts enrollment
- Enrollment and checkout → Stripe payments: creates checkout
- Stripe payments → Payment event handling: sends events
- Payment event handling → Prisma application data: records purchases (evidence: `app/api/webhook/route.js`)
- Payment event handling → Notifications: creates alerts (evidence: `app/api/webhook/route.js`)
- Course overview → Lesson player: opens lesson (evidence: `app/(course)/courses/[courseId]/page.jsx`)
- Lesson player → Protected video: renders player (evidence: `app/(course)/courses/[courseId]/chapters/[chapterId]/page.jsx`)
- Lesson player → Mux video service: signs playback (evidence: `app/(course)/courses/[courseId]/chapters/[chapterId]/page.jsx`)
- Learner → Quiz attempts: takes assessment
- Learner → Notes and bookmarks: uses study tools
- Learner → Reviews and discussions: reviews and discusses
- Lesson player → Learning progress: updates progress
- Quiz attempts → Completion evaluator: supplies results
- Learning progress → Completion evaluator: supplies progress
- Completion evaluator → Certificates: issues credentials
- Learner → Certificates: verifies credential
- Course authoring → Prisma application data: manages courses
- Course authoring → Teacher analytics: reviews analytics
- Governance and moderation → Admin APIs: governs platform
- Admin APIs → Prisma application data: updates records
- Identity and access → Prisma application data: loads app user (evidence: `lib/auth.js`)
- Course overview → Prisma application data: loads course data (evidence: `app/(course)/courses/[courseId]/page.jsx`)
- Payment event handling → Prisma application data: deduplicates events (evidence: `app/api/webhook/route.js`)
