# hxndev/event-management-system architecture

> Architecture diagram of the GitHub repository hxndev/event-management-system, 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/hxndev/event-management-system
- Repository: https://github.com/hxndev/event-management-system

## Overview

##### Main Components
- User Interface Layer (Frontend):
- Represented by the InterfaceMain module under Project/EMS. This layer contains all the JavaFX FXML files, controllers, and resources (CSS, images, audio files).
- Different UI views exist for customer, employee, manager, etc., as visible in files like cust_signin.fxml, emp_signin.fxml, mgr_menu.fxml, etc.
- Business Logic / Application Layer:
- The core application logic contained in Java files such as Main.java, controllers (Main_Menu_Controller.java, cust_edit_Controller.java, etc.), and model classes (Customer.java, Event.java, Employee.java, etc.).
- Data Access / Persistence Layer:
- Includes classes like CustomerDB.java, EmployeeDB.java, EventDB.java, etc., for interacting with the MySQL database.
- The “For SQL” folder contains text files with SQL queries to set up the database schema and dummy data.
- External Libraries and Frameworks:
- JavaFX (and the provided JavaFX SDK) is used for UI rendering.
- MySQL Connector/J (mysql-connector-java-8.0.22.jar) for database connectivity.
- Additional libraries for email handling (mail.jar, smtp-1.6.2.jar, etc.) and other Java dependencies.

##### Relationships and Interactions
- The UI layer (build with JavaFX) interacts directly with the controllers when users perform actions, such as sign-in, account creation, or booking an event.
- Controllers then delegate tasks to business logic/service classes which implement workflows and validations.
- Business logic calls the data access components to store or retrieve information from the MySQL database.
- External libraries (JavaFX components, mail API, etc.) support these layers and are integrated as dependencies.

##### Architectural Patterns and Design Principles
- MVC (Model-View-Controller) Pattern: The separation between JavaFX views (FXML files), controllers, and models is evident.
- Layered Architecture: The system is organized into presentation (UI/FX), business logic, and data persistence layers.
- Use of external libraries for modularity (JavaFX for GUI, MySQL connector for persistence, email libraries for notifications).

##### Relevant Technologies
- Java and JavaFX for the desktop application.
- MySQL for the database.
- Enterprise Architect (via EAPX files) for documenting system design.
- External libraries for email services and additional GUI elements (like JFoenix).

##### Instructing the Principal Software Engineer
- Detail the interactions, for example:
- User triggers an event via the UI.
- Controllers capture the event and call the corresponding business logic function.
- The business logic interacts with the DB layer to persist or retrieve data.
- Upon successful operation, a response is sent back via the controller to update the UI.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "User Interface Layer"
        UI["JavaFX FXML & Controllers"]:::ui
    end

    subgraph "Business Logic Layer"
        BL["Controllers & Models (Business Functions)"]:::bl
    end

    subgraph "Data Access Layer"
        DA["DB Access (CustomerDB, EmployeeDB, EventDB)"]:::da
        SQL["SQL Scripts"]:::da
    end

    subgraph "Database"
        DB["MySQL Database"]:::da
    end

    subgraph "External Libraries & Frameworks"
        EXT["JavaFX SDK, MySQL Connector, Email Libraries"]:::ext
    end

    subgraph "Documentation"
        DOC["Enterprise Architect Diagrams"]:::doc
    end

    UI -->|"user_action"| BL
    BL -->|"logic_call"| DA
    DA -->|"db_query"| DB
    SQL -->|"setup_db"| DB
    BL -->|"uses"| EXT
    DOC -->|"documents"| BL

    click UI "https://github.com/hxndev/event-management-system/tree/main/Project/EMS/InterfaceMain"
    click BL "https://github.com/hxndev/event-management-system/tree/main/Project/EMS/InterfaceMain/src/sample"
    click DA "https://github.com/hxndev/event-management-system/tree/main/Project/EMS/InterfaceMain/src/sample"
    click SQL "https://github.com/hxndev/event-management-system/tree/main/Project/EMS/InterfaceMain/For SQL"
    click EXT "https://github.com/hxndev/event-management-system/tree/main/Project/EMS/Java"
    click DOC "https://github.com/hxndev/event-management-system/tree/main/Enterprise Architect"

    classDef ui fill:#d9ead3,stroke:#6aa84f,stroke-width:2px;
    classDef bl fill:#c9daf8,stroke:#1155cc,stroke-width:2px;
    classDef da fill:#f9cb9c,stroke:#e69138,stroke-width:2px;
    classDef ext fill:#ead1dc,stroke:#b854a9,stroke-width:2px;
    classDef doc fill:#fce5cd,stroke:#e69138,stroke-width:2px;
```
