# nuelfell0ff/benedex-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/nuelfell0ff/benedex-frontend
- Repository: https://github.com/nuelfell0ff/benedex-frontend

## Overview

#### Purpose and Runtime
This is a Vite-built React single-page learning-management frontend. It serves public marketing/authentication, role-specific student/instructor/admin portals, payment return handling, and public certificate verification. The README contains no usable project documentation. Browser entry and app composition begin at `src/main.jsx`, `src/App.jsx`, and `index.html`.

#### Application Shell, Routing, and Access Control
`src/App.jsx` is the likely route orchestration boundary, mapping public and portal pages into layouts. `src/routes/ProtectedRoute.jsx` gates authenticated/authorized navigation. Authentication state is centralized through `src/context/AuthContext.jsx`; pages and layouts should consume this context rather than establish independent session state.

#### Role-Specific Portal Layouts
Three layout boundaries organize navigation and shared chrome by user role: `src/layouts/StudentLayout.jsx`, `src/layouts/InstructorLayout.jsx`, and `src/layouts/AdminLayout.jsx`. Shared navigational/UI components reside in `src/components/layout/Sidebar.jsx`, `src/components/layout/Topbar.jsx`, and `src/components/layout/AiSupportWidget.jsx`. This separates common portal framing from feature pages.

#### Student Learning Flow
Students discover enrolled courses, enter course detail/viewer experiences, complete assignments and quizzes, attend live classes, and access certificates. Core screens are `src/pages/student/StudentDashboard.jsx`, `src/pages/student/StudentCourses.jsx`, and `src/pages/student/StudentCourseViewer.jsx`; assessment and completion surfaces include `src/pages/student/Assignments.jsx`, `src/pages/student/StudentQuiz.jsx`, and `src/pages/student/CertificateView.jsx`.

#### Instructor Authoring and Delivery Flow
Instructor features cover course/module/assignment creation, course-specific management, grading, learner oversight, communications, and live classes. The authoring flow is anchored in `src/pages/instructor/CreateCourse.jsx`, `src/pages/instructor/CreateModule.jsx`, and `src/pages/instructor/CreateAssignment.jsx`. Operational delivery and grading occur through `src/pages/instructor/InstructorCourseDetails.jsx`, `src/pages/instructor/GradeSubmissions.jsx`, and `src/pages/instructor/InstructorLiveClasses.jsx`.

#### Administration and Platform Operations
Admin pages provide governance over users, courses, payments, notifications, analytics, activity logs, AI tickets, and settings. Key operational control points are `src/pages/admin/AdminDashboard.jsx`, `src/pages/admin/AdminUsers.jsx`, and `src/pages/admin/AdminCourses.jsx`, with financial and support workflows in `src/pages/admin/AdminPayments.jsx` and `src/pages/admin/AdminAiTickets.jsx`.

#### External Integration Boundaries
Network communication is centralized at `src/services/api.js`, the principal frontend-to-backend API boundary. Payment provider redirect/callback completion is isolated in `src/pages/payments/PaymentCallback.jsx`, with implementation notes in `PAYMENT_INTEGRATION_NOTES.md`. The app is PWA-capable through `public/manifest.json` and `public/sw.js`; browser push-registration logic is in `src/utils/registerPush.js`. Deployment configuration indicates Vercel hosting via `vercel.json`.

Main entry points: [`src/routes/ProtectedRoute.jsx`](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/routes/ProtectedRoute.jsx) (Protected Routes), [`src/services/api.js`](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/services/api.js) (Backend API), [`src/main.jsx`](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/main.jsx) (React Bootstrap), [`src/layouts/InstructorLayout.jsx`](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/layouts/InstructorLayout.jsx) (Instructor Portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App Shell"]
  node_html["Browser Entry<br/>HTML entry<br/>[index.html]"]
  node_main["React Bootstrap<br/>React entry<br/>[main.jsx]"]
  node_app["Route Composition<br/>app router<br/>[App.jsx]"]
  node_auth["Auth State<br/>React context<br/>[AuthContext.jsx]"]
  node_protected["Protected Routes<br/>route guard<br/>[ProtectedRoute.jsx]"]
end

subgraph group_portals["Role Portals"]
  node_student_layout["Student Portal<br/>role layout<br/>[StudentLayout.jsx]"]
  node_instructor_layout["Instructor Portal<br/>role layout"]
  node_admin_layout["Admin Portal<br/>role layout<br/>[AdminLayout.jsx]"]
  node_portal_chrome["Portal Chrome<br/>shared UI<br/>[Sidebar.jsx]"]
  node_student_learning["Student Learning<br/>student screens"]
  node_instructor_authoring["Course Authoring<br/>instructor screens<br/>[CreateCourse.jsx]"]
  node_instructor_delivery["Delivery &amp; Grading<br/>instructor screens"]
  node_admin_ops["Platform Operations<br/>admin screens<br/>[AdminDashboard.jsx]"]
end

subgraph group_integration["Browser Integrations"]
  node_payment_callback["Payment Return<br/>callback page"]
  node_api{{"Backend API<br/>API client<br/>[api.js]"}}
  node_pwa_manifest["PWA Manifest<br/>PWA metadata<br/>[manifest.json]"]
  node_service_worker["Service Worker<br/>PWA worker<br/>[sw.js]"]
  node_push_registration["Push Registration<br/>browser utility<br/>[registerPush.js]"]
  node_vercel["Vercel Deployment<br/>hosting config<br/>[vercel.json]"]
end

node_html -->|"loads"| node_main
node_main -->|"mounts"| node_app
node_main -->|"provides"| node_auth
node_app -->|"protects portal routes"| node_protected
node_protected -->|"checks identity and role"| node_auth
node_protected -->|"student access"| node_student_layout
node_protected -->|"instructor access"| node_instructor_layout
node_protected -->|"admin access"| node_admin_layout
node_student_layout -->|"uses"| node_portal_chrome
node_instructor_layout -->|"uses"| node_portal_chrome
node_admin_layout -->|"uses"| node_portal_chrome
node_student_layout -->|"hosts"| node_student_learning
node_instructor_layout -->|"hosts"| node_instructor_authoring
node_instructor_layout -->|"hosts"| node_instructor_delivery
node_admin_layout -->|"hosts"| node_admin_ops
node_app -->|"routes payment return"| node_payment_callback
node_student_learning -->|"learning data"| node_api
node_instructor_authoring -->|"publishes content"| node_api
node_instructor_delivery -->|"manages delivery"| node_api
node_admin_ops -->|"operates platform"| node_api
node_payment_callback -->|"confirms payment"| node_api
node_html -->|"declares"| node_pwa_manifest
node_pwa_manifest -.->|"enables PWA"| node_service_worker
node_main -->|"registers push"| node_push_registration
node_vercel -.->|"deploys"| node_html

click node_html "https://github.com/nuelfell0ff/benedex-frontend/blob/main/index.html"
click node_main "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/main.jsx"
click node_app "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/App.jsx"
click node_auth "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/context/AuthContext.jsx"
click node_protected "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/routes/ProtectedRoute.jsx"
click node_student_layout "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/layouts/StudentLayout.jsx"
click node_instructor_layout "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/layouts/InstructorLayout.jsx"
click node_admin_layout "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/layouts/AdminLayout.jsx"
click node_portal_chrome "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/components/layout/Sidebar.jsx"
click node_student_learning "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/pages/student/StudentCourseViewer.jsx"
click node_instructor_authoring "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/pages/instructor/CreateCourse.jsx"
click node_instructor_delivery "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/pages/instructor/InstructorCourseDetails.jsx"
click node_admin_ops "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/pages/admin/AdminDashboard.jsx"
click node_payment_callback "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/pages/payments/PaymentCallback.jsx"
click node_api "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/services/api.js"
click node_pwa_manifest "https://github.com/nuelfell0ff/benedex-frontend/blob/main/public/manifest.json"
click node_service_worker "https://github.com/nuelfell0ff/benedex-frontend/blob/main/public/sw.js"
click node_push_registration "https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/utils/registerPush.js"
click node_vercel "https://github.com/nuelfell0ff/benedex-frontend/blob/main/vercel.json"

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_html,node_main,node_app,node_auth,node_protected toneBlue
class node_student_layout,node_instructor_layout,node_admin_layout,node_portal_chrome,node_student_learning,node_instructor_authoring,node_instructor_delivery,node_admin_ops toneAmber
class node_payment_callback,node_api,node_pwa_manifest,node_service_worker,node_push_registration,node_vercel toneMint
```

## Components

### App Shell

- [Browser Entry](https://github.com/nuelfell0ff/benedex-frontend/blob/main/index.html): HTML entry · `index.html`
- [React Bootstrap](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/main.jsx): React entry · `src/main.jsx`
- [Route Composition](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/App.jsx): app router · Maps public, portal, callback, and verification screens. · `src/App.jsx`
- [Auth State](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/context/AuthContext.jsx): React context · Central session and identity state. · `src/context/AuthContext.jsx`
- [Protected Routes](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/routes/ProtectedRoute.jsx): route guard · Enforces authentication and role authorization. · `src/routes/ProtectedRoute.jsx`

### Role Portals

- [Student Portal](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/layouts/StudentLayout.jsx): role layout · `src/layouts/StudentLayout.jsx`
- [Instructor Portal](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/layouts/InstructorLayout.jsx): role layout · `src/layouts/InstructorLayout.jsx`
- [Admin Portal](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/layouts/AdminLayout.jsx): role layout · `src/layouts/AdminLayout.jsx`
- [Portal Chrome](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/components/layout/Sidebar.jsx): shared UI · Sidebar, topbar, and AI support widget. · `src/components/layout/Sidebar.jsx`
- [Student Learning](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/pages/student/StudentCourseViewer.jsx): student screens · Dashboard, courses, course viewer, assignments, quizzes, and certificates. · `src/pages/student/StudentCourseViewer.jsx`
- [Course Authoring](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/pages/instructor/CreateCourse.jsx): instructor screens · Creates courses, modules, and assignments. · `src/pages/instructor/CreateCourse.jsx`
- [Delivery & Grading](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/pages/instructor/InstructorCourseDetails.jsx): instructor screens · Manages courses, submissions, and live classes. · `src/pages/instructor/InstructorCourseDetails.jsx`
- [Platform Operations](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/pages/admin/AdminDashboard.jsx): admin screens · Governance for users, courses, payments, and AI tickets. · `src/pages/admin/AdminDashboard.jsx`

### Browser Integrations

- [Payment Return](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/pages/payments/PaymentCallback.jsx): callback page · Completes payment-provider redirect handling. · `src/pages/payments/PaymentCallback.jsx`
- [Backend API](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/services/api.js): API client · Central frontend network boundary. · `src/services/api.js`
- [PWA Manifest](https://github.com/nuelfell0ff/benedex-frontend/blob/main/public/manifest.json): PWA metadata · `public/manifest.json`
- [Service Worker](https://github.com/nuelfell0ff/benedex-frontend/blob/main/public/sw.js): PWA worker · `public/sw.js`
- [Push Registration](https://github.com/nuelfell0ff/benedex-frontend/blob/main/src/utils/registerPush.js): browser utility · `src/utils/registerPush.js`
- [Vercel Deployment](https://github.com/nuelfell0ff/benedex-frontend/blob/main/vercel.json): hosting config · `vercel.json`

## Connections

- Browser Entry → React Bootstrap: loads
- React Bootstrap → Route Composition: mounts
- React Bootstrap → Auth State: provides
- Route Composition → Protected Routes: protects portal routes
- Protected Routes → Auth State: checks identity and role
- Protected Routes → Student Portal: student access
- Protected Routes → Instructor Portal: instructor access
- Protected Routes → Admin Portal: admin access
- Student Portal → Portal Chrome: uses
- Instructor Portal → Portal Chrome: uses
- Admin Portal → Portal Chrome: uses
- Student Portal → Student Learning: hosts
- Instructor Portal → Course Authoring: hosts
- Instructor Portal → Delivery & Grading: hosts
- Admin Portal → Platform Operations: hosts
- Route Composition → Payment Return: routes payment return
- Student Learning → Backend API: learning data
- Course Authoring → Backend API: publishes content
- Delivery & Grading → Backend API: manages delivery
- Platform Operations → Backend API: operates platform
- Payment Return → Backend API: confirms payment
- Browser Entry → PWA Manifest: declares
- PWA Manifest → Service Worker: enables PWA
- React Bootstrap → Push Registration: registers push
- Vercel Deployment → Browser Entry: deploys
