# marcoman2/employeemanagementsystem architecture

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

- Interactive diagram: https://gitdiagram.com/marcoman2/employeemanagementsystem
- Repository: https://github.com/marcoman2/employeemanagementsystem

## Overview

##### Project Type and Purpose
- This is a standalone JavaFX desktop application (“Employee Management System”) built with NetBeans and Ant.
- It provides a login screen, a dashboard with charts/reports, and CRUD operations against a relational database (MySQL or Oracle).

##### Key Artifacts from File Structure
- Top‑level
- README.md – one‑line project description.
- build.xml / nbproject/ – Ant build scripts and NetBeans metadata.
- Source (employeeManagementSystem/src)
- FXML files: FXMLDocument.fxml (login UI), dashboard.fxml (main dashboard UI).
- Controllers: FXMLDocumentController.java, dashboardController.java.
- Data layer: database.java (DB connection manager), getData.java (queries), employeeData.java (model).
- UI styling: dashboardDesign.css, loginDesign.css.
- Build Output (employeeManagementSystem/build)
- Compiled classes & copied resources.
- Distribution (employeeManagementSystem/dist)
- employeeManagementSystem.jar + JNLP + HTML wrapper (WebStart).
- /lib: external libraries (fontawesomefx, jfreechart, mysql‑connector, ojdbc).

##### Main Components
a. Presentation Layer
- Login Screen (FXMLDocument.fxml + loginDesign.css)
- Dashboard Screen (dashboard.fxml + dashboardDesign.css + JFreeChart)
b. Controller Layer
- FXMLDocumentController (handles login events)
- dashboardController (loads data, populates charts/tables)
c. Data Access Layer
- database.java (connection factory)
- getData.java (SQL execution)
- employeeData.java (POJO for employee records)
d. Database(s)
- MySQL Server
- Oracle DB (optional)
e. External Libraries
- jfreechart (charting)
- JDBC drivers (mysql‑connector, ojdbc)
f. Build & Distribution
- Ant build (build.xml) → compile & package → JAR + JNLP/WebStart

##### Relationships and Data Flow
- User interacts with UI → event sent to appropriate Controller → Controller invokes Data Access → Data Access opens JDBC Connection → queries DB → maps results into employeeData objects → returns to Controller → Controller updates the UI (tables/charts).
- At build time: source + resources → Ant → compiled classes → packaged with dependencies → deployed as .jar/.jnlp.

##### Architectural Patterns & Principles
- MVC‑style separation: FXML (View) / Controller / Model (employeeData)
- DAO‑like Data Access layer (database.java + getData.java)
- Externalization of UI layout (FXML) and styling (CSS)
- Single‑process desktop app connecting directly to DB over JDBC

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        LoginFXML["FXMLDocument.fxml"]:::presentation
        LoginCSS["loginDesign.css"]:::presentation
        DashboardFXML["dashboard.fxml"]:::presentation
        DashboardCSS["dashboardDesign.css"]:::presentation
    end

    %% Controller Layer
    subgraph "Controller Layer"
        direction TB
        LoginController["FXMLDocumentController.java"]:::controller
        DashboardController["dashboardController.java"]:::controller
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        direction TB
        DBManager["database.java"]:::data
        SQLUtility["getData.java"]:::data
        EmployeeModel["employeeData.java"]:::data
    end

    %% Storage Layer
    subgraph "Storage Layer"
        direction TB
        MySQL["MySQL Server"]:::storage
        Oracle["Oracle DB"]:::storage
    end

    %% External Libraries
    subgraph "External Libraries"
        direction TB
        FontAwesomeFX["fontawesomefx-8.2.jar"]:::external
        JFreeChart["jfreechart-1.0.19.jar"]:::external
        MySQLConnector["mysql-connector-java-5.1.48.jar"]:::external
        OracleJDBC["ojdbc14-10.2.0.2.0.jar"]:::external
    end

    %% Build & Distribution
    subgraph "Build & Distribution"
        direction TB
        README["README.md"]:::build
        AntScript["build.xml"]:::build
        NetBeansMeta["nbproject/"]:::build
        Launcher["EmployeeManagementSystem.java"]:::build
        Compile["Compiled Classes & Resources"]:::build
        Package["employeeManagementSystem.jar"]:::build
        JNLP["employeeManagementSystem.jnlp"]:::build
        HTMLWrapper["employeeManagementSystem.html"]:::build
    end

    %% Relationships
    LoginFXML -->|styled by| LoginCSS
    DashboardFXML -->|styled by| DashboardCSS

    LoginFXML -->|event| LoginController
    LoginController -->|loads view| DashboardFXML
    DashboardFXML -->|renders charts| DashboardController

    LoginController -->|calls| DBManager
    DashboardController -->|calls| SQLUtility
    SQLUtility -->|maps to| EmployeeModel
    DBManager -->|connects to| MySQL
    DBManager -->|connects to| Oracle
    SQLUtility -->|uses| DBManager

    %% Build Flow
    README --> AntScript
    AntScript -->|compiles| Launcher
    Launcher --> Compile
    Compile --> Package
    Package --> JNLP
    Package --> HTMLWrapper
    Package -->|bundles| FontAwesomeFX
    Package -->|bundles| JFreeChart
    Package -->|bundles| MySQLConnector
    Package -->|bundles| OracleJDBC

    %% Click Events
    click README "https://github.com/marcoman2/employeemanagementsystem/blob/main/README.md"
    click AntScript "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/build.xml"
    click NetBeansMeta "https://github.com/marcoman2/employeemanagementsystem/tree/main/employeeManagementSystem/nbproject/"
    click Launcher "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/src/employeemanagementsystem/EmployeeManagementSystem.java"
    click LoginFXML "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/src/employeemanagementsystem/FXMLDocument.fxml"
    click LoginCSS "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/src/employeemanagementsystem/loginDesign.css"
    click DashboardFXML "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/src/employeemanagementsystem/dashboard.fxml"
    click DashboardCSS "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/src/employeemanagementsystem/dashboardDesign.css"
    click LoginController "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/src/employeemanagementsystem/FXMLDocumentController.java"
    click DashboardController "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/src/employeemanagementsystem/dashboardController.java"
    click DBManager "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/src/employeemanagementsystem/database.java"
    click SQLUtility "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/src/employeemanagementsystem/getData.java"
    click EmployeeModel "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/src/employeemanagementsystem/employeeData.java"
    click Compile "https://github.com/marcoman2/employeemanagementsystem/tree/main/employeeManagementSystem/build/classes/"
    click Package "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/dist/employeeManagementSystem.jar"
    click JNLP "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/dist/employeeManagementSystem.jnlp"
    click HTMLWrapper "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/dist/employeeManagementSystem.html"
    click FontAwesomeFX "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/dist/lib/fontawesomefx-8.2.jar"
    click JFreeChart "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/dist/lib/jfreechart-1.0.19.jar"
    click MySQLConnector "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/dist/lib/mysql-connector-java-5.1.48.jar"
    click OracleJDBC "https://github.com/marcoman2/employeemanagementsystem/blob/main/employeeManagementSystem/dist/lib/ojdbc14-10.2.0.2.0.jar"

    %% Styles
    classDef presentation fill:#D6EFFF,stroke:#333,stroke-width:1px
    classDef controller fill:#DFFFD6,stroke:#333,stroke-width:1px
    classDef data fill:#FFE5B4,stroke:#333,stroke-width:1px
    classDef storage fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef external fill:#F0D0FF,stroke:#333,stroke-width:1px
    classDef build fill:#E8D7FF,stroke:#333,stroke-width:1px
```
