# yahyasheata/mathmasteryhub1 architecture

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

- Interactive diagram: https://gitdiagram.com/yahyasheata/mathmasteryhub1
- Repository: https://github.com/yahyasheata/mathmasteryhub1

## Overview

Math Mastery Hub is a course-based learning platform. Learners browse courses and resources, purchase or enroll, then access lessons, homework, exams, live sessions, and progress tools; staff manage course content and student activity. The tree documents additional branches for free resources, past papers, revision and recovery plans, analytics, and parent reports. Source excerpts confirm routing, resource resolution, enrollment persistence, and notification behavior; other subsystem links are kept broad where implementation was not sampled.

Main entry points: [`views/user/course.php`](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/user/course.php) (Course workspace), [`index.php`](https://github.com/yahyasheata/mathmasteryhub1/blob/main/index.php) (HTTP router), [`connection/config.php`](https://github.com/yahyasheata/mathmasteryhub1/blob/main/connection/config.php) (Application database), [`views/admin/dashboard.php`](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/admin/dashboard.php) (Admin workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public discovery"]
  node_landing["Landing page<br/>[index.php]"]
  node_catalog["Course catalog<br/>[courses.php]"]
  node_publicresources["Public resources<br/>[free-learning.php]"]
  node_checkout["Course checkout<br/>[checkout.php]"]
  node_payment["Payment integration"]
  node_webhook["Payment webhook<br/>[webhook_json.php]"]
end

subgraph group_learning["Learning workspace"]
  node_courseworkspace["Course workspace<br/>[course.php]"]
  node_resourcegateway["Resource access"]
  node_resource_resolver["Resource resolver"]
  node_assignments["Assignments<br/>[assignments.php]"]
  node_exams["Exams<br/>[exams.php]"]
  node_timedexam["Timed exams<br/>[TimedExam.php]"]
  node_livesessions["Live sessions<br/>[LiveSessions.php]"]
  node_pastpapers["Past papers<br/>[PastPapers.php]"]
  node_revision["Revision plans<br/>[RevisionPlan.php]"]
  node_recovery["Recovery plans<br/>[RecoveryPlan.php]"]
  node_progress["Learning progress"]
  node_analytics["Student analytics"]
  node_parentreports["Parent reports"]
end

subgraph group_admin["Course administration"]
  node_adminviews["Admin workspace<br/>[dashboard.php]"]
  node_admincourses["Course management"]
  node_copyservice["Content copying"]
  node_adminassessments["Assessment management"]
  node_pastpaperadmin["Paper management<br/>[past-papers.php]"]
end

subgraph group_platform["Platform services"]
  node_router["HTTP router<br/>[index.php]"]
  node_enrollment["Enrollment service"]
  node_notification["Notifications"]
  node_pushclient["Push subscription<br/>[main.js]"]
  node_notificationdb[("Notification records")]
  node_database[("Application database<br/>[config.php]")]
end

node_visitor(("Visitor"))
node_learner(("Learner"))
node_staff(("Administrator"))
node_paymentprovider{{"Fawaterk"}}

node_visitor -->|"requests pages"| node_router
node_learner -->|"requests learning"| node_router
node_staff -->|"requests admin"| node_router
node_router -->|"routes landing"| node_landing
node_router -->|"routes catalog"| node_catalog
node_router -->|"routes resources"| node_publicresources
node_router -->|"routes checkout"| node_checkout
node_router -->|"routes workspace"| node_courseworkspace
node_router -->|"routes admin"| node_adminviews
node_checkout -->|"creates payment"| node_payment
node_payment -.->|"requests payment"| node_paymentprovider
node_paymentprovider -.->|"sends callback"| node_webhook
node_webhook -->|"verifies configuration"| node_database
node_checkout -->|"records enrollment"| node_enrollment
node_enrollment -->|"writes course logs"| node_database
node_courseworkspace -->|"opens resource"| node_resourcegateway
node_resourcegateway -->|"resolves resource"| node_resource_resolver
node_resourcegateway -->|"checks access"| node_database
node_courseworkspace -->|"accesses assignments"| node_assignments
node_courseworkspace -->|"accesses exams"| node_exams
node_exams -->|"runs timed exams"| node_timedexam
node_courseworkspace -->|"views sessions"| node_livesessions
node_courseworkspace -->|"opens papers"| node_pastpapers
node_courseworkspace -->|"uses revision plans"| node_revision
node_courseworkspace -->|"uses recovery plans"| node_recovery
node_courseworkspace -->|"records progress"| node_progress
node_progress -->|"persists progress"| node_database
node_analytics -->|"reads activity"| node_database
node_parentreports -->|"reads learning data"| node_database
node_adminviews -->|"manages courses"| node_admincourses
node_admincourses -->|"updates course content"| node_database
node_admincourses -->|"copies content"| node_copyservice
node_copyservice -->|"copies course records"| node_database
node_adminviews -->|"manages assessments"| node_adminassessments
node_adminassessments -->|"updates assessment data"| node_database
node_adminviews -->|"manages papers"| node_pastpaperadmin
node_notification -->|"reads and writes"| node_notificationdb
node_notification -->|"persists notices"| node_database
node_pushclient -->|"saves subscription"| node_notification

click node_router "https://github.com/yahyasheata/mathmasteryhub1/blob/main/index.php"
click node_landing "https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/index.php"
click node_catalog "https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/public/courses.php"
click node_publicresources "https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/public/free-learning.php"
click node_checkout "https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/public/checkout.php"
click node_payment "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/FawaterkPayment.php"
click node_webhook "https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/public/payment/webhook_json.php"
click node_enrollment "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/EnrollmentService.php"
click node_courseworkspace "https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/user/course.php"
click node_resourcegateway "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/StudentResourceGateway.php"
click node_resource_resolver "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/CourseResourceResolver.php"
click node_assignments "https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/user/assignments.php"
click node_exams "https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/user/exams.php"
click node_timedexam "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/TimedExam.php"
click node_livesessions "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/LiveSessions.php"
click node_pastpapers "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/PastPapers.php"
click node_revision "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/RevisionPlan.php"
click node_recovery "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/RecoveryPlan.php"
click node_progress "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/StudentCourseProgress.php"
click node_analytics "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/StudentAnalytics.php"
click node_parentreports "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/ParentWeeklyReport.php"
click node_adminviews "https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/admin/dashboard.php"
click node_admincourses "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/AdminCourseService.php"
click node_copyservice "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/CourseContentCopyService.php"
click node_adminassessments "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/AdminAssessmentService.php"
click node_pastpaperadmin "https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/admin/past-papers.php"
click node_notification "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/NotificationManager.php"
click node_pushclient "https://github.com/yahyasheata/mathmasteryhub1/blob/main/notification/main.js"
click node_notificationdb "https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/NotificationManager.php"
click node_database "https://github.com/yahyasheata/mathmasteryhub1/blob/main/connection/config.php"

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_landing,node_catalog,node_publicresources,node_checkout,node_payment,node_webhook toneBlue
class node_courseworkspace,node_resourcegateway,node_resource_resolver,node_assignments,node_exams,node_timedexam,node_livesessions,node_pastpapers,node_revision,node_recovery,node_progress,node_analytics,node_parentreports toneAmber
class node_adminviews,node_admincourses,node_copyservice,node_adminassessments,node_pastpaperadmin toneMint
class node_router,node_enrollment,node_notification,node_pushclient,node_notificationdb,node_database toneRose
class node_visitor,node_learner,node_staff,node_paymentprovider toneIndigo
```

## Components

### Public discovery

- [Landing page](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/index.php): `views/index.php`
- [Course catalog](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/public/courses.php): `views/public/courses.php`
- [Public resources](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/public/free-learning.php): `views/public/free-learning.php`
- [Course checkout](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/public/checkout.php): `views/public/checkout.php`
- [Payment integration](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/FawaterkPayment.php): `inc/FawaterkPayment.php`
- [Payment webhook](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/public/payment/webhook_json.php): `views/public/payment/webhook_json.php`

### Learning workspace

- [Course workspace](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/user/course.php): `views/user/course.php`
- [Resource access](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/StudentResourceGateway.php): `inc/StudentResourceGateway.php`
- [Resource resolver](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/CourseResourceResolver.php): `inc/CourseResourceResolver.php`
- [Assignments](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/user/assignments.php): `views/user/assignments.php`
- [Exams](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/user/exams.php): `views/user/exams.php`
- [Timed exams](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/TimedExam.php): `inc/TimedExam.php`
- [Live sessions](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/LiveSessions.php): `inc/LiveSessions.php`
- [Past papers](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/PastPapers.php): `inc/PastPapers.php`
- [Revision plans](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/RevisionPlan.php): `inc/RevisionPlan.php`
- [Recovery plans](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/RecoveryPlan.php): `inc/RecoveryPlan.php`
- [Learning progress](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/StudentCourseProgress.php): `inc/StudentCourseProgress.php`
- [Student analytics](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/StudentAnalytics.php): `inc/StudentAnalytics.php`
- [Parent reports](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/ParentWeeklyReport.php): `inc/ParentWeeklyReport.php`

### Course administration

- [Admin workspace](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/admin/dashboard.php): `views/admin/dashboard.php`
- [Course management](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/AdminCourseService.php): `inc/AdminCourseService.php`
- [Content copying](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/CourseContentCopyService.php): `inc/CourseContentCopyService.php`
- [Assessment management](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/AdminAssessmentService.php): `inc/AdminAssessmentService.php`
- [Paper management](https://github.com/yahyasheata/mathmasteryhub1/blob/main/views/admin/past-papers.php): `views/admin/past-papers.php`

### Platform services

- [HTTP router](https://github.com/yahyasheata/mathmasteryhub1/blob/main/index.php): `index.php`
- [Enrollment service](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/EnrollmentService.php): `inc/EnrollmentService.php`
- [Notifications](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/NotificationManager.php): `inc/NotificationManager.php`
- [Push subscription](https://github.com/yahyasheata/mathmasteryhub1/blob/main/notification/main.js): `notification/main.js`
- [Notification records](https://github.com/yahyasheata/mathmasteryhub1/blob/main/inc/NotificationManager.php): `inc/NotificationManager.php`
- [Application database](https://github.com/yahyasheata/mathmasteryhub1/blob/main/connection/config.php): `connection/config.php`

### Other components

- **Visitor**
- **Learner**
- **Administrator**
- **Fawaterk**

## Connections

- Visitor → HTTP router: requests pages
- Learner → HTTP router: requests learning
- Administrator → HTTP router: requests admin
- HTTP router → Landing page: routes landing
- HTTP router → Course catalog: routes catalog
- HTTP router → Public resources: routes resources
- HTTP router → Course checkout: routes checkout
- HTTP router → Course workspace: routes workspace
- HTTP router → Admin workspace: routes admin
- Course checkout → Payment integration: creates payment
- Payment integration → Fawaterk: requests payment
- Fawaterk → Payment webhook: sends callback
- Payment webhook → Application database: verifies configuration
- Course checkout → Enrollment service: records enrollment
- Enrollment service → Application database: writes course logs
- Course workspace → Resource access: opens resource
- Resource access → Resource resolver: resolves resource
- Resource access → Application database: checks access
- Course workspace → Assignments: accesses assignments
- Course workspace → Exams: accesses exams
- Exams → Timed exams: runs timed exams
- Course workspace → Live sessions: views sessions
- Course workspace → Past papers: opens papers
- Course workspace → Revision plans: uses revision plans
- Course workspace → Recovery plans: uses recovery plans
- Course workspace → Learning progress: records progress
- Learning progress → Application database: persists progress
- Student analytics → Application database: reads activity
- Parent reports → Application database: reads learning data
- Admin workspace → Course management: manages courses
- Course management → Application database: updates course content
- Course management → Content copying: copies content
- Content copying → Application database: copies course records
- Admin workspace → Assessment management: manages assessments
- Assessment management → Application database: updates assessment data
- Admin workspace → Paper management: manages papers
- Notifications → Notification records: reads and writes
- Notifications → Application database: persists notices
- Push subscription → Notifications: saves subscription
