# cresusjpt/habilite architecture

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

- Interactive diagram: https://gitdiagram.com/cresusjpt/habilite
- Repository: https://github.com/cresusjpt/habilite

## Overview

This Yii2 application appears to manage internal habilitation requests: users submit requests, which are assigned approval levels and processed through validation and signature steps. The sampled controllers and models support that workflow, alongside user/service administration and PDF generation. The README describes the project as a Material Design Yii2 template rather than documenting these business capabilities; relationships below rely on the sampled source and SOURCE INDEX, so unsampled controllers and integrations are represented cautiously.

Main entry points: [`models/Demande.php`](https://github.com/cresusjpt/habilite/blob/master/models/Demande.php) (Habilitation request), [`controllers/NiveauController.php`](https://github.com/cresusjpt/habilite/blob/master/controllers/NiveauController.php) (Approval handling), [`models/Utilisateur.php`](https://github.com/cresusjpt/habilite/blob/master/models/Utilisateur.php) (User identity), [`models/Niveau.php`](https://github.com/cresusjpt/habilite/blob/master/models/Niveau.php) (Approval level)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_requests["Request workflow"]
  node_request_controller["Request handling"]
  node_request["Habilitation request<br/>[Demande.php]"]
  node_approval_controller["Approval handling"]
  node_approval_step["Approval level<br/>[Niveau.php]"]
  node_request_state["Request state<br/>[EtatDemande.php]"]
  node_signature["Electronic signature<br/>[Signature.php]"]
  node_validation["Validation rules<br/>[Valider.php]"]
  node_notifications["Notifications<br/>[Notification.php]"]
end

subgraph group_identity["Users and access"]
  node_user_controller["User handling"]
  node_user_model["User identity<br/>[Utilisateur.php]"]
  node_profile["Profiles<br/>[Profil.php]"]
  node_user_profile["User profiles<br/>[UserProfil.php]"]
end

subgraph group_records["Reference data"]
  node_habilitation["Habilitation catalog<br/>[Habilitation.php]"]
  node_service["Service catalog<br/>[Service.php]"]
  node_sysparam["Application parameters<br/>[SysParam.php]"]
end

subgraph group_documents["Document output"]
  node_pdf_controller["PDF utilities<br/>[PDFUtils.php]"]
  node_jspdf_entry["jsPDF entry<br/>[main.js]"]
  node_jspdf_core["jsPDF core<br/>[jspdf.js]"]
  node_jspdf_context["Canvas rendering<br/>[context2d.js]"]
end

subgraph group_runtime["Application runtime"]
  node_database[("Application database<br/>[db.php]")]
end

node_user(("User"))

node_user -.->|"submits request"| node_request_controller
node_request_controller -->|"saves request"| node_request
node_request_controller -->|"creates levels"| node_approval_step
node_request_controller -->|"loads habilitation"| node_habilitation
node_request -->|"references"| node_habilitation
node_request -->|"references requester"| node_user_model
node_request -->|"has approval levels"| node_approval_step
node_approval_controller -->|"loads request"| node_request
node_approval_controller -->|"processes level"| node_approval_step
node_approval_controller -->|"checks state"| node_request_state
node_approval_controller -.->|"uses notifications"| node_notifications
node_approval_controller -.->|"uses signature"| node_signature
node_approval_controller -->|"loads service"| node_service
node_approval_step -->|"references state"| node_request_state
node_approval_step -->|"references request"| node_request
node_habilitation -->|"has requests"| node_request
node_habilitation -->|"has validation rules"| node_validation
node_service -->|"has validation rules"| node_validation
node_user_controller -.->|"manages users"| node_user_model
node_user_model -->|"references service"| node_service
node_user_model -->|"has signatures"| node_signature
node_user_model -->|"references profiles"| node_profile
node_profile -->|"uses assignments"| node_user_profile
node_pdf_controller -->|"reads request"| node_request
node_pdf_controller -->|"reads signature"| node_signature
node_jspdf_entry -->|"imports core"| node_jspdf_core
node_jspdf_entry -->|"imports plugin"| node_jspdf_context

click node_request_controller "https://github.com/cresusjpt/habilite/blob/master/controllers/DemandeController.php"
click node_request "https://github.com/cresusjpt/habilite/blob/master/models/Demande.php"
click node_approval_controller "https://github.com/cresusjpt/habilite/blob/master/controllers/NiveauController.php"
click node_approval_step "https://github.com/cresusjpt/habilite/blob/master/models/Niveau.php"
click node_request_state "https://github.com/cresusjpt/habilite/blob/master/models/EtatDemande.php"
click node_signature "https://github.com/cresusjpt/habilite/blob/master/models/Signature.php"
click node_validation "https://github.com/cresusjpt/habilite/blob/master/models/Valider.php"
click node_notifications "https://github.com/cresusjpt/habilite/blob/master/models/Notification.php"
click node_user_controller "https://github.com/cresusjpt/habilite/blob/master/controllers/UtilisateurController.php"
click node_user_model "https://github.com/cresusjpt/habilite/blob/master/models/Utilisateur.php"
click node_profile "https://github.com/cresusjpt/habilite/blob/master/models/Profil.php"
click node_user_profile "https://github.com/cresusjpt/habilite/blob/master/models/UserProfil.php"
click node_habilitation "https://github.com/cresusjpt/habilite/blob/master/models/Habilitation.php"
click node_service "https://github.com/cresusjpt/habilite/blob/master/models/Service.php"
click node_sysparam "https://github.com/cresusjpt/habilite/blob/master/models/SysParam.php"
click node_database "https://github.com/cresusjpt/habilite/blob/master/config/db.php"
click node_pdf_controller "https://github.com/cresusjpt/habilite/blob/master/controllers/PDFUtils.php"
click node_jspdf_entry "https://github.com/cresusjpt/habilite/blob/master/web/jsPDF/main.js"
click node_jspdf_core "https://github.com/cresusjpt/habilite/blob/master/web/jsPDF/jspdf.js"
click node_jspdf_context "https://github.com/cresusjpt/habilite/blob/master/web/jsPDF/plugins/context2d.js"

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_request_controller,node_request,node_approval_controller,node_approval_step,node_request_state,node_signature,node_validation,node_notifications,node_user toneBlue
class node_user_controller,node_user_model,node_profile,node_user_profile toneAmber
class node_habilitation,node_service,node_sysparam toneMint
class node_pdf_controller,node_jspdf_entry,node_jspdf_core,node_jspdf_context toneRose
class node_database toneIndigo
```

## Components

### Request workflow

- [Request handling](https://github.com/cresusjpt/habilite/blob/master/controllers/DemandeController.php): `controllers/DemandeController.php`
- [Habilitation request](https://github.com/cresusjpt/habilite/blob/master/models/Demande.php): `models/Demande.php`
- [Approval handling](https://github.com/cresusjpt/habilite/blob/master/controllers/NiveauController.php): `controllers/NiveauController.php`
- [Approval level](https://github.com/cresusjpt/habilite/blob/master/models/Niveau.php): `models/Niveau.php`
- [Request state](https://github.com/cresusjpt/habilite/blob/master/models/EtatDemande.php): `models/EtatDemande.php`
- [Electronic signature](https://github.com/cresusjpt/habilite/blob/master/models/Signature.php): `models/Signature.php`
- [Validation rules](https://github.com/cresusjpt/habilite/blob/master/models/Valider.php): `models/Valider.php`
- [Notifications](https://github.com/cresusjpt/habilite/blob/master/models/Notification.php): `models/Notification.php`

### Users and access

- [User handling](https://github.com/cresusjpt/habilite/blob/master/controllers/UtilisateurController.php): `controllers/UtilisateurController.php`
- [User identity](https://github.com/cresusjpt/habilite/blob/master/models/Utilisateur.php): `models/Utilisateur.php`
- [Profiles](https://github.com/cresusjpt/habilite/blob/master/models/Profil.php): `models/Profil.php`
- [User profiles](https://github.com/cresusjpt/habilite/blob/master/models/UserProfil.php): `models/UserProfil.php`

### Reference data

- [Habilitation catalog](https://github.com/cresusjpt/habilite/blob/master/models/Habilitation.php): `models/Habilitation.php`
- [Service catalog](https://github.com/cresusjpt/habilite/blob/master/models/Service.php): `models/Service.php`
- [Application parameters](https://github.com/cresusjpt/habilite/blob/master/models/SysParam.php): `models/SysParam.php`

### Document output

- [PDF utilities](https://github.com/cresusjpt/habilite/blob/master/controllers/PDFUtils.php): `controllers/PDFUtils.php`
- [jsPDF entry](https://github.com/cresusjpt/habilite/blob/master/web/jsPDF/main.js): `web/jsPDF/main.js`
- [jsPDF core](https://github.com/cresusjpt/habilite/blob/master/web/jsPDF/jspdf.js): `web/jsPDF/jspdf.js`
- [Canvas rendering](https://github.com/cresusjpt/habilite/blob/master/web/jsPDF/plugins/context2d.js): `web/jsPDF/plugins/context2d.js`

### Application runtime

- [Application database](https://github.com/cresusjpt/habilite/blob/master/config/db.php): `config/db.php`

### Other components

- **User**

## Connections

- User → Request handling: submits request
- Request handling → Habilitation request: saves request (evidence: `controllers/DemandeController.php`)
- Request handling → Approval level: creates levels (evidence: `controllers/DemandeController.php`)
- Request handling → Habilitation catalog: loads habilitation (evidence: `controllers/DemandeController.php`)
- Habilitation request → Habilitation catalog: references (evidence: `models/Demande.php`)
- Habilitation request → User identity: references requester (evidence: `models/Demande.php`)
- Habilitation request → Approval level: has approval levels (evidence: `models/Demande.php`)
- Approval handling → Habilitation request: loads request (evidence: `controllers/NiveauController.php`)
- Approval handling → Approval level: processes level (evidence: `controllers/NiveauController.php`)
- Approval handling → Request state: checks state (evidence: `controllers/NiveauController.php`)
- Approval handling → Notifications: uses notifications (evidence: `controllers/NiveauController.php`)
- Approval handling → Electronic signature: uses signature (evidence: `controllers/NiveauController.php`)
- Approval handling → Service catalog: loads service (evidence: `controllers/NiveauController.php`)
- Approval level → Request state: references state (evidence: `models/Niveau.php`)
- Approval level → Habilitation request: references request (evidence: `models/Niveau.php`)
- Habilitation catalog → Habilitation request: has requests (evidence: `models/Habilitation.php`)
- Habilitation catalog → Validation rules: has validation rules (evidence: `models/Habilitation.php`)
- Service catalog → Validation rules: has validation rules (evidence: `models/Service.php`)
- User handling → User identity: manages users
- User identity → Service catalog: references service (evidence: `models/Utilisateur.php`)
- User identity → Electronic signature: has signatures (evidence: `models/Utilisateur.php`)
- User identity → Profiles: references profiles (evidence: `models/Profil.php`)
- Profiles → User profiles: uses assignments (evidence: `models/Profil.php`)
- PDF utilities → Habilitation request: reads request (evidence: `controllers/PDFUtils.php`)
- PDF utilities → Electronic signature: reads signature (evidence: `controllers/PDFUtils.php`)
- jsPDF entry → jsPDF core: imports core (evidence: `web/jsPDF/main.js`)
- jsPDF entry → Canvas rendering: imports plugin (evidence: `web/jsPDF/main.js`)
