# irhamzakki/midcare architecture

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

- Interactive diagram: https://gitdiagram.com/irhamzakki/midcare
- Repository: https://github.com/irhamzakki/midcare

## Overview

MidCare is a role-based mental-health screening and patient-management web app. Its central workflow presents a questionnaire, submits responses for risk clustering, persists screening and patient records, and returns a result; patients can then view history and recovery recommendations. Admin and psychologist branches cover content and clinical oversight. The screening controller excerpt supports the prediction and persistence links shown; other role capabilities are documented in the README, while their detailed routes and controller wiring were not sampled.

Main entry points: [`app/Http/Controllers/ScreeningController.php`](https://github.com/irhamzakki/midcare/blob/main/app/Http/Controllers/ScreeningController.php) (Screening Handler), [`config/database.php`](https://github.com/irhamzakki/midcare/blob/main/config/database.php) (Application Database), [`app/Http/Controllers/Pasien/DashboardController.php`](https://github.com/irhamzakki/midcare/blob/main/app/Http/Controllers/Pasien/DashboardController.php) (Patient Dashboard), [`app/Http/Controllers/Psikolog`](https://github.com/irhamzakki/midcare/tree/main/app/Http/Controllers/Psikolog) (Psychologist Operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_screening["Screening &amp; Results"]
  node_screening_form["Screening Form"]
  node_screening_controller["Screening Handler"]
  node_predictor["K-Means Predictor<br/>[predict.py]"]
  node_screening_record["Screening Records<br/>[Screening.php]"]
  node_feature_record["Response Features<br/>[FiturPengguna.php]"]
  node_cluster_record["Cluster Results"]
  node_result_history["Result History"]
end

subgraph group_clinical["Clinical Operations"]
  node_patient_record["Patient Records<br/>[Pasien.php]"]
  node_patient_dashboard["Patient Dashboard"]
  node_psychologist_ops["Psychologist Operations"]
  node_admin_ops["Admin Management"]
  node_patient_views["Patient Screens"]
  node_psychologist_views["Psychologist Screens"]
  node_admin_views["Admin Screens"]
end

subgraph group_content["Content &amp; Education"]
  node_article_model["Articles<br/>[Artikel.php]"]
  node_education_model["Education Materials<br/>[Edukasi.php]"]
  node_content_views["Public Content"]
end

subgraph group_access["Access &amp; Application"]
  node_web_routes["Web Routes<br/>[web.php]"]
  node_user_account["User Accounts<br/>[User.php]"]
  node_registration["Registration"]
  node_database[("Application Database<br/>[database.php]")]
end

node_respondent(("Respondent"))

node_respondent -->|"opens"| node_web_routes
node_web_routes -->|"dispatches"| node_screening_controller
node_screening_controller -->|"renders"| node_screening_form
node_respondent -->|"answers"| node_screening_form
node_screening_form -->|"submits"| node_screening_controller
node_screening_controller -.->|"invokes"| node_predictor
node_screening_controller -->|"writes"| node_screening_record
node_screening_controller -->|"writes"| node_feature_record
node_screening_controller -->|"writes"| node_cluster_record
node_screening_controller -->|"creates"| node_patient_record
node_screening_controller -->|"persists via"| node_database
node_patient_dashboard -->|"reads"| node_cluster_record
node_patient_dashboard -->|"counts"| node_article_model
node_patient_dashboard -->|"counts"| node_education_model
node_patient_dashboard -->|"renders"| node_patient_views
node_result_history -->|"reads and links"| node_cluster_record
node_result_history -->|"updates ownership"| node_database
node_psychologist_ops -->|"reviews"| node_screening_record
node_psychologist_ops -->|"analyzes"| node_feature_record
node_psychologist_ops -->|"monitors"| node_patient_record
node_psychologist_ops -->|"renders"| node_psychologist_views
node_admin_ops -->|"renders"| node_admin_views
node_admin_ops -->|"manages"| node_article_model
node_admin_ops -->|"manages"| node_education_model
node_registration -->|"creates"| node_user_account
node_registration -->|"creates for patients"| node_patient_record
node_registration -->|"redirects to role pages"| node_web_routes
node_article_model -->|"persists via"| node_database
node_education_model -->|"persists via"| node_database
node_screening_record -->|"persists via"| node_database
node_feature_record -->|"persists via"| node_database
node_cluster_record -->|"persists via"| node_database
node_patient_record -->|"persists via"| node_database
node_user_account -->|"persists via"| node_database
node_content_views -->|"presents resources"| node_respondent

click node_web_routes "https://github.com/irhamzakki/midcare/blob/main/routes/web.php"
click node_screening_form "https://github.com/irhamzakki/midcare/blob/main/resources/views/screening.blade.php"
click node_screening_controller "https://github.com/irhamzakki/midcare/blob/main/app/Http/Controllers/ScreeningController.php"
click node_predictor "https://github.com/irhamzakki/midcare/blob/main/Kmeans/predict.py"
click node_screening_record "https://github.com/irhamzakki/midcare/blob/main/app/Models/Screening.php"
click node_feature_record "https://github.com/irhamzakki/midcare/blob/main/app/Models/FiturPengguna.php"
click node_cluster_record "https://github.com/irhamzakki/midcare/blob/main/app/Models/HasilClustering.php"
click node_patient_record "https://github.com/irhamzakki/midcare/blob/main/app/Models/Pasien.php"
click node_patient_dashboard "https://github.com/irhamzakki/midcare/blob/main/app/Http/Controllers/Pasien/DashboardController.php"
click node_result_history "https://github.com/irhamzakki/midcare/blob/main/app/Http/Controllers/Pengguna/HasilController.php"
click node_psychologist_ops "https://github.com/irhamzakki/midcare/tree/main/app/Http/Controllers/Psikolog"
click node_admin_ops "https://github.com/irhamzakki/midcare/tree/main/app/Http/Controllers/Admin"
click node_article_model "https://github.com/irhamzakki/midcare/blob/main/app/Models/Artikel.php"
click node_education_model "https://github.com/irhamzakki/midcare/blob/main/app/Models/Edukasi.php"
click node_user_account "https://github.com/irhamzakki/midcare/blob/main/app/Models/User.php"
click node_registration "https://github.com/irhamzakki/midcare/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_database "https://github.com/irhamzakki/midcare/blob/main/config/database.php"
click node_patient_views "https://github.com/irhamzakki/midcare/tree/main/resources/views/Pasien"
click node_psychologist_views "https://github.com/irhamzakki/midcare/tree/main/resources/views/Psikolog"
click node_admin_views "https://github.com/irhamzakki/midcare/tree/main/resources/views/Admin"
click node_content_views "https://github.com/irhamzakki/midcare/tree/main/resources/views"

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_screening_form,node_screening_controller,node_predictor,node_screening_record,node_feature_record,node_cluster_record,node_result_history toneBlue
class node_patient_record,node_patient_dashboard,node_psychologist_ops,node_admin_ops,node_patient_views,node_psychologist_views,node_admin_views toneAmber
class node_article_model,node_education_model,node_content_views toneMint
class node_web_routes,node_user_account,node_registration,node_database toneRose
class node_respondent toneIndigo
```

## Components

### Screening & Results

- [Screening Form](https://github.com/irhamzakki/midcare/blob/main/resources/views/screening.blade.php): `resources/views/screening.blade.php`
- [Screening Handler](https://github.com/irhamzakki/midcare/blob/main/app/Http/Controllers/ScreeningController.php): `app/Http/Controllers/ScreeningController.php`
- [K-Means Predictor](https://github.com/irhamzakki/midcare/blob/main/Kmeans/predict.py): `Kmeans/predict.py`
- [Screening Records](https://github.com/irhamzakki/midcare/blob/main/app/Models/Screening.php): `app/Models/Screening.php`
- [Response Features](https://github.com/irhamzakki/midcare/blob/main/app/Models/FiturPengguna.php): `app/Models/FiturPengguna.php`
- [Cluster Results](https://github.com/irhamzakki/midcare/blob/main/app/Models/HasilClustering.php): `app/Models/HasilClustering.php`
- [Result History](https://github.com/irhamzakki/midcare/blob/main/app/Http/Controllers/Pengguna/HasilController.php): `app/Http/Controllers/Pengguna/HasilController.php`

### Clinical Operations

- [Patient Records](https://github.com/irhamzakki/midcare/blob/main/app/Models/Pasien.php): `app/Models/Pasien.php`
- [Patient Dashboard](https://github.com/irhamzakki/midcare/blob/main/app/Http/Controllers/Pasien/DashboardController.php): `app/Http/Controllers/Pasien/DashboardController.php`
- [Psychologist Operations](https://github.com/irhamzakki/midcare/tree/main/app/Http/Controllers/Psikolog): `app/Http/Controllers/Psikolog`
- [Admin Management](https://github.com/irhamzakki/midcare/tree/main/app/Http/Controllers/Admin): `app/Http/Controllers/Admin`
- [Patient Screens](https://github.com/irhamzakki/midcare/tree/main/resources/views/Pasien): `resources/views/Pasien`
- [Psychologist Screens](https://github.com/irhamzakki/midcare/tree/main/resources/views/Psikolog): `resources/views/Psikolog`
- [Admin Screens](https://github.com/irhamzakki/midcare/tree/main/resources/views/Admin): `resources/views/Admin`

### Content & Education

- [Articles](https://github.com/irhamzakki/midcare/blob/main/app/Models/Artikel.php): `app/Models/Artikel.php`
- [Education Materials](https://github.com/irhamzakki/midcare/blob/main/app/Models/Edukasi.php): `app/Models/Edukasi.php`
- [Public Content](https://github.com/irhamzakki/midcare/tree/main/resources/views): `resources/views`

### Access & Application

- [Web Routes](https://github.com/irhamzakki/midcare/blob/main/routes/web.php): `routes/web.php`
- [User Accounts](https://github.com/irhamzakki/midcare/blob/main/app/Models/User.php): `app/Models/User.php`
- [Registration](https://github.com/irhamzakki/midcare/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Application Database](https://github.com/irhamzakki/midcare/blob/main/config/database.php): `config/database.php`

### Other components

- **Respondent**

## Connections

- Respondent → Web Routes: opens
- Web Routes → Screening Handler: dispatches
- Screening Handler → Screening Form: renders
- Respondent → Screening Form: answers
- Screening Form → Screening Handler: submits
- Screening Handler → K-Means Predictor: invokes
- Screening Handler → Screening Records: writes
- Screening Handler → Response Features: writes
- Screening Handler → Cluster Results: writes
- Screening Handler → Patient Records: creates
- Screening Handler → Application Database: persists via
- Patient Dashboard → Cluster Results: reads
- Patient Dashboard → Articles: counts
- Patient Dashboard → Education Materials: counts
- Patient Dashboard → Patient Screens: renders
- Result History → Cluster Results: reads and links
- Result History → Application Database: updates ownership
- Psychologist Operations → Screening Records: reviews
- Psychologist Operations → Response Features: analyzes
- Psychologist Operations → Patient Records: monitors
- Psychologist Operations → Psychologist Screens: renders
- Admin Management → Admin Screens: renders
- Admin Management → Articles: manages
- Admin Management → Education Materials: manages
- Registration → User Accounts: creates
- Registration → Patient Records: creates for patients
- Registration → Web Routes: redirects to role pages
- Articles → Application Database: persists via
- Education Materials → Application Database: persists via
- Screening Records → Application Database: persists via
- Response Features → Application Database: persists via
- Cluster Results → Application Database: persists via
- Patient Records → Application Database: persists via
- User Accounts → Application Database: persists via
- Public Content → Respondent: presents resources
