# estebanrodez/outil-gestion-gvem architecture

> Architecture diagram of the GitHub repository estebanrodez/outil-gestion-gvem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/estebanrodez/outil-gestion-gvem
- Repository: https://github.com/estebanrodez/outil-gestion-gvem

## Overview

##### Project Overview & Purpose
- The project is a Java desktop/application oriented tool designed to import CSV files (exported from an existing website), process and validate data (such as for expositions, conférenciers, visites, etc.), and generate statistical reports.
- It supports both manual file import (for an initial user) and subsequent network-based (cryptographically secured) data exchange among museum computers.
- Key functions include CSV import/export, data validation, cryptographic security (using classes like DiffieHellman and Vigenere), PDF generation, and an MVC-based UI built with JavaFX (FXML files).

##### Analyzing the File Structure
- The project is clearly organized following an MVC pattern. Top-level “src” contains subdirectories like:
- application (with further subdivisions into controller, modele, vue, and utilitaire), which maps directly to the MVC structure.
- The “vue” folder contains all the FXML UI files and associated CSS for presentation.
- The “controleur” folder holds controllers that mediate between the UI and business logic.
- The “modele” folder contains the domain models (e.g. Client, Conferencier, Exposition, Visite).
- The “utilitaire” folder includes helper classes for CSV management, file system management, cryptographic functions, PDF generation, etc.
- There are extensive test directories (src/test) that mirror the main components (models, utilities) for ensuring reliable functionality.
- The “ressources” folder contains CSV test files outlining various valid and invalid cases, which emphasizes the data validation aspect of the system.

##### Main Components to be Represented
a. User Interface Layer:
- JavaFX-based views (FXML and CSS files).
- Managed by the controllers (e.g., AccueilControleur, MenuImportationControleur, etc.) to interact with user actions.
b. Controller Layer:
- The controllers are responsible for interpreting UI events and orchestrating calls to the business logic.
- Manage tasks such as triggering CSV imports/exports, initiating network transfer operations, and handling report generation.
c. Business Logic & Data Processing:
- Models that represent the domain objects (Conferencier, Exposition, Visite, etc.).
- Utility classes handling CSV import/export (ImportationCSV, ExportationCSV), validation, file/CSV management (GestionCSV, GestionFichiers), and data processing (TraitementDonnees).
- Report generation and statistical data calculations, with classes managing different views of the data (e.g., moyenne, ensemble, et filtres).
d. Cryptography & Network Components:
- Security functionality via the Diffie-Hellman exchange (EchangeDiffieHellman) and Vigenere algorithms for data encryption.
- Network modules that facilitate secure remote imports (ImporterDistantControleur) ensuring that data exchanged over the museum network is encrypted.
e. Persistence/File System Integration:
- Interaction with CSV files (reading, writing, validation) and file system management.
- Temporary file storage, error handling via custom exceptions like FichierDonneesInvalidesException et al.

##### Relationships & Data Flow
- Data Flow: User actions in the UI trigger controllers which then invoke data import/export via the utilitaire classes. Data is parsed and then passed to the model layer. After processing, reports are generated (possibly via GenererPdf) and displayed/updated in the UI.
- The network module acts as an intermediary when multiple users are involved, where controllers manage secure file transmission using cryptographic protocols.
- Testing artifacts (as seen in src/test) validate individual components and ensure functional integrity across different layers.

##### Key Architectural Patterns & Guiding Principles
- MVC (Model-View-Controller): Clearly separates concerns between the UI, control logic, and business (domain) model.
- Layered Architecture: The system is divided into the presentation layer (vue), application logic (controleur and modele), and utility components (utilitaire).
- Separation of data processing and security: Data import, encryption, and export are handled by distinct utility classes.
- Emphasis on validation: Extensive CSV test cases indicate robust validation logic.

##### Technologies, Frameworks, and Libraries
- Java programming language and JavaFX for the UI (FXML, CSS).
- CSV file management and custom exception handling for robust data validation.
- In-house cryptography (Diffie-Hellman, Vigenere) rather than relying on external cryptography libraries.
- PDF generation utilities for report production.
- Standard Java testing frameworks are implied by the detailed tests in the src/test package.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        UI["JavaFX Views (FXML & CSS)"]:::ui
    end

    %% Controller Layer
    subgraph "Controller Layer"
        CTRL["Controllers"]:::controller
    end

    %% Business Model Layer
    subgraph "Business Model Layer"
        MODEL["Domain Models (Client, Conferencier, Exposition, Visite)"]:::model
    end

    %% Utility/Service Layer
    subgraph "Utility/Service Layer"
        CSVM["CSV Management"]:::utility
        PDFGEN["PDF Generation"]:::utility
        FILESYS["File System Management"]:::utility
    end

    %% Crypto & Network Components
    subgraph "Crypto & Network"
        DH["Diffie-Hellman"]:::security
        VIG["Vigenere"]:::security
        NET["ImporterDistantControleur"]:::security
        RES["Reseau"]:::security
    end

    %% Persistence / External Data
    subgraph "Persistence / External Data"
        CSV_FILES["CSV Test Files"]:::data
    end

    %% Data Flow
    UI -->|"triggers"| CTRL
    CTRL -->|"calls"| MODEL
    CTRL -->|"orchestratesCSV"| CSVM
    CSV_FILES -->|"supplies"| CSVM
    CSVM -->|"performsFileOps"| FILESYS
    CTRL -->|"generatesReport"| PDFGEN
    CTRL -->|"initiatesSecureImport"| NET
    NET -->|"uses"| DH
    NET -->|"uses"| VIG
    NET -->|"uses"| RES

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef controller fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef model fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef utility fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef security fill:#FFA07A,stroke:#333,stroke-width:2px;
    classDef data fill:#E0FFFF,stroke:#333,stroke-width:2px;

    %% Click Events
    click UI "https://github.com/estebanrodez/outil-gestion-gvem/tree/master/src/application/vue"
    click CTRL "https://github.com/estebanrodez/outil-gestion-gvem/tree/master/src/application/controleur"
    click MODEL "https://github.com/estebanrodez/outil-gestion-gvem/tree/master/src/application/modele"
    click CSVM "https://github.com/estebanrodez/outil-gestion-gvem/tree/master/src/application/utilitaire"
    click PDFGEN "https://github.com/estebanrodez/outil-gestion-gvem/tree/master/src/application/utilitaire"
    click FILESYS "https://github.com/estebanrodez/outil-gestion-gvem/blob/master/src/application/utilitaire/GestionFichiers.java"
    click DH "https://github.com/estebanrodez/outil-gestion-gvem/blob/master/src/application/utilitaire/EchangeDiffieHellman.java"
    click VIG "https://github.com/estebanrodez/outil-gestion-gvem/blob/master/src/application/utilitaire/Vigenere.java"
    click NET "https://github.com/estebanrodez/outil-gestion-gvem/blob/master/src/application/controleur/ImporterDistantControleur.java"
    click RES "https://github.com/estebanrodez/outil-gestion-gvem/blob/master/src/application/utilitaire/Reseau.java"
    click CSV_FILES "https://github.com/estebanrodez/outil-gestion-gvem/tree/master/ressources/tests/CSV"
```
