# et-tounani/pi_gestion_emplois_temps architecture

> Architecture diagram of the GitHub repository et-tounani/pi_gestion_emplois_temps, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/et-tounani/pi_gestion_emplois_temps
- Repository: https://github.com/et-tounani/pi_gestion_emplois_temps

## Overview

##### Main Components
- Frontend: Represent the Angular application. This component includes various UI elements (dashboard, add/edit forms, timetable views, widgets such as navbar, login, sidebar, etc.). Indicate that the frontend handles user interactions and displays information.
- Backend: Represent the Java-based application. Break this down further into:
- REST Controllers: (e.g., AuthController, ClasseController, DepartementController, etc.) that expose endpoints.
- Service Layer: Contains business logic, including interfaces and implementations (e.g., IAuthImpl, IClasseServiceImpl, etc.), and a dispatch of requests.
- Data Access Layer (Repositories): (e.g., ClasseRepository, DepartementRepostitory, etc.) which communicate with the persistence layer.
- Domain/Entities: The model objects (e.g., Admin, Classe, Filiere, Module, etc.) define the core data structure.
- Special Algorithm Component: The “GAlgo” package that includes classes like GaAlgorithm and SchoolTimetable; this represents the specialized scheduling algorithm (likely a genetic algorithm) for generating optimal timetables.
- Auxiliary Services: Modules like LoadFormExcelToDb for importing Excel data and PdfExportService for exporting schedule data as PDFs.

##### Relationships & Data Flows
- The Frontend interacts with the Backend via HTTP/REST calls.
- REST Controllers in the backend call the Service Layer to process business logic.
- The Service Layer interacts with the Repository Layer for CRUD operations on the Database.
- The “GAlgo” module (inside services) collaborates with the system to generate timetables, which are then retrieved by controllers for display.
- There are data flows from Excel importer (LoadFormExcelToDb) to the Database and from the Database to the PDF Exporter.

##### Architectural Patterns & Technologies
- Layered architecture (presentation (controllers), business logic (services), and data access (repositories)).
- Use of the Genetic Algorithm for schedule generation, which is a key domain-specific feature.
- Technologies: Angular for frontend, Java with Spring Boot and JPA for backend, Maven for build management, and an underlying relational database. Also mention Excel file handling and PDF generation as additional functionalities.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FE("Angular Frontend"):::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        BE("Java/Spring Boot Backend"):::backend

        subgraph "REST API Controllers"
            RC("REST Controllers"):::controller
        end

        subgraph "Business Logic / Services"
            S("Service Layer"):::services
            GA("Genetic Algorithm Module"):::services
            EX("Excel Import Service"):::services
            PDF("PDF Export Service"):::services
        end

        subgraph "Data Access Layer"
            DA("Repositories"):::repo
            DM("Domain Entities"):::entities
        end

        CFG("Database Configuration"):::config
    end

    DB("Database"):::database

    %% Data Flows
    FE -->|"HTTP/REST"| RC
    RC -->|"ServiceCall"| S
    S -->|"CRUD"| DA
    DA -->|"DB-Operation"| DB
    S -->|"GenerateTimetable"| GA
    EX -->|"ImportExcelData"| DB
    DB -->|"ExportData"| PDF
    CFG --> DB

    %% Click Events
    click FE "https://github.com/et-tounani/pi_gestion_emplois_temps/tree/main/frontEnd"
    click BE "https://github.com/et-tounani/pi_gestion_emplois_temps/tree/main/backEnd"
    click RC "https://github.com/et-tounani/pi_gestion_emplois_temps/tree/main/backEnd/src/main/java/pi/enset/web"
    click S "https://github.com/et-tounani/pi_gestion_emplois_temps/tree/main/backEnd/src/main/java/pi/enset/services"
    click DA "https://github.com/et-tounani/pi_gestion_emplois_temps/tree/main/backEnd/src/main/java/pi/enset/repository"
    click DM "https://github.com/et-tounani/pi_gestion_emplois_temps/tree/main/backEnd/src/main/java/pi/enset/entities"
    click GA "https://github.com/et-tounani/pi_gestion_emplois_temps/tree/main/backEnd/src/main/java/pi/enset/GAlgo"
    click EX "https://github.com/et-tounani/pi_gestion_emplois_temps/blob/main/backEnd/src/main/java/pi/enset/settings/LoadFormExcelToDb.java"
    click PDF "https://github.com/et-tounani/pi_gestion_emplois_temps/blob/main/backEnd/src/main/java/pi/enset/settings/PdfExportService.java"
    click CFG "https://github.com/et-tounani/pi_gestion_emplois_temps/blob/main/backEnd/src/main/resources/application.properties"

    %% Styles
    classDef frontend fill:#AEDFF7,stroke:#1a6fb3,stroke-width:2px;
    classDef backend fill:#B2F7EF,stroke:#159895,stroke-width:2px;
    classDef controller fill:#F7D6E0,stroke:#B3426A,stroke-width:2px;
    classDef services fill:#FFF4E6,stroke:#E67E22,stroke-width:2px;
    classDef repo fill:#D5E1DF,stroke:#3E8573,stroke-width:2px;
    classDef entities fill:#F8EDEB,stroke:#C060A1,stroke-width:2px;
    classDef config fill:#ECE4D9,stroke:#A1866F,stroke-width:2px;
    classDef database fill:#FDFD96,stroke:#E5C100,stroke-width:2px;
```
