# yhaziz/human-resource-management-system-based-on-artificial-intelligence architecture

> Architecture diagram of the GitHub repository yhaziz/human-resource-management-system-based-on-artificial-intelligence, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yhaziz/human-resource-management-system-based-on-artificial-intelligence
- Repository: https://github.com/yhaziz/human-resource-management-system-based-on-artificial-intelligence

## Overview

##### Main Components

Frontend Layer:
- Angular SPA Application with the following modules:
- Core Module (Authentication, Guards, Interceptors)
- Feature Modules (Employee, RRH, DG, CD components)
- Shared UI Components (using Spartan UI)
- Layout Components

Backend Layer:
- Spring Boot Application with:
- REST Controllers Layer
- Service Layer
- Repository Layer
- Security Layer (JWT)
- Domain Model Layer

Database Layer:
- Relational Database (implied by JPA repositories)

##### Component Relationships

**[Frontend Layer]**
- ↑↓ HTTP/JWT
**[Backend Layer]**
- ↑↓ JPA
**[Database Layer]**

##### Detailed Component Breakdown

Frontend (Angular):
**[Core Module]**
- Authentication Service
- Guards
- HTTP Interceptors

**[Feature Modules]**
- Employee Dashboard
- RRH Dashboard
- DG Dashboard
- CD Dashboard

**[Shared Components]**
- UI Components
- Layout Components

Backend (Spring Boot):
**[Controllers]**
- AuthController
- UserController
- RrhController
- DgController
- CdController

**[Services]**
- UserService
- DemandeService
- DepartementService
- NotificationService

**[Security]**
- JWT Authentication
- Authorization
- User Details Service

**[Domain Model]**
- User
- Demande
- Departement
- Notification

##### Authentication Flow
**User → Login Component → Auth Controller → JWT Service → Database**

##### Leave Request Flow
**Employee → Request Form → Request Controller → Service Layer → Database**

##### Notification Flow
**System → Notification Service → WebSocket → User Interface**

##### Additional Elements

- Clear labels for all components
- Version information and date

## Diagram (Mermaid)

```mermaid
graph TB
    %% Title
    title[("SmartRH System Architecture")]:::title

    %% Frontend Layer
    subgraph Frontend
        CoreModule["Core Module"]
        AuthService["Authentication Service"]:::frontend
        Guards["Guards"]:::frontend
        Interceptors["HTTP Interceptors"]:::frontend
        
        subgraph FeatureModules["Feature Modules"]
            EmpDash["Employee Dashboard"]:::frontend
            RrhDash["RRH Dashboard"]:::frontend
            DgDash["DG Dashboard"]:::frontend
            CdDash["CD Dashboard"]:::frontend
        end
        
        subgraph Layouts["Layout Components"]
            EmpLayout["Employee Layout"]:::frontend
            RrhLayout["RRH Layout"]:::frontend
            DgLayout["DG Layout"]:::frontend
            CdLayout["CD Layout"]:::frontend
        end
        
        CoreModule --> AuthService
        CoreModule --> Guards
        CoreModule --> Interceptors
    end

    %% Backend Layer
    subgraph Backend
        subgraph Controllers
            AuthController["Auth Controller"]:::backend
            RrhController["RRH Controller"]:::backend
            DgController["DG Controller"]:::backend
            CdController["CD Controller"]:::backend
        end
        
        subgraph Services
            UserService["User Service"]:::backend
            DemandeService["Demande Service"]:::backend
            DeptService["Departement Service"]:::backend
        end
        
        subgraph Security
            JWTAuth["JWT Authentication"]:::security
            SecurityConfig["Security Config"]:::security
            AuthenticationService["Authentication Service"]:::security
        end
        
        subgraph Domain
            UserEntity["User Entity"]:::model
            DemandeEntity["Demande Entity"]:::model
            DeptEntity["Departement Entity"]:::model
        end
        
        subgraph Repository
            UserRepo["User Repository"]:::repository
            DemandeRepo["Demande Repository"]:::repository
            DeptRepo["Departement Repository"]:::repository
        end
    end

    %% Database Layer
    DB[(Database)]:::database

    %% Connections
    Frontend <--> |HTTP/JWT| Backend
    Repository --> DB
    Controllers --> Services
    Services --> Repository
    Services --> Security

    %% Click Events
    click AuthService "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/front/src/app/core/services/auth.service.ts"
    click Guards "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/front/src/app/core/guard/guard.guard.ts"
    click Interceptors "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/front/src/app/core/interceptors/auth.interceptor.ts"
    click EmpDash "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/tree/master/front/src/app/features/components/employee/dashboard/"
    click RrhDash "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/tree/master/front/src/app/features/components/rrh/dashboard/"
    click DgDash "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/tree/master/front/src/app/features/components/dg/dashboard/"
    click CdDash "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/tree/master/front/src/app/features/components/cd/dashboard/"
    click EmpLayout "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/tree/master/front/src/app/features/layouts/employee-layout/"
    click RrhLayout "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/tree/master/front/src/app/features/layouts/rrh-layout/"
    click DgLayout "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/tree/master/front/src/app/features/layouts/dg-layout/"
    click CdLayout "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/tree/master/front/src/app/features/layouts/cd-layout/"
    click AuthController "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppRestControllers/AuthController.java"
    click RrhController "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppRestControllers/RrhController.java"
    click DgController "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppRestControllers/DgController.java"
    click CdController "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppRestControllers/CdController.java"
    click UserService "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppResouces/Services/UserServiceImpl.java"
    click DemandeService "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppResouces/Services/DemandeServiceImpl.java"
    click DeptService "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppResouces/Services/DepartementServiceImpl.java"
    click JWTAuth "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/tree/master/back/src/main/java/com/smarttech/SmartRH/AppSecurity/JWT/"
    click SecurityConfig "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppSecurity/SecurityConfig.java"
    click AuthenticationService "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppSecurity/AuthenticationService.java"
    click UserEntity "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppResouces/Models/Entities/User.java"
    click DemandeEntity "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppResouces/Models/Entities/Demande.java"
    click DeptEntity "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppResouces/Models/Entities/Departement.java"
    click UserRepo "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppResouces/Repository/UserRepository.java"
    click DemandeRepo "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppResouces/Repository/DemandeRepository.java"
    click DeptRepo "https://github.com/Yhaziz/Human-resource-management-system-based-on-artificial-intelligence/blob/master/back/src/main/java/com/smarttech/SmartRH/AppResouces/Repository/DepartementRepository.java"

    %% Styles
    classDef frontend fill:#2196F3,stroke:#1565C0,color:white
    classDef backend fill:#4CAF50,stroke:#2E7D32,color:white
    classDef security fill:#f44336,stroke:#c62828,color:white
    classDef database fill:#FF9800,stroke:#EF6C00,color:white
    classDef model fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef repository fill:#795548,stroke:#4E342E,color:white
    classDef title fill:#607D8B,stroke:#455A64,color:white
```
