# vao2/study_nation architecture

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

- Interactive diagram: https://gitdiagram.com/vao2/study_nation
- Repository: https://github.com/vao2/study_nation

## Overview

StudyNotion is an EdTech marketplace for instructors to publish courses and students to enroll, learn, and track progress. The principal flow runs from course discovery and details through purchase, enrollment, lesson viewing, and progress updates; instructors also create course structures and inspect dashboard metrics. The graph preserves authentication, reviews, contact, profile, and media/payment integrations. Relationships to unsampled route handlers and some documented capabilities are shown only where the README or indexed references support them; unspecified wiring is omitted.

Main entry points: [`server/routes/Course.js`](https://github.com/vao2/study_nation/blob/main/server/routes/Course.js) (API Routes), [`src/App.jsx`](https://github.com/vao2/study_nation/blob/main/src/App.jsx) (Web App Router), [`src/services/operations/courseDetailsAPI.js`](https://github.com/vao2/study_nation/blob/main/src/services/operations/courseDetailsAPI.js) (Course Operations), [`src/pages/CourseDetails.jsx`](https://github.com/vao2/study_nation/blob/main/src/pages/CourseDetails.jsx) (Catalog and Details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Learner Web App"]
  node_webapp["Web App Router<br/>[App.jsx]"]
  node_coursepages["Catalog and Details<br/>[CourseDetails.jsx]"]
  node_viewing["Lesson Player<br/>[VideoDetails.jsx]"]
  node_instructorui["Instructor Dashboard<br/>[Instructor.jsx]"]
  node_reviewui["Review Slider<br/>[ReviewSlider.jsx]"]
  node_authui["Auth Forms<br/>[SignupForm.jsx]"]
  node_store["Redux State<br/>[index.js]"]
end

subgraph group_course["Course Platform"]
  node_courseapi["Course Operations"]
  node_coursectrl["Course Controllers<br/>[Course.js]"]
  node_structure["Sections and Lessons<br/>[Section.js]"]
  node_progress["Learning Progress<br/>[courseProgress.js]"]
  node_reviews["Ratings and Reviews<br/>[RatingandReview.js]"]
  node_categories["Course Categories<br/>[Category.js]"]
end

subgraph group_identity["Identity and Profiles"]
  node_authctrl["Authentication<br/>[Auth.js]"]
  node_authmw["JWT and Roles<br/>[auth.js]"]
  node_profilectrl["Profile Services<br/>[profile.js]"]
end

subgraph group_commerce["Enrollment and Payments"]
  node_paymentctrl["Payment Workflow<br/>[payments.js]"]
  node_contactctrl["Contact Handling<br/>[ContactUs.js]"]
  node_api["API Routes<br/>[Course.js]"]
end

subgraph group_infra["Persistence and Integrations"]
  node_db[("MongoDB<br/>[database.js]")]
  node_cloudinary["Cloudinary Media<br/>[cloudinary.js]"]
  node_razorpay["Razorpay<br/>[razorpay.js]"]
  node_mailer["Email Sender<br/>[mailSender.js]"]
end

node_learner(("Student"))
node_instructor(("Instructor"))

node_learner -->|"uses"| node_webapp
node_instructor -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_coursepages
node_webapp -->|"routes to"| node_viewing
node_webapp -->|"dispatches through"| node_store
node_coursepages -->|"fetches details"| node_courseapi
node_viewing -.->|"loads lessons"| node_courseapi
node_courseapi -->|"calls API"| node_api
node_reviewui -->|"requests reviews"| node_api
node_api -->|"routes course requests"| node_coursectrl
node_api -->|"routes structure requests"| node_structure
node_api -->|"routes review requests"| node_reviews
node_api -->|"routes progress requests"| node_progress
node_api -->|"routes category requests"| node_categories
node_api -->|"protects endpoints"| node_authmw
node_authui -.->|"authenticates via"| node_authctrl
node_api -->|"routes auth requests"| node_authctrl
node_api -.->|"routes profile requests"| node_profilectrl
node_coursepages -.->|"initiates purchase"| node_paymentctrl
node_paymentctrl -.->|"processes payment"| node_razorpay
node_paymentctrl -.->|"sends confirmation"| node_mailer
node_authctrl -->|"sends account email"| node_mailer
node_coursectrl -->|"uploads course media"| node_cloudinary
node_coursectrl -.->|"reads and writes"| node_db
node_authmw -->|"checks user roles"| node_db
node_reviews -->|"stores and queries reviews"| node_db
node_instructorui -->|"loads dashboard data"| node_courseapi
node_instructor -.->|"manages courses"| node_instructorui
node_learner -.->|"sends contact request"| node_contactctrl

click node_webapp "https://github.com/vao2/study_nation/blob/main/src/App.jsx"
click node_coursepages "https://github.com/vao2/study_nation/blob/main/src/pages/CourseDetails.jsx"
click node_viewing "https://github.com/vao2/study_nation/blob/main/src/components/core/ViewCourse/VideoDetails.jsx"
click node_instructorui "https://github.com/vao2/study_nation/blob/main/src/components/core/Dashboard/Instructor.jsx"
click node_reviewui "https://github.com/vao2/study_nation/blob/main/src/components/Common/ReviewSlider.jsx"
click node_authui "https://github.com/vao2/study_nation/blob/main/src/components/core/Auth/SignupForm.jsx"
click node_courseapi "https://github.com/vao2/study_nation/blob/main/src/services/operations/courseDetailsAPI.js"
click node_coursectrl "https://github.com/vao2/study_nation/blob/main/server/controllers/Course.js"
click node_structure "https://github.com/vao2/study_nation/blob/main/server/controllers/Section.js"
click node_progress "https://github.com/vao2/study_nation/blob/main/server/controllers/courseProgress.js"
click node_reviews "https://github.com/vao2/study_nation/blob/main/server/controllers/RatingandReview.js"
click node_categories "https://github.com/vao2/study_nation/blob/main/server/controllers/Category.js"
click node_authctrl "https://github.com/vao2/study_nation/blob/main/server/controllers/Auth.js"
click node_authmw "https://github.com/vao2/study_nation/blob/main/server/middleware/auth.js"
click node_profilectrl "https://github.com/vao2/study_nation/blob/main/server/controllers/profile.js"
click node_paymentctrl "https://github.com/vao2/study_nation/blob/main/server/controllers/payments.js"
click node_contactctrl "https://github.com/vao2/study_nation/blob/main/server/controllers/ContactUs.js"
click node_api "https://github.com/vao2/study_nation/blob/main/server/routes/Course.js"
click node_db "https://github.com/vao2/study_nation/blob/main/server/config/database.js"
click node_cloudinary "https://github.com/vao2/study_nation/blob/main/server/config/cloudinary.js"
click node_razorpay "https://github.com/vao2/study_nation/blob/main/server/config/razorpay.js"
click node_mailer "https://github.com/vao2/study_nation/blob/main/server/utils/mailSender.js"
click node_store "https://github.com/vao2/study_nation/blob/main/src/reducer/index.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_webapp,node_coursepages,node_viewing,node_instructorui,node_reviewui,node_authui,node_store toneBlue
class node_courseapi,node_coursectrl,node_structure,node_progress,node_reviews,node_categories toneAmber
class node_authctrl,node_authmw,node_profilectrl toneMint
class node_paymentctrl,node_contactctrl,node_api toneRose
class node_db,node_cloudinary,node_razorpay,node_mailer,node_learner,node_instructor toneIndigo
```

## Components

### Learner Web App

- [Web App Router](https://github.com/vao2/study_nation/blob/main/src/App.jsx): `src/App.jsx`
- [Catalog and Details](https://github.com/vao2/study_nation/blob/main/src/pages/CourseDetails.jsx): `src/pages/CourseDetails.jsx`
- [Lesson Player](https://github.com/vao2/study_nation/blob/main/src/components/core/ViewCourse/VideoDetails.jsx): `src/components/core/ViewCourse/VideoDetails.jsx`
- [Instructor Dashboard](https://github.com/vao2/study_nation/blob/main/src/components/core/Dashboard/Instructor.jsx): `src/components/core/Dashboard/Instructor.jsx`
- [Review Slider](https://github.com/vao2/study_nation/blob/main/src/components/Common/ReviewSlider.jsx): `src/components/Common/ReviewSlider.jsx`
- [Auth Forms](https://github.com/vao2/study_nation/blob/main/src/components/core/Auth/SignupForm.jsx): `src/components/core/Auth/SignupForm.jsx`
- [Redux State](https://github.com/vao2/study_nation/blob/main/src/reducer/index.js): `src/reducer/index.js`

### Course Platform

- [Course Operations](https://github.com/vao2/study_nation/blob/main/src/services/operations/courseDetailsAPI.js): `src/services/operations/courseDetailsAPI.js`
- [Course Controllers](https://github.com/vao2/study_nation/blob/main/server/controllers/Course.js): `server/controllers/Course.js`
- [Sections and Lessons](https://github.com/vao2/study_nation/blob/main/server/controllers/Section.js): `server/controllers/Section.js`
- [Learning Progress](https://github.com/vao2/study_nation/blob/main/server/controllers/courseProgress.js): `server/controllers/courseProgress.js`
- [Ratings and Reviews](https://github.com/vao2/study_nation/blob/main/server/controllers/RatingandReview.js): `server/controllers/RatingandReview.js`
- [Course Categories](https://github.com/vao2/study_nation/blob/main/server/controllers/Category.js): `server/controllers/Category.js`

### Identity and Profiles

- [Authentication](https://github.com/vao2/study_nation/blob/main/server/controllers/Auth.js): `server/controllers/Auth.js`
- [JWT and Roles](https://github.com/vao2/study_nation/blob/main/server/middleware/auth.js): `server/middleware/auth.js`
- [Profile Services](https://github.com/vao2/study_nation/blob/main/server/controllers/profile.js): `server/controllers/profile.js`

### Enrollment and Payments

- [Payment Workflow](https://github.com/vao2/study_nation/blob/main/server/controllers/payments.js): `server/controllers/payments.js`
- [Contact Handling](https://github.com/vao2/study_nation/blob/main/server/controllers/ContactUs.js): `server/controllers/ContactUs.js`
- [API Routes](https://github.com/vao2/study_nation/blob/main/server/routes/Course.js): `server/routes/Course.js`

### Persistence and Integrations

- [MongoDB](https://github.com/vao2/study_nation/blob/main/server/config/database.js): `server/config/database.js`
- [Cloudinary Media](https://github.com/vao2/study_nation/blob/main/server/config/cloudinary.js): `server/config/cloudinary.js`
- [Razorpay](https://github.com/vao2/study_nation/blob/main/server/config/razorpay.js): `server/config/razorpay.js`
- [Email Sender](https://github.com/vao2/study_nation/blob/main/server/utils/mailSender.js): `server/utils/mailSender.js`

### Other components

- **Student**
- **Instructor**

## Connections

- Student → Web App Router: uses (evidence: `src/App.jsx`)
- Instructor → Web App Router: uses (evidence: `src/App.jsx`)
- Web App Router → Catalog and Details: routes to (evidence: `src/App.jsx`)
- Web App Router → Lesson Player: routes to (evidence: `src/App.jsx`)
- Web App Router → Redux State: dispatches through (evidence: `src/reducer/index.js`)
- Catalog and Details → Course Operations: fetches details (evidence: `src/pages/CourseDetails.jsx`)
- Lesson Player → Course Operations: loads lessons
- Course Operations → API Routes: calls API
- Review Slider → API Routes: requests reviews (evidence: `src/components/Common/ReviewSlider.jsx`)
- API Routes → Course Controllers: routes course requests (evidence: `server/routes/Course.js`)
- API Routes → Sections and Lessons: routes structure requests (evidence: `server/routes/Course.js`)
- API Routes → Ratings and Reviews: routes review requests (evidence: `server/routes/Course.js`)
- API Routes → Learning Progress: routes progress requests (evidence: `server/routes/Course.js`)
- API Routes → Course Categories: routes category requests (evidence: `server/routes/Course.js`)
- API Routes → JWT and Roles: protects endpoints (evidence: `server/routes/Course.js`)
- Auth Forms → Authentication: authenticates via
- API Routes → Authentication: routes auth requests
- API Routes → Profile Services: routes profile requests
- Catalog and Details → Payment Workflow: initiates purchase
- Payment Workflow → Razorpay: processes payment
- Payment Workflow → Email Sender: sends confirmation
- Authentication → Email Sender: sends account email (evidence: `server/controllers/Auth.js`)
- Course Controllers → Cloudinary Media: uploads course media (evidence: `server/controllers/Course.js`)
- Course Controllers → MongoDB: reads and writes
- JWT and Roles → MongoDB: checks user roles (evidence: `server/middleware/auth.js`)
- Ratings and Reviews → MongoDB: stores and queries reviews (evidence: `server/controllers/RatingandReview.js`)
- Instructor Dashboard → Course Operations: loads dashboard data (evidence: `src/components/core/Dashboard/Instructor.jsx`)
- Instructor → Instructor Dashboard: manages courses
- Student → Contact Handling: sends contact request
