# s4nchzz/nozama-express architecture

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

- Interactive diagram: https://gitdiagram.com/s4nchzz/nozama-express
- Repository: https://github.com/s4nchzz/nozama-express

## Overview

##### Project Overview & Purpose
- Nozama is a small and simple product sales program that focuses on user management (account creation, login, password changes), an administrative panel (to manage users, products, tickets/incidences), and user interaction elements (chat, profile management, etc.).
- It is built in Java and leverages JavaFX for the front-end (using FXML for UI layouts) while incorporating a server-side component (e.g., “NozamaServerSocket.java”) to manage unique connections and interactions.
- It also integrates with a database (MariaDB via Connector/J, as stated in the README) and uses third-party jar libraries (e.g., “charm-glisten”) for additional UI or functional enhancements.

##### Main Components
a. Front-End / UI Layer:
- Login and account creation: Located in the "nozama/f00_Login" package with functionalities for login, account creation (nested under accountCreation), and password changing.
- Main application window and front page: "NozamaWindowApp.java" and the "nozama/f01_FrontPage" package include the front page, admin panel, ticket panel, product store display, and user profile management.
- Ticket and chat functionalities: The "ticketChat" sub-package handles the virtual chat interface and message handling.
- FXML files and CSS resources: Found under src/main/resources (for login screens, admin panels, support panels, and chat interfaces) which represent the UI structure and styling.
b. Server / Back-End Component:
- Server Socket handling: “NozamaServerSocket.java” and supporting classes like "ServerSocketData.java" provide the networking layer.
- Database Management: Packages within "nozama_database" (credentials, sendRequest, setttingUp) encapsulate database interactions, such as connecting to the MariaDB database, handling credentials, and setting up database requests.
c. External Libraries & Dependencies:
- The project uses Maven (pom.xml) for dependency management.
- Third-party libraries (e.g., “charm-glisten-6.0.2.jar” found in the lib folder) provide additional UI functionality.
- Requirements highlight dependencies like JDK-22, JavaFX-22, MariaDB Connector/J, and tools such as XAMPP and HeidiSQL.

##### Relationship and Interaction Between Components
- UI components (login, front page, admin panel, chat) interact with the server socket and database management layers to handle data flow.
- The login module processes user authentication that communicates with the database module (credentials verification via SHA256 encrypted passwords).
- Admin functionalities (such as managing tickets, users, and products) interact with both the UI and database, and may also trigger notifications or communications (handled by the server socket and ticket/chat subsystems).
- Each module’s responsibilities are separated into distinct packages (i.e., “f00_Login” for authentication, “f01_FrontPage” for general UI and admin interactions, “nozama_database” for back-end database operations).

##### Architectural Patterns & Design Principles
- The project appears modularized following a separation-of-concerns approach: distinct packages for login flows, front page, admin functionalities, and database operations.
- The use of FXML alongside JavaFX suggests an MVC-inspired approach for the UI—where FXML defines the view, and corresponding controller classes (like controllers for chat or admin panels) manage business logic.
- Network communication (via server sockets) is encapsulated in dedicated classes, showing an emphasis on clear boundaries between networking, UI, and data layers.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "UI / Presentation Layer"
        A1["Login Module"]:::ui
        A2["Main Application & Front Page"]:::ui
        A3["Chat & Ticket Functionality"]:::ui
        A4["User Profile Management"]:::ui
    end

    subgraph "Server / Back-End Layer"
        B1["Server Socket Handling"]:::server
    end

    subgraph "Database Layer"
        C1["Database Management"]:::db
    end

    subgraph "External Dependencies"
        D1["Maven (pom.xml)"]:::external
        D2["Third-Party Libraries"]:::external
    end

    A1 -->|"login_request"| B1
    A2 -->|"ui_interaction"| B1
    A3 -->|"chat_ticket"| B1
    A4 -->|"profile_update"| B1

    B1 -->|"db_operations"| C1
    C1 -->|"response"| B1

    B1 -->|"feedback_login"| A1
    B1 -->|"feedback_ui"| A2
    B1 -->|"feedback_chat"| A3
    B1 -->|"feedback_profile"| A4

    click A1 "https://github.com/s4nchzz/nozama-express/tree/master/src/main/java/nozama/f00_Login"
    click A2 "https://github.com/s4nchzz/nozama-express/blob/master/src/main/java/nozama/NozamaWindowApp.java"
    click A3 "https://github.com/s4nchzz/nozama-express/tree/master/src/main/java/nozama/f01_FrontPage/ticketChat"
    click A4 "https://github.com/s4nchzz/nozama-express/tree/master/src/main/java/nozama/f01_FrontPage/user_profile"
    click B1 "https://github.com/s4nchzz/nozama-express/blob/master/src/main/java/nozama/NozamaServerSocket.java"
    click C1 "https://github.com/s4nchzz/nozama-express/tree/master/src/main/java/nozama_database"
    click D1 "https://github.com/s4nchzz/nozama-express/blob/master/pom.xml"
    click D2 "https://github.com/s4nchzz/nozama-express/blob/master/lib/charm-glisten-6.0.2.jar"

    classDef ui fill:#f9f,stroke:#333,stroke-width:2px;
    classDef server fill:#9f9,stroke:#333,stroke-width:2px;
    classDef db fill:#ff9,stroke:#333,stroke-width:2px;
    classDef external fill:#9ff,stroke:#333,stroke-width:2px;
```
