# gosiadrygala/finalproject architecture

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

- Interactive diagram: https://gitdiagram.com/gosiadrygala/finalproject
- Repository: https://github.com/gosiadrygala/finalproject

## Overview

##### Project Type and Purpose
- The project is a client–server application built for managing pricing data and user roles – such as administrators, product administrators, and shop managers.
- It leverages a Java client with a rich GUI (FXML-based views, controllers, and view models) while connecting over a network (via RMI) to a server that implements the business logic and data access.
- The structure suggests a clear use of the Model–View–Controller (or ViewModel) pattern on the client side, a Data Access Object (DAO) pattern for database interactions, and a distributed execution model via RMI for networking.

##### File Structure
- Top-level directories:
- “PriceChecker” (the main project) contains the “src” directory.
- Within “src” you find distinct sub-packages for:
- client: Contains application entry points (PriceCheckerApp.java, RunPriceChecker.java), the client’s model packages (e.g., loginRegisterModel, administratorModel, etc.), core factories and handlers (ClientFactory, ModelFactory, ViewHandler, ViewModelFactory), networking components (Client, RMIClient) and the views (FXML files, controllers, and view models).
- dataaccess: Implements the DAO layer with classes for connecting to a database (DatabaseConnection, various DAO and Manager classes).
- server: Contains the server entry point (RunServer.java), server-side networking (RMIServerManager), and parallel “servermodel” components that mirror the client’s functionality (e.g., administratorServerModel, loginRegisterServerModel, etc.).
- shared: Holds common networking interfaces (ClientCallback, RMIServer) and utility classes (e.g., Product, ProductList, EventType, User).
- Further, there is a “Testing” directory containing similar structure and tests for nearly every core component of the project.
- The “libraries” directory lists external jar dependencies (ControlsFX and PostgreSQL JDBC) that support the UI and database interactions.
- The clear separation of client, server, shared, and tests in the directory structure indicates the use of layered architecture where the client and server have dedicated responsibilities and communicate over RMI.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Layer"
        A["Client GUI Layer\n(FXML, Controllers, ViewModels)"]:::client
        B["Client Model Layer"]:::client
        C["Client Core/Factories & Navigation"]:::client
        D["Client Networking (RMIClient)"]:::client
    end

    subgraph "Server Layer"
        E["Server Entry Point & Networking\n(RunServer, RMIServerManager)"]:::server
        F["Server Models"]:::server
    end

    subgraph "Data Access Layer (DAO)"
        G["DAO Layer"]:::dao
    end

    subgraph "Shared Utilities"
        H["Shared/Utility Components"]:::shared
    end

    subgraph "Testing Environment"
        I["Testing Components"]:::testing
    end

    A -->|"triggers"| B
    B -->|"instantiates"| C
    C -->|"calls"| D
    D -->|"RMI"| E
    E -->|"routes"| F
    F -->|"queries"| G
    C -->|"utilizes"| H
    F -->|"uses"| H
    I -->|"tests"| A
    I -->|"tests"| F

    click A "https://github.com/gosiadrygala/finalproject/tree/main/PriceChecker/src/client/views"
    click B "https://github.com/gosiadrygala/finalproject/tree/main/PriceChecker/src/client/clientmodel"
    click C "https://github.com/gosiadrygala/finalproject/tree/main/PriceChecker/src/client/core"
    click D "https://github.com/gosiadrygala/finalproject/tree/main/PriceChecker/src/client/networking"
    click E "https://github.com/gosiadrygala/finalproject/tree/main/PriceChecker/src/server"
    click F "https://github.com/gosiadrygala/finalproject/tree/main/PriceChecker/src/server/networking/servermodel"
    click G "https://github.com/gosiadrygala/finalproject/tree/main/PriceChecker/src/dataaccess"
    click H "https://github.com/gosiadrygala/finalproject/tree/main/PriceChecker/src/shared"

    classDef client fill:#ccf2ff,stroke:#004d99,stroke-width:2px;
    classDef server fill:#ffcccc,stroke:#b30000,stroke-width:2px;
    classDef dao fill:#ffffcc,stroke:#999900,stroke-width:2px;
    classDef shared fill:#e6ffe6,stroke:#008000,stroke-width:2px;
    classDef testing fill:#e6e6fa,stroke:#9966cc,stroke-width:2px;
```
