# thusang08092007/-acs2-learning_method_recommendation_system architecture

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

- Interactive diagram: https://gitdiagram.com/thusang08092007/-acs2-learning_method_recommendation_system
- Repository: https://github.com/thusang08092007/-acs2-learning_method_recommendation_system

## Overview

This is a PHP learning-support application: learners register, complete a behavioral assessment, receive study-method recommendations, and can manage study plans and track progress. Separate areas provide community sharing, analytics, and administration. The graph follows the documented routing and sampled controller/model calls; several controller and view implementations were not excerpted, so their internal links are omitted where the evidence does not establish them.

Main entry points: [`app/core/Model.php`](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/Model.php) (Model data access), [`app/core/App.php`](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/App.php) (Router and dispatcher), [`app/controllers/AdminController.php`](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/AdminController.php) (Admin console), [`app/models/StudyMethod.php`](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/StudyMethod.php) (Study methods)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Request runtime"]
  node_web_entry["Web entry<br/>[index.php]"]
  node_router["Router and dispatcher<br/>[App.php]"]
  node_base_controller["Controller base<br/>[Controller.php]"]
  node_view_renderer["View renderer<br/>[View.php]"]
end

subgraph group_learning["Learning journey"]
  node_auth["Account access<br/>[AuthController.php]"]
  node_user_model["User accounts<br/>[User.php]"]
  node_home["Study method catalog<br/>[HomeController.php]"]
  node_assessment["Behavior assessment"]
  node_assessment_model["Assessment records<br/>[Assessment.php]"]
  node_scoring["Weighted scoring"]
  node_recommendations["Recommendations"]
  node_ai["AI assistance<br/>[AiService.php]"]
end

subgraph group_progress["Plans and insights"]
  node_plans["Study plans<br/>[PlanController.php]"]
  node_plan_model["Plan and tasks<br/>[Plan.php]"]
  node_analytics["Progress analytics"]
  node_sessions["Study sessions<br/>[StudySession.php]"]
end

subgraph group_community["Community"]
  node_community_controller["Community actions"]
  node_posts["Shared posts<br/>[Post.php]"]
  node_comments["Comments and moderation<br/>[Comment.php]"]
  node_profanity["Profanity filter"]
end

subgraph group_admin["Administration and data"]
  node_admin_controller["Admin console"]
  node_admin_model["Admin data<br/>[AdminModel.php]"]
  node_methods["Study methods<br/>[StudyMethod.php]"]
  node_subjects["Subjects<br/>[Subject.php]"]
  node_database_model["Model data access<br/>[Model.php]"]
  node_database[("MySQL connection<br/>[Database.php]")]
end

node_learner(("Learner"))
node_gemini{{"Gemini API"}}

node_learner -->|"sends requests"| node_web_entry
node_web_entry -->|"starts app"| node_router
node_router -->|"dispatches routes"| node_auth
node_router -->|"dispatches routes"| node_assessment
node_router -->|"dispatches routes"| node_recommendations
node_router -->|"dispatches routes"| node_plans
node_router -->|"dispatches routes"| node_analytics
node_router -->|"dispatches routes"| node_community_controller
node_router -->|"dispatches routes"| node_admin_controller
node_base_controller -->|"renders views"| node_view_renderer
node_assessment -->|"loads and saves"| node_assessment_model
node_assessment -->|"loads subjects"| node_subjects
node_assessment -->|"calculates scores"| node_scoring
node_recommendations -->|"reads results"| node_assessment_model
node_recommendations -->|"uses methods"| node_methods
node_recommendations -->|"requests AI help"| node_ai
node_ai -->|"calls API"| node_gemini
node_ai -->|"caches and logs"| node_database
node_auth -->|"reads and updates"| node_user_model
node_plans -->|"manages plans"| node_plan_model
node_plans -->|"loads subjects"| node_subjects
node_plans -->|"loads methods"| node_methods
node_analytics -->|"reads sessions"| node_sessions
node_analytics -->|"reads subjects"| node_subjects
node_analytics -->|"reads methods"| node_methods
node_community_controller -->|"creates and reads"| node_posts
node_community_controller -->|"loads and adds"| node_comments
node_community_controller -->|"loads methods"| node_methods
node_community_controller -->|"loads subjects"| node_subjects
node_comments -->|"filters text"| node_profanity
node_admin_controller -->|"uses admin data"| node_admin_model
node_admin_controller -->|"manages methods"| node_methods
node_admin_controller -->|"manages subjects"| node_subjects
node_admin_controller -->|"moderates comments"| node_comments
node_admin_controller -->|"manages users"| node_user_model
node_assessment_model -->|"uses data access"| node_database_model
node_user_model -->|"uses data access"| node_database_model
node_plan_model -->|"uses data access"| node_database_model
node_sessions -->|"uses data access"| node_database_model
node_posts -->|"uses data access"| node_database_model
node_comments -->|"uses data access"| node_database_model
node_methods -->|"uses data access"| node_database_model
node_subjects -->|"uses data access"| node_database_model
node_admin_model -->|"uses data access"| node_database_model
node_database_model -->|"gets connection"| node_database

click node_web_entry "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/public/index.php"
click node_router "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/App.php"
click node_base_controller "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/Controller.php"
click node_view_renderer "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/View.php"
click node_auth "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/AuthController.php"
click node_user_model "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/User.php"
click node_home "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/HomeController.php"
click node_assessment "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/AssessmentController.php"
click node_assessment_model "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/Assessment.php"
click node_scoring "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/services/WeightedScoringService.php"
click node_recommendations "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/RecommendationController.php"
click node_ai "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/services/AiService.php"
click node_plans "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/PlanController.php"
click node_plan_model "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/Plan.php"
click node_analytics "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/AnalyticsController.php"
click node_sessions "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/StudySession.php"
click node_community_controller "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/CommunityController.php"
click node_posts "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/Post.php"
click node_comments "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/Comment.php"
click node_profanity "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/services/ProfanityFilterService.php"
click node_admin_controller "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/AdminController.php"
click node_admin_model "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/AdminModel.php"
click node_methods "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/StudyMethod.php"
click node_subjects "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/Subject.php"
click node_database_model "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/Model.php"
click node_database "https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/Database.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_entry,node_router,node_base_controller,node_view_renderer toneBlue
class node_auth,node_user_model,node_home,node_assessment,node_assessment_model,node_scoring,node_recommendations,node_ai toneAmber
class node_plans,node_plan_model,node_analytics,node_sessions,node_gemini toneMint
class node_community_controller,node_posts,node_comments,node_profanity toneRose
class node_admin_controller,node_admin_model,node_methods,node_subjects,node_database_model,node_database,node_learner toneIndigo
```

## Components

### Request runtime

- [Web entry](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/public/index.php): `public/index.php`
- [Router and dispatcher](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/App.php): `app/core/App.php`
- [Controller base](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/Controller.php): `app/core/Controller.php`
- [View renderer](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/View.php): `app/core/View.php`

### Learning journey

- [Account access](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/AuthController.php): `app/controllers/AuthController.php`
- [User accounts](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/User.php): `app/models/User.php`
- [Study method catalog](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/HomeController.php): `app/controllers/HomeController.php`
- [Behavior assessment](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/AssessmentController.php): `app/controllers/AssessmentController.php`
- [Assessment records](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/Assessment.php): `app/models/Assessment.php`
- [Weighted scoring](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/services/WeightedScoringService.php): `app/services/WeightedScoringService.php`
- [Recommendations](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/RecommendationController.php): `app/controllers/RecommendationController.php`
- [AI assistance](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/services/AiService.php): `app/services/AiService.php`

### Plans and insights

- [Study plans](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/PlanController.php): `app/controllers/PlanController.php`
- [Plan and tasks](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/Plan.php): `app/models/Plan.php`
- [Progress analytics](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/AnalyticsController.php): `app/controllers/AnalyticsController.php`
- [Study sessions](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/StudySession.php): `app/models/StudySession.php`

### Community

- [Community actions](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/CommunityController.php): `app/controllers/CommunityController.php`
- [Shared posts](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/Post.php): `app/models/Post.php`
- [Comments and moderation](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/Comment.php): `app/models/Comment.php`
- [Profanity filter](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/services/ProfanityFilterService.php): `app/services/ProfanityFilterService.php`

### Administration and data

- [Admin console](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/controllers/AdminController.php): `app/controllers/AdminController.php`
- [Admin data](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/AdminModel.php): `app/models/AdminModel.php`
- [Study methods](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/StudyMethod.php): `app/models/StudyMethod.php`
- [Subjects](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/models/Subject.php): `app/models/Subject.php`
- [Model data access](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/Model.php): `app/core/Model.php`
- [MySQL connection](https://github.com/thusang08092007/-acs2-learning_method_recommendation_system/blob/main/app/core/Database.php): `app/core/Database.php`

### Other components

- **Learner**
- **Gemini API**

## Connections

- Learner → Web entry: sends requests (evidence: `public/index.php`)
- Web entry → Router and dispatcher: starts app (evidence: `public/index.php`)
- Router and dispatcher → Account access: dispatches routes (evidence: `app/core/App.php`)
- Router and dispatcher → Behavior assessment: dispatches routes (evidence: `app/core/App.php`)
- Router and dispatcher → Recommendations: dispatches routes (evidence: `app/core/App.php`)
- Router and dispatcher → Study plans: dispatches routes (evidence: `app/core/App.php`)
- Router and dispatcher → Progress analytics: dispatches routes (evidence: `app/core/App.php`)
- Router and dispatcher → Community actions: dispatches routes (evidence: `app/core/App.php`)
- Router and dispatcher → Admin console: dispatches routes (evidence: `app/core/App.php`)
- Controller base → View renderer: renders views (evidence: `app/core/Controller.php`)
- Behavior assessment → Assessment records: loads and saves (evidence: `app/controllers/AssessmentController.php`)
- Behavior assessment → Subjects: loads subjects (evidence: `app/controllers/AssessmentController.php`)
- Behavior assessment → Weighted scoring: calculates scores (evidence: `app/controllers/AssessmentController.php`)
- Recommendations → Assessment records: reads results (evidence: `app/controllers/RecommendationController.php`)
- Recommendations → Study methods: uses methods (evidence: `app/controllers/RecommendationController.php`)
- Recommendations → AI assistance: requests AI help (evidence: `app/controllers/RecommendationController.php`)
- AI assistance → Gemini API: calls API (evidence: `app/services/AiService.php`)
- AI assistance → MySQL connection: caches and logs (evidence: `app/services/AiService.php`)
- Account access → User accounts: reads and updates (evidence: `app/controllers/AuthController.php`)
- Study plans → Plan and tasks: manages plans (evidence: `app/controllers/PlanController.php`)
- Study plans → Subjects: loads subjects (evidence: `app/controllers/PlanController.php`)
- Study plans → Study methods: loads methods (evidence: `app/controllers/PlanController.php`)
- Progress analytics → Study sessions: reads sessions (evidence: `app/controllers/AnalyticsController.php`)
- Progress analytics → Subjects: reads subjects (evidence: `app/controllers/AnalyticsController.php`)
- Progress analytics → Study methods: reads methods (evidence: `app/controllers/AnalyticsController.php`)
- Community actions → Shared posts: creates and reads (evidence: `app/controllers/CommunityController.php`)
- Community actions → Comments and moderation: loads and adds (evidence: `app/controllers/CommunityController.php`)
- Community actions → Study methods: loads methods (evidence: `app/controllers/CommunityController.php`)
- Community actions → Subjects: loads subjects (evidence: `app/controllers/CommunityController.php`)
- Comments and moderation → Profanity filter: filters text (evidence: `app/models/Comment.php`)
- Admin console → Admin data: uses admin data (evidence: `app/controllers/AdminController.php`)
- Admin console → Study methods: manages methods (evidence: `app/controllers/AdminController.php`)
- Admin console → Subjects: manages subjects (evidence: `app/controllers/AdminController.php`)
- Admin console → Comments and moderation: moderates comments (evidence: `app/controllers/AdminController.php`)
- Admin console → User accounts: manages users (evidence: `app/controllers/AdminController.php`)
- Assessment records → Model data access: uses data access (evidence: `app/models/Assessment.php`)
- User accounts → Model data access: uses data access (evidence: `app/models/User.php`)
- Plan and tasks → Model data access: uses data access (evidence: `app/models/Plan.php`)
- Study sessions → Model data access: uses data access (evidence: `app/models/StudySession.php`)
- Shared posts → Model data access: uses data access (evidence: `app/models/Post.php`)
- Comments and moderation → Model data access: uses data access (evidence: `app/models/Comment.php`)
- Study methods → Model data access: uses data access (evidence: `app/models/StudyMethod.php`)
- Subjects → Model data access: uses data access (evidence: `app/models/Subject.php`)
- Admin data → Model data access: uses data access (evidence: `app/models/AdminModel.php`)
- Model data access → MySQL connection: gets connection (evidence: `app/core/Model.php`)
