# aakesh2195/new architecture

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

- Interactive diagram: https://gitdiagram.com/aakesh2195/new
- Repository: https://github.com/aakesh2195/new

## Overview

ScholarStack is a React/MongoDB student-management application. Students sign up and log in, browse and enroll in courses, view their profile, and generate and submit course quizzes; administrators manage courses, students, and statistics. Routes and controllers implement the API, with MongoDB-backed models and authentication/role checks. The README documents these capabilities; the quiz controller excerpt confirms QuizAPI integration. Unsampled page and controller details are represented only where the README or source index supports them.

Main entry points: [`backend/server.js`](https://github.com/aakesh2195/new/blob/main/backend/server.js) (Express API), [`backend/controllers/quizController.js`](https://github.com/aakesh2195/new/blob/main/backend/controllers/quizController.js) (Quiz generation and scoring), [`frontend/src/App.jsx`](https://github.com/aakesh2195/new/blob/main/frontend/src/App.jsx) (Role-based app routes), [`frontend/src/api/api.js`](https://github.com/aakesh2195/new/blob/main/frontend/src/api/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Role-based app routes<br/>[App.jsx]"]
  node_authpages["Sign in and signup<br/>[login.jsx]"]
  node_studentpages["Student learning pages<br/>[AllCourses.jsx]"]
  node_quizpage["Course quiz page<br/>[CourseQuiz.jsx]"]
  node_adminpages["Admin management pages<br/>[Courses.jsx]"]
  node_clientapi["API client<br/>[api.js]"]
end

subgraph group_api["API and access"]
  node_server["Express API<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_courseroutes["Course routes<br/>[courseRoutes.js]"]
  node_enrollroutes["Enrollment routes"]
  node_quizroutes["Quiz routes<br/>[quizRoutes.js]"]
  node_studentroutes["Student routes<br/>[studentRoutes.js]"]
  node_adminroutes["Admin routes<br/>[adminRoutes.js]"]
  node_auth["Token authentication<br/>[authMiddleware.js]"]
  node_roles["Role authorization<br/>[roleMiddleware.js]"]
  node_authcontroller["Account access<br/>[authController.js]"]
end

subgraph group_learning["Learning services"]
  node_enrollment["Course enrollment"]
  node_quiz["Quiz generation and scoring<br/>[quizController.js]"]
  node_coursecontroller["Course management"]
  node_studentcontroller["Student management"]
  node_admincontroller["Admin statistics<br/>[adminController.js]"]
end

subgraph group_data["MongoDB data"]
  node_coursemodel[("Course records<br/>[courseModel.js]")]
  node_enrollmentmodel[("Enrollment records<br/>[enrollmentModel.js]")]
  node_usermodel[("User accounts<br/>[userModel.js]")]
  node_quizmodel[("Quiz records<br/>[quizModel.js]")]
  node_attemptmodel[("Quiz attempts")]
end

node_student(("Student"))
node_admin(("Administrator"))
node_quizprovider["QuizAPI"]

node_student -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"routes to"| node_authpages
node_app -->|"routes to"| node_studentpages
node_app -->|"routes to"| node_quizpage
node_app -->|"routes to"| node_adminpages
node_authpages -->|"calls"| node_clientapi
node_studentpages -->|"calls"| node_clientapi
node_quizpage -->|"calls"| node_clientapi
node_adminpages -->|"calls"| node_clientapi
node_clientapi -->|"requests"| node_server
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_courseroutes
node_server -->|"mounts"| node_enrollroutes
node_server -->|"mounts"| node_quizroutes
node_server -->|"mounts"| node_studentroutes
node_server -->|"mounts"| node_adminroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_courseroutes -->|"dispatches"| node_coursecontroller
node_enrollroutes -->|"dispatches"| node_enrollment
node_quizroutes -->|"dispatches"| node_quiz
node_studentroutes -->|"dispatches"| node_studentcontroller
node_adminroutes -->|"dispatches"| node_admincontroller
node_enrollroutes -->|"checks token"| node_auth
node_enrollroutes -->|"checks role"| node_roles
node_studentroutes -->|"checks token"| node_auth
node_studentroutes -->|"checks role"| node_roles
node_auth -->|"loads account"| node_usermodel
node_authcontroller -->|"reads and writes"| node_usermodel
node_enrollment -->|"checks course"| node_coursemodel
node_enrollment -->|"creates and reads"| node_enrollmentmodel
node_coursecontroller -->|"manages"| node_coursemodel
node_studentcontroller -->|"manages"| node_usermodel
node_admincontroller -->|"reads"| node_usermodel
node_admincontroller -->|"reads"| node_coursemodel
node_admincontroller -->|"reads"| node_enrollmentmodel
node_quiz -->|"loads course"| node_coursemodel
node_quiz -->|"checks and updates"| node_enrollmentmodel
node_quiz -->|"creates and reads"| node_quizmodel
node_quiz -->|"records attempts"| node_attemptmodel
node_quiz -->|"fetches questions"| node_quizprovider

click node_app "https://github.com/aakesh2195/new/blob/main/frontend/src/App.jsx"
click node_authpages "https://github.com/aakesh2195/new/blob/main/frontend/src/pages/auth/login.jsx"
click node_studentpages "https://github.com/aakesh2195/new/blob/main/frontend/src/pages/student/AllCourses.jsx"
click node_quizpage "https://github.com/aakesh2195/new/blob/main/frontend/src/pages/student/CourseQuiz.jsx"
click node_adminpages "https://github.com/aakesh2195/new/blob/main/frontend/src/pages/admin/Courses.jsx"
click node_clientapi "https://github.com/aakesh2195/new/blob/main/frontend/src/api/api.js"
click node_server "https://github.com/aakesh2195/new/blob/main/backend/server.js"
click node_authroutes "https://github.com/aakesh2195/new/blob/main/backend/routes/authRoutes.js"
click node_courseroutes "https://github.com/aakesh2195/new/blob/main/backend/routes/courseRoutes.js"
click node_enrollroutes "https://github.com/aakesh2195/new/blob/main/backend/routes/enrollmentRoutes.js"
click node_quizroutes "https://github.com/aakesh2195/new/blob/main/backend/routes/quizRoutes.js"
click node_studentroutes "https://github.com/aakesh2195/new/blob/main/backend/routes/studentRoutes.js"
click node_adminroutes "https://github.com/aakesh2195/new/blob/main/backend/routes/adminRoutes.js"
click node_auth "https://github.com/aakesh2195/new/blob/main/backend/middleware/authMiddleware.js"
click node_roles "https://github.com/aakesh2195/new/blob/main/backend/middleware/roleMiddleware.js"
click node_enrollment "https://github.com/aakesh2195/new/blob/main/backend/controllers/enrollmentController.js"
click node_quiz "https://github.com/aakesh2195/new/blob/main/backend/controllers/quizController.js"
click node_coursemodel "https://github.com/aakesh2195/new/blob/main/backend/models/courseModel.js"
click node_enrollmentmodel "https://github.com/aakesh2195/new/blob/main/backend/models/enrollmentModel.js"
click node_usermodel "https://github.com/aakesh2195/new/blob/main/backend/models/userModel.js"
click node_quizmodel "https://github.com/aakesh2195/new/blob/main/backend/models/quizModel.js"
click node_attemptmodel "https://github.com/aakesh2195/new/blob/main/backend/models/quizAttemptModel.js"
click node_authcontroller "https://github.com/aakesh2195/new/blob/main/backend/controllers/authController.js"
click node_coursecontroller "https://github.com/aakesh2195/new/blob/main/backend/controllers/courseController.js"
click node_studentcontroller "https://github.com/aakesh2195/new/blob/main/backend/controllers/studentController.js"
click node_admincontroller "https://github.com/aakesh2195/new/blob/main/backend/controllers/adminController.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_app,node_authpages,node_studentpages,node_quizpage,node_adminpages,node_clientapi toneBlue
class node_server,node_authroutes,node_courseroutes,node_enrollroutes,node_quizroutes,node_studentroutes,node_adminroutes,node_auth,node_roles,node_authcontroller toneAmber
class node_enrollment,node_quiz,node_coursecontroller,node_studentcontroller,node_admincontroller,node_quizprovider toneMint
class node_coursemodel,node_enrollmentmodel,node_usermodel,node_quizmodel,node_attemptmodel toneRose
class node_student,node_admin toneIndigo
```

## Components

### Web application

- [Role-based app routes](https://github.com/aakesh2195/new/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign in and signup](https://github.com/aakesh2195/new/blob/main/frontend/src/pages/auth/login.jsx): `frontend/src/pages/auth/login.jsx`
- [Student learning pages](https://github.com/aakesh2195/new/blob/main/frontend/src/pages/student/AllCourses.jsx): `frontend/src/pages/student/AllCourses.jsx`
- [Course quiz page](https://github.com/aakesh2195/new/blob/main/frontend/src/pages/student/CourseQuiz.jsx): `frontend/src/pages/student/CourseQuiz.jsx`
- [Admin management pages](https://github.com/aakesh2195/new/blob/main/frontend/src/pages/admin/Courses.jsx): `frontend/src/pages/admin/Courses.jsx`
- [API client](https://github.com/aakesh2195/new/blob/main/frontend/src/api/api.js): `frontend/src/api/api.js`

### API and access

- [Express API](https://github.com/aakesh2195/new/blob/main/backend/server.js): `backend/server.js`
- [Authentication routes](https://github.com/aakesh2195/new/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Course routes](https://github.com/aakesh2195/new/blob/main/backend/routes/courseRoutes.js): `backend/routes/courseRoutes.js`
- [Enrollment routes](https://github.com/aakesh2195/new/blob/main/backend/routes/enrollmentRoutes.js): `backend/routes/enrollmentRoutes.js`
- [Quiz routes](https://github.com/aakesh2195/new/blob/main/backend/routes/quizRoutes.js): `backend/routes/quizRoutes.js`
- [Student routes](https://github.com/aakesh2195/new/blob/main/backend/routes/studentRoutes.js): `backend/routes/studentRoutes.js`
- [Admin routes](https://github.com/aakesh2195/new/blob/main/backend/routes/adminRoutes.js): `backend/routes/adminRoutes.js`
- [Token authentication](https://github.com/aakesh2195/new/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`
- [Role authorization](https://github.com/aakesh2195/new/blob/main/backend/middleware/roleMiddleware.js): `backend/middleware/roleMiddleware.js`
- [Account access](https://github.com/aakesh2195/new/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`

### Learning services

- [Course enrollment](https://github.com/aakesh2195/new/blob/main/backend/controllers/enrollmentController.js): `backend/controllers/enrollmentController.js`
- [Quiz generation and scoring](https://github.com/aakesh2195/new/blob/main/backend/controllers/quizController.js): `backend/controllers/quizController.js`
- [Course management](https://github.com/aakesh2195/new/blob/main/backend/controllers/courseController.js): `backend/controllers/courseController.js`
- [Student management](https://github.com/aakesh2195/new/blob/main/backend/controllers/studentController.js): `backend/controllers/studentController.js`
- [Admin statistics](https://github.com/aakesh2195/new/blob/main/backend/controllers/adminController.js): `backend/controllers/adminController.js`

### MongoDB data

- [Course records](https://github.com/aakesh2195/new/blob/main/backend/models/courseModel.js): `backend/models/courseModel.js`
- [Enrollment records](https://github.com/aakesh2195/new/blob/main/backend/models/enrollmentModel.js): `backend/models/enrollmentModel.js`
- [User accounts](https://github.com/aakesh2195/new/blob/main/backend/models/userModel.js): `backend/models/userModel.js`
- [Quiz records](https://github.com/aakesh2195/new/blob/main/backend/models/quizModel.js): `backend/models/quizModel.js`
- [Quiz attempts](https://github.com/aakesh2195/new/blob/main/backend/models/quizAttemptModel.js): `backend/models/quizAttemptModel.js`

### Other components

- **Student**
- **Administrator**
- **QuizAPI**

## Connections

- Student → Role-based app routes: uses (evidence: `README.md`)
- Administrator → Role-based app routes: uses (evidence: `README.md`)
- Role-based app routes → Sign in and signup: routes to (evidence: `frontend/src/App.jsx`)
- Role-based app routes → Student learning pages: routes to (evidence: `frontend/src/App.jsx`)
- Role-based app routes → Course quiz page: routes to (evidence: `frontend/src/App.jsx`)
- Role-based app routes → Admin management pages: routes to (evidence: `frontend/src/App.jsx`)
- Sign in and signup → API client: calls (evidence: `frontend/src/pages/auth/login.jsx`)
- Student learning pages → API client: calls (evidence: `frontend/src/pages/student/AllCourses.jsx`)
- Course quiz page → API client: calls (evidence: `frontend/src/pages/student/CourseQuiz.jsx`)
- Admin management pages → API client: calls (evidence: `frontend/src/pages/admin/Courses.jsx`)
- API client → Express API: requests (evidence: `frontend/src/api/api.js`)
- Express API → Authentication routes: mounts (evidence: `backend/server.js`)
- Express API → Course routes: mounts (evidence: `backend/server.js`)
- Express API → Enrollment routes: mounts (evidence: `backend/server.js`)
- Express API → Quiz routes: mounts (evidence: `backend/server.js`)
- Express API → Student routes: mounts (evidence: `backend/server.js`)
- Express API → Admin routes: mounts (evidence: `backend/server.js`)
- Authentication routes → Account access: dispatches (evidence: `backend/routes/authRoutes.js`)
- Course routes → Course management: dispatches (evidence: `backend/routes/courseRoutes.js`)
- Enrollment routes → Course enrollment: dispatches (evidence: `backend/routes/enrollmentRoutes.js`)
- Quiz routes → Quiz generation and scoring: dispatches (evidence: `backend/routes/quizRoutes.js`)
- Student routes → Student management: dispatches (evidence: `backend/routes/studentRoutes.js`)
- Admin routes → Admin statistics: dispatches (evidence: `backend/routes/adminRoutes.js`)
- Enrollment routes → Token authentication: checks token (evidence: `backend/routes/enrollmentRoutes.js`)
- Enrollment routes → Role authorization: checks role (evidence: `backend/routes/enrollmentRoutes.js`)
- Student routes → Token authentication: checks token (evidence: `backend/routes/studentRoutes.js`)
- Student routes → Role authorization: checks role (evidence: `backend/routes/studentRoutes.js`)
- Token authentication → User accounts: loads account (evidence: `backend/middleware/authMiddleware.js`)
- Account access → User accounts: reads and writes (evidence: `backend/controllers/authController.js`)
- Course enrollment → Course records: checks course (evidence: `backend/controllers/enrollmentController.js`)
- Course enrollment → Enrollment records: creates and reads (evidence: `backend/controllers/enrollmentController.js`)
- Course management → Course records: manages (evidence: `backend/controllers/courseController.js`)
- Student management → User accounts: manages (evidence: `backend/controllers/studentController.js`)
- Admin statistics → User accounts: reads (evidence: `backend/controllers/adminController.js`)
- Admin statistics → Course records: reads (evidence: `backend/controllers/adminController.js`)
- Admin statistics → Enrollment records: reads (evidence: `backend/controllers/adminController.js`)
- Quiz generation and scoring → Course records: loads course (evidence: `backend/controllers/quizController.js`)
- Quiz generation and scoring → Enrollment records: checks and updates (evidence: `backend/controllers/quizController.js`)
- Quiz generation and scoring → Quiz records: creates and reads (evidence: `backend/controllers/quizController.js`)
- Quiz generation and scoring → Quiz attempts: records attempts (evidence: `backend/controllers/quizController.js`)
- Quiz generation and scoring → QuizAPI: fetches questions (evidence: `backend/controllers/quizController.js`)
