# hammami-ghassen/pfe architecture

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

- Interactive diagram: https://gitdiagram.com/hammami-ghassen/pfe
- Repository: https://github.com/hammami-ghassen/pfe

## Overview

GRH MSP is a human-resources application: staff authenticate with OTP, obtain a role-scoped session, and use the React portal to manage leave, personnel corrections, administration, dashboards, and chat. Its Spring API connects those workflows to legacy personnel data and application persistence. A separate Airflow-oriented ETL pipeline extracts, transforms, and loads HR data for analytics; the README explicitly places it outside the main application architecture. The graph preserves documented capabilities, but several backend subsystems were not sampled, so their internal call paths are left unasserted.

Main entry points: [`client/src/App.js`](https://github.com/hammami-ghassen/pfe/blob/main/client/src/App.js) (React routes), [`ETL_PFE/dags/etl_dag.py`](https://github.com/hammami-ghassen/pfe/blob/main/ETL_PFE/dags/etl_dag.py) (ETL orchestration), [`server/src/main/java/com/sante/app/controller/AuthController.java`](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/controller/AuthController.java) (Authentication API), [`server/src/main/java/com/sante/app/service/OtpAuthService.java`](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/service/OtpAuthService.java) (OTP workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web portal"]
  node_app["React routes<br/>[App.js]"]
  node_authctx["Auth context<br/>[AuthContext.jsx]"]
  node_login["OTP sign-in<br/>[LoginPage.jsx]"]
  node_leaveui["Leave screens"]
  node_adminui["Admin screens"]
  node_chatui["Chat screen<br/>[ChatPage.jsx]"]
  node_dashui["Dashboards"]
end

subgraph group_identity["Identity and access"]
  node_authapi["Authentication API"]
  node_otpauth["OTP workflow"]
  node_tokens["Token lifecycle"]
  node_jwt["JWT provider"]
end

subgraph group_hr["HR operations"]
  node_leaveapi["Leave API"]
  node_leavesvc["Leave rules and requests<br/>[LeaveService.java]"]
  node_personnel[("Personnel data")]
  node_corrections["Corrections and personnel admin"]
  node_newsnotify["News and notifications"]
end

subgraph group_collaboration["Communication"]
  node_chatapi["Chat API"]
  node_chatservice["Chat messaging<br/>[ChatService.java]"]
end

subgraph group_analytics["Analytics ETL"]
  node_etl["ETL orchestration<br/>[etl_dag.py]"]
  node_extract["Source extraction<br/>[extract.py]"]
  node_transform["HR transformations<br/>[transform.py]"]
  node_load["Analytics loading<br/>[load.py]"]
  node_warehouse[("Analytics store")]
end

node_staff(("Staff / Admin"))

node_staff -->|"uses portal"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_leaveui
node_app -->|"routes to"| node_adminui
node_app -->|"routes to"| node_chatui
node_app -->|"routes to"| node_dashui
node_login -->|"requests OTP"| node_authapi
node_authapi -->|"delegates to"| node_otpauth
node_otpauth -->|"checks staff"| node_personnel
node_otpauth -->|"issues session"| node_tokens
node_tokens -->|"generates tokens"| node_jwt
node_authapi -->|"returns session"| node_authctx
node_leaveui -->|"calls API"| node_leaveapi
node_leaveapi -->|"delegates to"| node_leavesvc
node_leavesvc -->|"reads staff"| node_personnel
node_adminui -->|"submits admin actions"| node_corrections
node_chatui -.->|"uses messaging"| node_chatapi
node_chatapi -.->|"delegates to"| node_chatservice
node_chatservice -->|"looks up contacts"| node_personnel
node_dashui -.->|"shows updates"| node_newsnotify
node_etl -->|"runs extraction"| node_extract
node_etl -->|"runs transforms"| node_transform
node_etl -->|"runs loading"| node_load
node_transform -->|"produces datasets"| node_load
node_load -.->|"writes analytics"| node_warehouse

click node_app "https://github.com/hammami-ghassen/pfe/blob/main/client/src/App.js"
click node_authctx "https://github.com/hammami-ghassen/pfe/blob/main/client/src/context/AuthContext.jsx"
click node_login "https://github.com/hammami-ghassen/pfe/blob/main/client/src/pages/auth/LoginPage.jsx"
click node_leaveui "https://github.com/hammami-ghassen/pfe/tree/main/client/src/pages/leave"
click node_adminui "https://github.com/hammami-ghassen/pfe/tree/main/client/src/pages/admin"
click node_chatui "https://github.com/hammami-ghassen/pfe/blob/main/client/src/pages/chat/ChatPage.jsx"
click node_dashui "https://github.com/hammami-ghassen/pfe/tree/main/client/src/pages/dashboard"
click node_authapi "https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/controller/AuthController.java"
click node_otpauth "https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/service/OtpAuthService.java"
click node_tokens "https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/service/AuthTokenService.java"
click node_jwt "https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/security/jwt/JwtTokenProvider.java"
click node_leaveapi "https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/controller/LeaveController.java"
click node_leavesvc "https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/service/LeaveService.java"
click node_personnel "https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/repository/PersonnelRepository.java"
click node_corrections "https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/controller/AdminCorrectionController.java"
click node_newsnotify "https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/controller/NewsController.java"
click node_chatapi "https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/controller/chat/ChatController.java"
click node_chatservice "https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/service/chat/ChatService.java"
click node_etl "https://github.com/hammami-ghassen/pfe/blob/main/ETL_PFE/dags/etl_dag.py"
click node_extract "https://github.com/hammami-ghassen/pfe/blob/main/ETL_PFE/etl/extract.py"
click node_transform "https://github.com/hammami-ghassen/pfe/blob/main/ETL_PFE/etl/transform.py"
click node_load "https://github.com/hammami-ghassen/pfe/blob/main/ETL_PFE/etl/load.py"

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_app,node_authctx,node_login,node_leaveui,node_adminui,node_chatui,node_dashui toneBlue
class node_authapi,node_otpauth,node_tokens,node_jwt toneAmber
class node_leaveapi,node_leavesvc,node_personnel,node_corrections,node_newsnotify toneMint
class node_chatapi,node_chatservice toneRose
class node_etl,node_extract,node_transform,node_load,node_warehouse,node_staff toneIndigo
```

## Components

### Web portal

- [React routes](https://github.com/hammami-ghassen/pfe/blob/main/client/src/App.js): `client/src/App.js`
- [Auth context](https://github.com/hammami-ghassen/pfe/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [OTP sign-in](https://github.com/hammami-ghassen/pfe/blob/main/client/src/pages/auth/LoginPage.jsx): `client/src/pages/auth/LoginPage.jsx`
- [Leave screens](https://github.com/hammami-ghassen/pfe/tree/main/client/src/pages/leave): `client/src/pages/leave`
- [Admin screens](https://github.com/hammami-ghassen/pfe/tree/main/client/src/pages/admin): `client/src/pages/admin`
- [Chat screen](https://github.com/hammami-ghassen/pfe/blob/main/client/src/pages/chat/ChatPage.jsx): `client/src/pages/chat/ChatPage.jsx`
- [Dashboards](https://github.com/hammami-ghassen/pfe/tree/main/client/src/pages/dashboard): `client/src/pages/dashboard`

### Identity and access

- [Authentication API](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/controller/AuthController.java): `server/src/main/java/com/sante/app/controller/AuthController.java`
- [OTP workflow](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/service/OtpAuthService.java): `server/src/main/java/com/sante/app/service/OtpAuthService.java`
- [Token lifecycle](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/service/AuthTokenService.java): `server/src/main/java/com/sante/app/service/AuthTokenService.java`
- [JWT provider](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/security/jwt/JwtTokenProvider.java): `server/src/main/java/com/sante/app/security/jwt/JwtTokenProvider.java`

### HR operations

- [Leave API](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/controller/LeaveController.java): `server/src/main/java/com/sante/app/controller/LeaveController.java`
- [Leave rules and requests](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/service/LeaveService.java): `server/src/main/java/com/sante/app/service/LeaveService.java`
- [Personnel data](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/repository/PersonnelRepository.java): `server/src/main/java/com/sante/app/repository/PersonnelRepository.java`
- [Corrections and personnel admin](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/controller/AdminCorrectionController.java): `server/src/main/java/com/sante/app/controller/AdminCorrectionController.java`
- [News and notifications](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/controller/NewsController.java): `server/src/main/java/com/sante/app/controller/NewsController.java`

### Communication

- [Chat API](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/controller/chat/ChatController.java): `server/src/main/java/com/sante/app/controller/chat/ChatController.java`
- [Chat messaging](https://github.com/hammami-ghassen/pfe/blob/main/server/src/main/java/com/sante/app/service/chat/ChatService.java): `server/src/main/java/com/sante/app/service/chat/ChatService.java`

### Analytics ETL

- [ETL orchestration](https://github.com/hammami-ghassen/pfe/blob/main/ETL_PFE/dags/etl_dag.py): `ETL_PFE/dags/etl_dag.py`
- [Source extraction](https://github.com/hammami-ghassen/pfe/blob/main/ETL_PFE/etl/extract.py): `ETL_PFE/etl/extract.py`
- [HR transformations](https://github.com/hammami-ghassen/pfe/blob/main/ETL_PFE/etl/transform.py): `ETL_PFE/etl/transform.py`
- [Analytics loading](https://github.com/hammami-ghassen/pfe/blob/main/ETL_PFE/etl/load.py): `ETL_PFE/etl/load.py`
- **Analytics store**

### Other components

- **Staff / Admin**

## Connections

- Staff / Admin → React routes: uses portal (evidence: `client/src/App.js`)
- React routes → OTP sign-in: routes to (evidence: `client/src/App.js`)
- React routes → Leave screens: routes to (evidence: `client/src/App.js`)
- React routes → Admin screens: routes to (evidence: `client/src/App.js`)
- React routes → Chat screen: routes to (evidence: `client/src/App.js`)
- React routes → Dashboards: routes to (evidence: `client/src/App.js`)
- OTP sign-in → Authentication API: requests OTP
- Authentication API → OTP workflow: delegates to (evidence: `server/src/main/java/com/sante/app/controller/AuthController.java`)
- OTP workflow → Personnel data: checks staff (evidence: `server/src/main/java/com/sante/app/service/OtpAuthService.java`)
- OTP workflow → Token lifecycle: issues session (evidence: `server/src/main/java/com/sante/app/service/OtpAuthService.java`)
- Token lifecycle → JWT provider: generates tokens (evidence: `server/src/main/java/com/sante/app/service/AuthTokenService.java`)
- Authentication API → Auth context: returns session
- Leave screens → Leave API: calls API
- Leave API → Leave rules and requests: delegates to (evidence: `server/src/main/java/com/sante/app/controller/LeaveController.java`)
- Leave rules and requests → Personnel data: reads staff (evidence: `server/src/main/java/com/sante/app/service/LeaveService.java`)
- Admin screens → Corrections and personnel admin: submits admin actions
- Chat screen → Chat API: uses messaging
- Chat API → Chat messaging: delegates to (evidence: `server/src/main/java/com/sante/app/controller/chat/ChatController.java`)
- Chat messaging → Personnel data: looks up contacts (evidence: `server/src/main/java/com/sante/app/service/chat/ChatService.java`)
- Dashboards → News and notifications: shows updates
- ETL orchestration → Source extraction: runs extraction (evidence: `ETL_PFE/dags/etl_dag.py`)
- ETL orchestration → HR transformations: runs transforms (evidence: `ETL_PFE/dags/etl_dag.py`)
- ETL orchestration → Analytics loading: runs loading (evidence: `ETL_PFE/dags/etl_dag.py`)
- HR transformations → Analytics loading: produces datasets (evidence: `ETL_PFE/etl/main.py`)
- Analytics loading → Analytics store: writes analytics
