# asyrafprmdya/algolearn architecture

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

- Interactive diagram: https://gitdiagram.com/asyrafprmdya/algolearn
- Repository: https://github.com/asyrafprmdya/algolearn

## Overview

This is an AlgoLearn-branded learning application built on Laravel, with student, lecturer, and administrator workflows. Students take a placement pretest, study level-based materials, complete quizzes, and track progress; lecturers manage learning content and review students, while administrators manage accounts, settings, and reports. The graph follows the documented web routes and sampled controller/model references. Some controllers and views were not excerpted, so their internal behavior and unshown calls are not expanded.

Main entry points: [`routes/web.php`](https://github.com/asyrafprmdya/algolearn/blob/master/routes/web.php) (Web Routes), [`app/Http/Controllers/LecturerController.php`](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/LecturerController.php) (Content Management), [`app/Http/Controllers/QuizController.php`](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/QuizController.php) (Quiz Assessment), [`app/Http/Controllers/AdminController.php`](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/AdminController.php) (Admin Operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access"]
  node_web["Web Routes<br/>[web.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_role["Role Guard<br/>[RoleMiddleware.php]"]
  node_pretestguard["Pretest Guard"]
end

subgraph group_learning["Student Learning"]
  node_pretest["Placement Pretest"]
  node_studentflow["Learning Activities"]
  node_quizflow["Quiz Assessment<br/>[QuizController.php]"]
  node_progress["Progress Tracking"]
  node_materialbrowse["Material Listing"]
  node_studentdata["Student State<br/>[User.php]"]
  node_pretestdata["Pretest Questions"]
  node_results["Quiz Results<br/>[QuizResult.php]"]
end

subgraph group_authoring["Lecturer Content"]
  node_materials["Learning Materials<br/>[Material.php]"]
  node_lecturerflow["Content Management"]
  node_quizdata["Quiz Content<br/>[Quiz.php]"]
  node_questiondata["Quiz Questions<br/>[Question.php]"]
end

subgraph group_operations["Administration"]
  node_adminflow["Admin Operations"]
end

node_student(("Student"))
node_lecturer(("Lecturer"))
node_admin(("Administrator"))

node_student -->|"uses"| node_web
node_lecturer -->|"uses"| node_web
node_admin -->|"uses"| node_web
node_web -->|"routes to"| node_auth
node_web -->|"routes to"| node_pretest
node_web -->|"routes to"| node_studentflow
node_web -->|"routes to"| node_quizflow
node_web -->|"routes to"| node_progress
node_web -->|"routes to"| node_materialbrowse
node_web -->|"routes to"| node_lecturerflow
node_web -->|"routes to"| node_adminflow
node_web -->|"applies role"| node_role
node_web -->|"applies gate"| node_pretestguard
node_pretest -->|"reads"| node_pretestdata
node_pretest -->|"updates"| node_studentdata
node_studentflow -->|"reads"| node_studentdata
node_studentflow -->|"reads"| node_pretestdata
node_studentflow -->|"reads"| node_materials
node_studentflow -->|"reads"| node_quizdata
node_materialbrowse -->|"reads"| node_materials
node_quizflow -->|"reads"| node_materials
node_quizflow -->|"reads"| node_quizdata
node_quizflow -->|"reads"| node_questiondata
node_quizflow -->|"records scores"| node_results
node_quizflow -->|"updates progress"| node_studentdata
node_progress -->|"reads"| node_results
node_lecturerflow -->|"reads"| node_studentdata
node_lecturerflow -->|"manages"| node_materials
node_lecturerflow -->|"manages"| node_quizdata
node_lecturerflow -->|"creates"| node_questiondata
node_lecturerflow -->|"manages"| node_pretestdata
node_lecturerflow -->|"reads"| node_results
node_adminflow -->|"manages"| node_studentdata
node_adminflow -->|"reads"| node_materials
node_adminflow -->|"reads"| node_quizdata
node_adminflow -->|"reads"| node_pretestdata
node_adminflow -->|"reports"| node_results
node_auth -->|"authenticates"| node_studentdata

click node_web "https://github.com/asyrafprmdya/algolearn/blob/master/routes/web.php"
click node_auth "https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/AuthController.php"
click node_role "https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Middleware/RoleMiddleware.php"
click node_pretestguard "https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Middleware/CheckPretestCompleted.php"
click node_pretest "https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/PretestController.php"
click node_studentflow "https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/StudentController.php"
click node_quizflow "https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/QuizController.php"
click node_progress "https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/ProgressController.php"
click node_materialbrowse "https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/MaterialController.php"
click node_studentdata "https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/User.php"
click node_pretestdata "https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/PretestQuestion.php"
click node_materials "https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/Material.php"
click node_lecturerflow "https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/LecturerController.php"
click node_quizdata "https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/Quiz.php"
click node_questiondata "https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/Question.php"
click node_results "https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/QuizResult.php"
click node_adminflow "https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/AdminController.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_web,node_auth,node_role,node_pretestguard toneBlue
class node_pretest,node_studentflow,node_quizflow,node_progress,node_materialbrowse,node_studentdata,node_pretestdata,node_results toneAmber
class node_materials,node_lecturerflow,node_quizdata,node_questiondata toneMint
class node_adminflow toneRose
class node_student,node_lecturer,node_admin toneIndigo
```

## Components

### Access

- [Web Routes](https://github.com/asyrafprmdya/algolearn/blob/master/routes/web.php): `routes/web.php`
- [Authentication](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/AuthController.php): `app/Http/Controllers/AuthController.php`
- [Role Guard](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Middleware/RoleMiddleware.php): `app/Http/Middleware/RoleMiddleware.php`
- [Pretest Guard](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Middleware/CheckPretestCompleted.php): `app/Http/Middleware/CheckPretestCompleted.php`

### Student Learning

- [Placement Pretest](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/PretestController.php): `app/Http/Controllers/PretestController.php`
- [Learning Activities](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/StudentController.php): `app/Http/Controllers/StudentController.php`
- [Quiz Assessment](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/QuizController.php): `app/Http/Controllers/QuizController.php`
- [Progress Tracking](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/ProgressController.php): `app/Http/Controllers/ProgressController.php`
- [Material Listing](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/MaterialController.php): `app/Http/Controllers/MaterialController.php`
- [Student State](https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/User.php): `app/Models/User.php`
- [Pretest Questions](https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/PretestQuestion.php): `app/Models/PretestQuestion.php`
- [Quiz Results](https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/QuizResult.php): `app/Models/QuizResult.php`

### Lecturer Content

- [Learning Materials](https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/Material.php): `app/Models/Material.php`
- [Content Management](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/LecturerController.php): `app/Http/Controllers/LecturerController.php`
- [Quiz Content](https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/Quiz.php): `app/Models/Quiz.php`
- [Quiz Questions](https://github.com/asyrafprmdya/algolearn/blob/master/app/Models/Question.php): `app/Models/Question.php`

### Administration

- [Admin Operations](https://github.com/asyrafprmdya/algolearn/blob/master/app/Http/Controllers/AdminController.php): `app/Http/Controllers/AdminController.php`

### Other components

- **Student**
- **Lecturer**
- **Administrator**

## Connections

- Student → Web Routes: uses (evidence: `routes/web.php`)
- Lecturer → Web Routes: uses (evidence: `routes/web.php`)
- Administrator → Web Routes: uses (evidence: `routes/web.php`)
- Web Routes → Authentication: routes to (evidence: `routes/web.php`)
- Web Routes → Placement Pretest: routes to (evidence: `routes/web.php`)
- Web Routes → Learning Activities: routes to (evidence: `routes/web.php`)
- Web Routes → Quiz Assessment: routes to (evidence: `routes/web.php`)
- Web Routes → Progress Tracking: routes to (evidence: `routes/web.php`)
- Web Routes → Material Listing: routes to (evidence: `routes/web.php`)
- Web Routes → Content Management: routes to (evidence: `routes/web.php`)
- Web Routes → Admin Operations: routes to (evidence: `routes/web.php`)
- Web Routes → Role Guard: applies role (evidence: `routes/web.php`)
- Web Routes → Pretest Guard: applies gate (evidence: `routes/web.php`)
- Placement Pretest → Pretest Questions: reads (evidence: `app/Http/Controllers/PretestController.php`)
- Placement Pretest → Student State: updates (evidence: `app/Http/Controllers/PretestController.php`)
- Learning Activities → Student State: reads (evidence: `app/Http/Controllers/StudentController.php`)
- Learning Activities → Pretest Questions: reads (evidence: `app/Http/Controllers/StudentController.php`)
- Learning Activities → Learning Materials: reads (evidence: `app/Http/Controllers/StudentController.php`)
- Learning Activities → Quiz Content: reads (evidence: `app/Http/Controllers/StudentController.php`)
- Material Listing → Learning Materials: reads (evidence: `app/Http/Controllers/MaterialController.php`)
- Quiz Assessment → Learning Materials: reads (evidence: `app/Http/Controllers/QuizController.php`)
- Quiz Assessment → Quiz Content: reads (evidence: `app/Http/Controllers/QuizController.php`)
- Quiz Assessment → Quiz Questions: reads (evidence: `app/Http/Controllers/QuizController.php`)
- Quiz Assessment → Quiz Results: records scores (evidence: `app/Http/Controllers/QuizController.php`)
- Quiz Assessment → Student State: updates progress (evidence: `app/Http/Controllers/QuizController.php`)
- Progress Tracking → Quiz Results: reads (evidence: `app/Http/Controllers/ProgressController.php`)
- Content Management → Student State: reads (evidence: `app/Http/Controllers/LecturerController.php`)
- Content Management → Learning Materials: manages (evidence: `app/Http/Controllers/LecturerController.php`)
- Content Management → Quiz Content: manages (evidence: `app/Http/Controllers/LecturerController.php`)
- Content Management → Quiz Questions: creates (evidence: `app/Http/Controllers/LecturerController.php`)
- Content Management → Pretest Questions: manages (evidence: `app/Http/Controllers/LecturerController.php`)
- Content Management → Quiz Results: reads (evidence: `app/Http/Controllers/LecturerController.php`)
- Admin Operations → Student State: manages (evidence: `app/Http/Controllers/AdminController.php`)
- Admin Operations → Learning Materials: reads (evidence: `app/Http/Controllers/AdminController.php`)
- Admin Operations → Quiz Content: reads (evidence: `app/Http/Controllers/AdminController.php`)
- Admin Operations → Pretest Questions: reads (evidence: `app/Http/Controllers/AdminController.php`)
- Admin Operations → Quiz Results: reports (evidence: `app/Http/Controllers/AdminController.php`)
- Authentication → Student State: authenticates (evidence: `app/Http/Controllers/AuthController.php`)
