# hvmzvbe/libraryapp- architecture

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

- Interactive diagram: https://gitdiagram.com/hvmzvbe/libraryapp-
- Repository: https://github.com/hvmzvbe/libraryapp-

## Overview

##### Project type and purpose
- This is a Java desktop application built with JavaFX (FXML + SceneBuilder) for managing a personal book library.
- Users can sign up/log in, browse books by category or top-rated, view details, maintain custom “shelves,” mark favorites, and get reading recommendations.
- It persists data in a MySQL database via a JDBC connector.

##### File structure
- Top-level:
- db/mysql-connector-j-9.1.0.jar – JDBC driver
- src/
– module-info.java – Java module declaration
– sample/ – main application classes & controllers
– Model/ – data model (Livre.java)
– fxmlFile/ – FXML view definitions
– css/styles.css – global styling
– img/ – image assets
- Patterns:
- MVC (Model = src/Model, View = src/fxmlFile + css, Controller = src/sample/*Controller)
- Single process (desktop), with a Data-Access layer (DbConnection.java) and an external MySQL service

##### README for additional insights
- Confirms JavaFX + SceneBuilder UI, Java backend, optional MySQL usage
- Lists features: authentication, book management, search & recommendations, custom shelves
- Technology stack: Java, JavaFX, CSS, MySQL

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Application Layer
    subgraph "Application Entry"
        Main["Main.java"] 
        Module["module-info.java"]
    end

    %% UI Layer
    subgraph "UI Layer"
        classDef ui fill:#E0F7FA,stroke:#0288D1
        Card["Card.fxml"]:::ui
        GridB["GridB.fxml"]:::ui
        HistoryView["History.fxml"]:::ui
        ReadingView["Reading.fxml"]:::ui
        ShelvesView["Shelves.fxml"]:::ui
        SignUpView["SignUp.fxml"]:::ui
        TopBooks["TopBooks.fxml"]:::ui
        Bib1["bib1.fxml"]:::ui
        Categorie["categorie.fxml"]:::ui
        FavoritesView["favorites.fxml"]:::ui
        LoginView["login.fxml"]:::ui
        Styles["styles.css"]:::ui
    end

    %% Controller Layer
    subgraph "Controller Layer"
        classDef controller fill:#E8F5E9,stroke:#388E3C
        BrowseCtrl["BrowseController.java"]:::controller
        CardCtrl["CardController.java"]:::controller
        CategorieCtrl["CategorieController.java"]:::controller
        FavoritesCtrl["FavoritesController.java"]:::controller
        GridBCtrl["GridBController.java"]:::controller
        HistoryCtrl["HistoryController.java"]:::controller
        LoginCtrl["LogInController.java"]:::controller
        ReadingCtrl["ReadingController.java"]:::controller
        ShelvesCtrl["ShelvesController.java"]:::controller
        SignUpCtrl["SignUpcontroller.java"]:::controller
        TopBooksCtrl["TopBooksController.java"]:::controller
    end

    %% Model Layer
    subgraph "Model Layer"
        classDef model fill:#FFF3E0,stroke:#FB8C00
        Livre["Livre.java"]:::model
    end

    %% Data-Access Layer
    subgraph "Data-Access Layer"
        classDef dataaccess fill:#FFFDE7,stroke:#FDD835
        DbConn["DbConnection.java"]:::dataaccess
        JDBCDrv["mysql-connector-j-9.1.0.jar"]:::dataaccess
    end

    %% Database
    subgraph "Database"
        classDef db fill:#ECEFF1,stroke:#90A4AE
        MySQL["MySQL Database"]
    end

    %% Relationships
    Module --> Main
    Main --> Card
    Main --> GridB
    Main --> HistoryView
    Main --> ReadingView
    Main --> ShelvesView
    Main --> SignUpView
    Main --> TopBooks
    Main --> Bib1
    Main --> Categorie
    Main --> FavoritesView
    Main --> LoginView
    Styles -.-> Card
    Styles -.-> GridB
    Styles -.-> HistoryView
    Styles -.-> ReadingView
    Styles -.-> ShelvesView
    Styles -.-> SignUpView
    Styles -.-> TopBooks
    Styles -.-> Bib1
    Styles -.-> Categorie
    Styles -.-> FavoritesView
    Styles -.-> LoginView

    Card --> CardCtrl
    GridB --> GridBCtrl
    HistoryView --> HistoryCtrl
    ReadingView --> ReadingCtrl
    ShelvesView --> ShelvesCtrl
    SignUpView --> SignUpCtrl
    TopBooks --> TopBooksCtrl
    Bib1 --> BrowseCtrl
    Categorie --> CategorieCtrl
    FavoritesView --> FavoritesCtrl
    LoginView --> LoginCtrl

    %% Controllers to Model/Data
    BrowseCtrl --> Livre
    CardCtrl --> Livre
    CategorieCtrl --> Livre
    FavoritesCtrl --> Livre
    GridBCtrl --> Livre
    HistoryCtrl --> Livre
    LoginCtrl --> DbConn
    ReadingCtrl --> Livre
    ShelvesCtrl --> Livre
    SignUpCtrl --> DbConn
    TopBooksCtrl --> Livre

    DbConn --> JDBCDrv
    JDBCDrv --> MySQL
    Livre --> DbConn
    MySQL --> DbConn
    DbConn --> LoginCtrl
    DbConn --> SignUpCtrl

    %% Click Events
    click Main "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/Main.java"
    click Module "https://github.com/hvmzvbe/libraryapp-/blob/main/src/module-info.java"
    click Card "https://github.com/hvmzvbe/libraryapp-/blob/main/src/fxmlFile/Card.fxml"
    click GridB "https://github.com/hvmzvbe/libraryapp-/blob/main/src/fxmlFile/GridB.fxml"
    click HistoryView "https://github.com/hvmzvbe/libraryapp-/blob/main/src/fxmlFile/History.fxml"
    click ReadingView "https://github.com/hvmzvbe/libraryapp-/blob/main/src/fxmlFile/Reading.fxml"
    click ShelvesView "https://github.com/hvmzvbe/libraryapp-/blob/main/src/fxmlFile/Shelves.fxml"
    click SignUpView "https://github.com/hvmzvbe/libraryapp-/blob/main/src/fxmlFile/SignUp.fxml"
    click TopBooks "https://github.com/hvmzvbe/libraryapp-/blob/main/src/fxmlFile/TopBooks.fxml"
    click Bib1 "https://github.com/hvmzvbe/libraryapp-/blob/main/src/fxmlFile/bib1.fxml"
    click Categorie "https://github.com/hvmzvbe/libraryapp-/blob/main/src/fxmlFile/categorie.fxml"
    click FavoritesView "https://github.com/hvmzvbe/libraryapp-/blob/main/src/fxmlFile/favorites.fxml"
    click LoginView "https://github.com/hvmzvbe/libraryapp-/blob/main/src/fxmlFile/login.fxml"
    click Styles "https://github.com/hvmzvbe/libraryapp-/blob/main/src/css/styles.css"
    click BrowseCtrl "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/BrowseController.java"
    click CardCtrl "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/CardController.java"
    click CategorieCtrl "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/CategorieController.java"
    click FavoritesCtrl "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/FavoritesController.java"
    click GridBCtrl "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/GridBController.java"
    click HistoryCtrl "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/HistoryController.java"
    click LoginCtrl "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/LogInController.java"
    click ReadingCtrl "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/ReadingController.java"
    click ShelvesCtrl "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/ShelvesController.java"
    click SignUpCtrl "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/SignUpcontroller.java"
    click TopBooksCtrl "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/TopBooksController.java"
    click Livre "https://github.com/hvmzvbe/libraryapp-/blob/main/src/Model/Livre.java"
    click DbConn "https://github.com/hvmzvbe/libraryapp-/blob/main/src/sample/DbConnection.java"
    click JDBCDrv "https://github.com/hvmzvbe/libraryapp-/blob/main/db/mysql-connector-j-9.1.0.jar"

    %% Styles
    class Main,Module default
    class Card,GridB,HistoryView,ReadingView,ShelvesView,SignUpView,TopBooks,Bib1,Categorie,FavoritesView,LoginView ui
    class BrowseCtrl,CardCtrl,CategorieCtrl,FavoritesCtrl,GridBCtrl,HistoryCtrl,LoginCtrl,ReadingCtrl,ShelvesCtrl,SignUpCtrl,TopBooksCtrl controller
    class Livre model
    class DbConn,JDBCDrv dataaccess
    class MySQL db
```
