# luhur65/emkl-approval architecture

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

- Interactive diagram: https://gitdiagram.com/luhur65/emkl-approval
- Repository: https://github.com/luhur65/emkl-approval

## Overview

This is a CodeIgniter 4 EMKL operations and internal-approval application. Users authenticate, enter operational requests or open approval grids, review records through server-side AJAX, and submit approval or rejection actions. The documented domains include Trip, PO, Pengajuan, Absensi, extra-driver, and price-offer approvals, plus trucking-related operations. Services mediate controller workflows and grid processing; models access SQL Server data. The graph follows documented routes and sampled/indexed references. Several domain implementations and views were not sampled, so their internal calls are not inferred.

Main entry points: [`app/Config/Routes.php`](https://github.com/luhur65/emkl-approval/blob/main/app/Config/Routes.php) (Route map), [`app/Controllers/ApprovalTrip.php`](https://github.com/luhur65/emkl-approval/blob/main/app/Controllers/ApprovalTrip.php) (Trip controller), [`app/Controllers/Pengajuan.php`](https://github.com/luhur65/emkl-approval/blob/main/app/Controllers/Pengajuan.php) (Driver request entry), [`app/Services`](https://github.com/luhur65/emkl-approval/tree/main/app/Services) (Approval services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and routing"]
  node_front["Web entry<br/>[index.php]"]
  node_routes["Route map<br/>[Routes.php]"]
  node_auth["Login<br/>[Login.php]"]
  node_authfilter["Session filter<br/>[AuthFilter.php]"]
end

subgraph group_operations["Operations and entry"]
  node_home["Home<br/>[Home.php]"]
  node_request["Driver request entry<br/>[Pengajuan.php]"]
  node_requestservice["Driver request service"]
  node_tripentryservice["Trip entry service"]
  node_views["Application views"]
end

subgraph group_approvals["Approval workflows"]
  node_tripcontroller["Trip controller<br/>[ApprovalTrip.php]"]
  node_tripservice["Trip services"]
  node_othercontrollers["Approval controllers"]
  node_otherapprovalservices["Approval services"]
end

subgraph group_data["Data and grid"]
  node_authmodel["Credential lookup<br/>[AuthModel.php]"]
  node_grid["Grid processing<br/>[GridPipeline.php]"]
  node_tripmodel["Trip data access"]
  node_sqlserver[("SQL Server")]
end

node_user(("Employee"))

node_user -->|"sends requests"| node_front
node_front -.->|"dispatches through"| node_routes
node_routes -->|"routes login"| node_auth
node_auth -->|"validates credentials"| node_authmodel
node_routes -->|"routes Trip"| node_tripcontroller
node_routes -->|"routes approvals"| node_othercontrollers
node_authfilter -->|"redirects unauthenticated"| node_auth
node_routes -->|"routes home"| node_home
node_routes -->|"routes requests"| node_request
node_request -->|"delegates operations"| node_requestservice
node_tripcontroller -->|"delegates approval"| node_tripservice
node_tripcontroller -->|"delegates entry"| node_tripentryservice
node_othercontrollers -.->|"uses services"| node_otherapprovalservices
node_otherapprovalservices -->|"filters and sorts"| node_grid
node_otherapprovalservices -->|"reuses pipeline"| node_grid
node_tripservice -.->|"reads trip data"| node_tripmodel
node_tripmodel -.->|"queries"| node_sqlserver
node_authmodel -.->|"checks credentials"| node_sqlserver
node_request -.->|"renders pages"| node_views
node_tripcontroller -.->|"renders pages"| node_views

click node_front "https://github.com/luhur65/emkl-approval/blob/main/public/index.php"
click node_routes "https://github.com/luhur65/emkl-approval/blob/main/app/Config/Routes.php"
click node_auth "https://github.com/luhur65/emkl-approval/blob/main/app/Controllers/Login.php"
click node_authmodel "https://github.com/luhur65/emkl-approval/blob/main/app/Models/AuthModel.php"
click node_authfilter "https://github.com/luhur65/emkl-approval/blob/main/app/Filters/AuthFilter.php"
click node_home "https://github.com/luhur65/emkl-approval/blob/main/app/Controllers/Home.php"
click node_request "https://github.com/luhur65/emkl-approval/blob/main/app/Controllers/Pengajuan.php"
click node_requestservice "https://github.com/luhur65/emkl-approval/blob/main/app/Services/PengajuanSupirSerapService.php"
click node_tripcontroller "https://github.com/luhur65/emkl-approval/blob/main/app/Controllers/ApprovalTrip.php"
click node_tripservice "https://github.com/luhur65/emkl-approval/blob/main/app/Services/ApprovalTripService.php"
click node_tripentryservice "https://github.com/luhur65/emkl-approval/blob/main/app/Services/PengajuanTripService.php"
click node_othercontrollers "https://github.com/luhur65/emkl-approval/tree/main/app/Controllers"
click node_otherapprovalservices "https://github.com/luhur65/emkl-approval/tree/main/app/Services"
click node_grid "https://github.com/luhur65/emkl-approval/blob/main/app/Services/GridPipeline.php"
click node_tripmodel "https://github.com/luhur65/emkl-approval/blob/main/app/Models/ApprovalTripModel.php"
click node_views "https://github.com/luhur65/emkl-approval/tree/main/app/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_front,node_routes,node_auth,node_authfilter toneBlue
class node_home,node_request,node_requestservice,node_tripentryservice,node_views toneAmber
class node_tripcontroller,node_tripservice,node_othercontrollers,node_otherapprovalservices toneMint
class node_authmodel,node_grid,node_tripmodel,node_sqlserver toneRose
class node_user toneIndigo
```

## Components

### Access and routing

- [Web entry](https://github.com/luhur65/emkl-approval/blob/main/public/index.php): `public/index.php`
- [Route map](https://github.com/luhur65/emkl-approval/blob/main/app/Config/Routes.php): `app/Config/Routes.php`
- [Login](https://github.com/luhur65/emkl-approval/blob/main/app/Controllers/Login.php): `app/Controllers/Login.php`
- [Session filter](https://github.com/luhur65/emkl-approval/blob/main/app/Filters/AuthFilter.php): `app/Filters/AuthFilter.php`

### Operations and entry

- [Home](https://github.com/luhur65/emkl-approval/blob/main/app/Controllers/Home.php): `app/Controllers/Home.php`
- [Driver request entry](https://github.com/luhur65/emkl-approval/blob/main/app/Controllers/Pengajuan.php): `app/Controllers/Pengajuan.php`
- [Driver request service](https://github.com/luhur65/emkl-approval/blob/main/app/Services/PengajuanSupirSerapService.php): `app/Services/PengajuanSupirSerapService.php`
- [Trip entry service](https://github.com/luhur65/emkl-approval/blob/main/app/Services/PengajuanTripService.php): `app/Services/PengajuanTripService.php`
- [Application views](https://github.com/luhur65/emkl-approval/tree/main/app/Views): `app/Views`

### Approval workflows

- [Trip controller](https://github.com/luhur65/emkl-approval/blob/main/app/Controllers/ApprovalTrip.php): `app/Controllers/ApprovalTrip.php`
- [Trip services](https://github.com/luhur65/emkl-approval/blob/main/app/Services/ApprovalTripService.php): `app/Services/ApprovalTripService.php`
- [Approval controllers](https://github.com/luhur65/emkl-approval/tree/main/app/Controllers): `app/Controllers`
- [Approval services](https://github.com/luhur65/emkl-approval/tree/main/app/Services): `app/Services`

### Data and grid

- [Credential lookup](https://github.com/luhur65/emkl-approval/blob/main/app/Models/AuthModel.php): `app/Models/AuthModel.php`
- [Grid processing](https://github.com/luhur65/emkl-approval/blob/main/app/Services/GridPipeline.php): `app/Services/GridPipeline.php`
- [Trip data access](https://github.com/luhur65/emkl-approval/blob/main/app/Models/ApprovalTripModel.php): `app/Models/ApprovalTripModel.php`
- **SQL Server**

### Other components

- **Employee**

## Connections

- Employee → Web entry: sends requests (evidence: `public/index.php`)
- Web entry → Route map: dispatches through
- Route map → Login: routes login (evidence: `app/Config/Routes.php`)
- Login → Credential lookup: validates credentials (evidence: `app/Controllers/Login.php`)
- Route map → Trip controller: routes Trip (evidence: `app/Config/Routes.php`)
- Route map → Approval controllers: routes approvals (evidence: `app/Config/Routes.php`)
- Session filter → Login: redirects unauthenticated (evidence: `app/Filters/AuthFilter.php`)
- Route map → Home: routes home (evidence: `app/Config/Routes.php`)
- Route map → Driver request entry: routes requests (evidence: `app/Config/Routes.php`)
- Driver request entry → Driver request service: delegates operations (evidence: `app/Controllers/Pengajuan.php`)
- Trip controller → Trip services: delegates approval (evidence: `app/Controllers/ApprovalTrip.php`)
- Trip controller → Trip entry service: delegates entry (evidence: `app/Controllers/ApprovalTrip.php`)
- Approval controllers → Approval services: uses services (evidence: `app/Controllers/ApprovalTrip.php`)
- Approval services → Grid processing: filters and sorts (evidence: `app/Services/ApprovalPoService.php`)
- Approval services → Grid processing: reuses pipeline (evidence: `app/Services/ApprovalExtraSupirService.php`)
- Trip services → Trip data access: reads trip data
- Trip data access → SQL Server: queries
- Credential lookup → SQL Server: checks credentials
- Driver request entry → Application views: renders pages
- Trip controller → Application views: renders pages
