# dibaliqaja/pesantren-cms architecture

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

- Interactive diagram: https://gitdiagram.com/dibaliqaja/pesantren-cms
- Repository: https://github.com/dibaliqaja/pesantren-cms

## Overview

Pesantren CMS is a Laravel management system for pesantren administrators and staff, with a separate santri-facing API. The main workflow is authenticated users managing student records, fees and payments, cash-book entries, correspondence, and user accounts; actions are recorded in an activity log and persisted through Eloquent models. The README also documents API authentication, profile/password changes, cash-book access, and syahriah payment history. API routes and several controllers were not excerpted, so their wiring is represented only where documented, not inferred.

Main entry points: [`routes/web.php`](https://github.com/dibaliqaja/pesantren-cms/blob/master/routes/web.php) (Web route dispatch), [`app/Helpers/LogActivity.php`](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Helpers/LogActivity.php) (Activity logger), [`routes/api.php`](https://github.com/dibaliqaja/pesantren-cms/blob/master/routes/api.php) (API route dispatch), [`app/Models/Santri.php`](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Models/Santri.php) (Student record)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Admin web panel"]
  node_web_login["Web authentication"]
  node_home["Dashboard<br/>[HomeController.php]"]
  node_students["Student management"]
  node_users["User management<br/>[UserController.php]"]
  node_costs["Fee configuration<br/>[CostController.php]"]
  node_registration["Registration payments"]
  node_syahriah["Syahriah payments"]
  node_cashbook["Cash book"]
  node_correspondence["Mail management"]
  node_outmail["Outgoing mail"]
  node_activity_view["Activity history"]
end

subgraph group_api["Santri API"]
  node_api_auth["API authentication<br/>[AuthController.php]"]
  node_api_cashbook["API cash book"]
  node_api_profile["Profile and password"]
  node_api_syahriah["Payment history"]
end

subgraph group_domain["Domain and persistence"]
  node_activity_helper["Activity logger<br/>[LogActivity.php]"]
  node_models[("Domain records")]
  node_user_model[("User and identity<br/>[User.php]")]
  node_santri_model[("Student record<br/>[Santri.php]")]
  node_syahriah_model[("Syahriah record<br/>[Syahriah.php]")]
  node_activity_model[("Activity record<br/>[LogActivity.php]")]
end

subgraph group_platform["Request and access"]
  node_web_routes["Web route dispatch<br/>[web.php]"]
  node_api_routes["API route dispatch<br/>[api.php]"]
  node_route_provider["Route registration"]
  node_authorization["Role authorization"]
  node_web_controller["Shared controller base<br/>[Controller.php]"]
end

node_admin(("Administrator / staff"))
node_santri_actor(("Santri app user"))

node_admin -->|"requests pages"| node_web_routes
node_santri_actor -.->|"uses API"| node_api_routes
node_route_provider -->|"registers routes"| node_web_routes
node_route_provider -->|"registers routes"| node_api_routes
node_web_routes -->|"dispatches"| node_web_login
node_web_routes -->|"dispatches"| node_home
node_web_routes -->|"dispatches"| node_students
node_web_routes -->|"dispatches"| node_users
node_web_routes -->|"dispatches"| node_costs
node_web_routes -->|"dispatches"| node_registration
node_web_routes -->|"dispatches"| node_syahriah
node_web_routes -->|"dispatches"| node_cashbook
node_web_routes -->|"dispatches"| node_correspondence
node_web_routes -->|"dispatches"| node_outmail
node_web_routes -->|"dispatches"| node_activity_view
node_api_routes -.->|"dispatches"| node_api_auth
node_api_routes -.->|"dispatches"| node_api_cashbook
node_api_routes -.->|"dispatches"| node_api_profile
node_api_routes -.->|"dispatches"| node_api_syahriah
node_web_login -->|"records activity"| node_activity_helper
node_students -->|"records activity"| node_activity_helper
node_students -->|"reads and writes"| node_santri_model
node_users -->|"records activity"| node_activity_helper
node_costs -->|"records activity"| node_activity_helper
node_registration -->|"records activity"| node_activity_helper
node_syahriah -->|"records activity"| node_activity_helper
node_cashbook -->|"records activity"| node_activity_helper
node_correspondence -->|"records activity"| node_activity_helper
node_outmail -->|"records activity"| node_activity_helper
node_activity_view -->|"queries history"| node_activity_model
node_activity_helper -->|"creates records"| node_activity_model
node_api_profile -->|"reads and updates"| node_user_model
node_api_profile -->|"reads and updates"| node_santri_model
node_api_profile -->|"records activity"| node_activity_helper
node_api_syahriah -->|"queries payments"| node_syahriah_model
node_api_syahriah -->|"uses identity"| node_user_model
node_web_login -.->|"authenticates"| node_user_model
node_authorization -->|"checks roles"| node_user_model
node_web_controller -.->|"base class"| node_students
node_santri_model -->|"relates user"| node_user_model
node_santri_model -->|"relates payments"| node_syahriah_model
node_syahriah_model -->|"belongs to"| node_santri_model

click node_web_routes "https://github.com/dibaliqaja/pesantren-cms/blob/master/routes/web.php"
click node_api_routes "https://github.com/dibaliqaja/pesantren-cms/blob/master/routes/api.php"
click node_route_provider "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Providers/RouteServiceProvider.php"
click node_web_login "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Auth/LoginController.php"
click node_home "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/HomeController.php"
click node_students "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/SantriController.php"
click node_users "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/UserController.php"
click node_costs "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/CostController.php"
click node_registration "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/RegistrationCostController.php"
click node_syahriah "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/SyahriahController.php"
click node_cashbook "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/CashBookController.php"
click node_correspondence "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/InMailController.php"
click node_outmail "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/OutMailController.php"
click node_activity_view "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/LogActivityController.php"
click node_api_auth "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Api/AuthController.php"
click node_api_cashbook "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Api/CashBookController.php"
click node_api_profile "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Api/ProfileController.php"
click node_api_syahriah "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Api/SyahriahController.php"
click node_activity_helper "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Helpers/LogActivity.php"
click node_models "https://github.com/dibaliqaja/pesantren-cms/tree/master/app/Models"
click node_user_model "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Models/User.php"
click node_santri_model "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Models/Santri.php"
click node_syahriah_model "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Models/Syahriah.php"
click node_activity_model "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Models/LogActivity.php"
click node_authorization "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Providers/AuthServiceProvider.php"
click node_web_controller "https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Controller.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_login,node_home,node_students,node_users,node_costs,node_registration,node_syahriah,node_cashbook,node_correspondence,node_outmail,node_activity_view,node_santri_actor toneBlue
class node_api_auth,node_api_cashbook,node_api_profile,node_api_syahriah toneAmber
class node_activity_helper,node_models,node_user_model,node_santri_model,node_syahriah_model,node_activity_model toneMint
class node_web_routes,node_api_routes,node_route_provider,node_authorization,node_web_controller toneRose
class node_admin toneIndigo
```

## Components

### Admin web panel

- [Web authentication](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Auth/LoginController.php): `app/Http/Controllers/Auth/LoginController.php`
- [Dashboard](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/HomeController.php): `app/Http/Controllers/Web/HomeController.php`
- [Student management](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/SantriController.php): `app/Http/Controllers/Web/SantriController.php`
- [User management](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/UserController.php): `app/Http/Controllers/Web/UserController.php`
- [Fee configuration](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/CostController.php): `app/Http/Controllers/Web/CostController.php`
- [Registration payments](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/RegistrationCostController.php): `app/Http/Controllers/Web/RegistrationCostController.php`
- [Syahriah payments](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/SyahriahController.php): `app/Http/Controllers/Web/SyahriahController.php`
- [Cash book](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/CashBookController.php): `app/Http/Controllers/Web/CashBookController.php`
- [Mail management](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/InMailController.php): `app/Http/Controllers/Web/InMailController.php`
- [Outgoing mail](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/OutMailController.php): `app/Http/Controllers/Web/OutMailController.php`
- [Activity history](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Web/LogActivityController.php): `app/Http/Controllers/Web/LogActivityController.php`

### Santri API

- [API authentication](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Api/AuthController.php): `app/Http/Controllers/Api/AuthController.php`
- [API cash book](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Api/CashBookController.php): `app/Http/Controllers/Api/CashBookController.php`
- [Profile and password](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Api/ProfileController.php): `app/Http/Controllers/Api/ProfileController.php`
- [Payment history](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Api/SyahriahController.php): `app/Http/Controllers/Api/SyahriahController.php`

### Domain and persistence

- [Activity logger](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Helpers/LogActivity.php): `app/Helpers/LogActivity.php`
- [Domain records](https://github.com/dibaliqaja/pesantren-cms/tree/master/app/Models): `app/Models`
- [User and identity](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Models/User.php): `app/Models/User.php`
- [Student record](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Models/Santri.php): `app/Models/Santri.php`
- [Syahriah record](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Models/Syahriah.php): `app/Models/Syahriah.php`
- [Activity record](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Models/LogActivity.php): `app/Models/LogActivity.php`

### Request and access

- [Web route dispatch](https://github.com/dibaliqaja/pesantren-cms/blob/master/routes/web.php): `routes/web.php`
- [API route dispatch](https://github.com/dibaliqaja/pesantren-cms/blob/master/routes/api.php): `routes/api.php`
- [Route registration](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Providers/RouteServiceProvider.php): `app/Providers/RouteServiceProvider.php`
- [Role authorization](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Providers/AuthServiceProvider.php): `app/Providers/AuthServiceProvider.php`
- [Shared controller base](https://github.com/dibaliqaja/pesantren-cms/blob/master/app/Http/Controllers/Controller.php): `app/Http/Controllers/Controller.php`

### Other components

- **Administrator / staff**
- **Santri app user**

## Connections

- Administrator / staff → Web route dispatch: requests pages (evidence: `routes/web.php`)
- Santri app user → API route dispatch: uses API
- Route registration → Web route dispatch: registers routes (evidence: `app/Providers/RouteServiceProvider.php`)
- Route registration → API route dispatch: registers routes (evidence: `app/Providers/RouteServiceProvider.php`)
- Web route dispatch → Web authentication: dispatches (evidence: `routes/web.php`)
- Web route dispatch → Dashboard: dispatches (evidence: `routes/web.php`)
- Web route dispatch → Student management: dispatches (evidence: `routes/web.php`)
- Web route dispatch → User management: dispatches (evidence: `routes/web.php`)
- Web route dispatch → Fee configuration: dispatches (evidence: `routes/web.php`)
- Web route dispatch → Registration payments: dispatches (evidence: `routes/web.php`)
- Web route dispatch → Syahriah payments: dispatches (evidence: `routes/web.php`)
- Web route dispatch → Cash book: dispatches (evidence: `routes/web.php`)
- Web route dispatch → Mail management: dispatches (evidence: `routes/web.php`)
- Web route dispatch → Outgoing mail: dispatches (evidence: `routes/web.php`)
- Web route dispatch → Activity history: dispatches (evidence: `routes/web.php`)
- API route dispatch → API authentication: dispatches
- API route dispatch → API cash book: dispatches
- API route dispatch → Profile and password: dispatches
- API route dispatch → Payment history: dispatches
- Web authentication → Activity logger: records activity (evidence: `app/Http/Controllers/Auth/LoginController.php`)
- Student management → Activity logger: records activity (evidence: `app/Http/Controllers/Web/SantriController.php`)
- Student management → Student record: reads and writes (evidence: `app/Http/Controllers/Web/SantriController.php`)
- User management → Activity logger: records activity (evidence: `app/Http/Controllers/Web/UserController.php`)
- Fee configuration → Activity logger: records activity (evidence: `app/Http/Controllers/Web/CostController.php`)
- Registration payments → Activity logger: records activity (evidence: `app/Http/Controllers/Web/RegistrationCostController.php`)
- Syahriah payments → Activity logger: records activity (evidence: `app/Http/Controllers/Web/SyahriahController.php`)
- Cash book → Activity logger: records activity (evidence: `app/Http/Controllers/Web/CashBookController.php`)
- Mail management → Activity logger: records activity (evidence: `app/Http/Controllers/Web/InMailController.php`)
- Outgoing mail → Activity logger: records activity (evidence: `app/Http/Controllers/Web/OutMailController.php`)
- Activity history → Activity record: queries history (evidence: `app/Http/Controllers/Web/LogActivityController.php`)
- Activity logger → Activity record: creates records (evidence: `app/Helpers/LogActivity.php`)
- Profile and password → User and identity: reads and updates (evidence: `app/Http/Controllers/Api/ProfileController.php`)
- Profile and password → Student record: reads and updates (evidence: `app/Http/Controllers/Api/ProfileController.php`)
- Profile and password → Activity logger: records activity (evidence: `app/Http/Controllers/Api/ProfileController.php`)
- Payment history → Syahriah record: queries payments (evidence: `app/Http/Controllers/Api/SyahriahController.php`)
- Payment history → User and identity: uses identity (evidence: `app/Http/Controllers/Api/SyahriahController.php`)
- Web authentication → User and identity: authenticates (evidence: `app/Http/Controllers/Auth/LoginController.php`)
- Role authorization → User and identity: checks roles (evidence: `app/Providers/AuthServiceProvider.php`)
- Shared controller base → Student management: base class (evidence: `app/Http/Controllers/Web/SantriController.php`)
- Student record → User and identity: relates user (evidence: `app/Models/Santri.php`)
- Student record → Syahriah record: relates payments (evidence: `app/Models/Santri.php`)
- Syahriah record → Student record: belongs to (evidence: `app/Models/Syahriah.php`)
