# fionaverzivolli/eventhiveuoft architecture

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

- Interactive diagram: https://gitdiagram.com/fionaverzivolli/eventhiveuoft
- Repository: https://github.com/fionaverzivolli/eventhiveuoft

## Overview

##### Main Components
- Frontend / Presentation Layer:
– Represented by the "view" package and parts of the interface_adapter (e.g., LoginView, CreateEventView, DisplayEventView, etc.). This layer is responsible for handling user interaction through the various UI screens (including the interactive campus map using JXMapViewer) and routing display output.
- Application/Use Case Layer:
– Located under the "use_case" packages. This is where the business logic resides. For each feature (such as event creation, modification, RSVP handling, login, registration, etc.), there are corresponding interactors and associated input/output boundary interfaces.
- Data Access Layer:
– Found within packages like "data_access" as well as parts handling Firebase configuration and Email sending. This layer interfaces with external dependencies such as Firebase for persistent storage and email notifications.
- Domain/Entity Layer:
– The "entity" package holds core business entities (e.g., Event, User) and their factories, encapsulating essential business rules.
- Testing:
– Although not directly part of runtime architecture, the "src/test" directory confirms the use of unit testing across components.

##### Relationships and Data Flow
– Interface Adapters (Controllers, Presenters, View Models)
– Use Cases / Interactors (each feature’s core driver, for example, CreateEventInteractor, LoginInteractor, RSVPEventInteractor)
– Gateway / Data Access components (FirebaseService, EmailSender, DAOs)
– Domain Entities (Event, User)
– User actions in the Presentation Layer → Requests routed to Controllers → Passed to Interactors (Use Case Layer)
– Interactors call Data Access interfaces (via Firebase or Email services) and send processed data back through Presenters → then update the Views.
- External services like Firebase (for storage, authentication, and real-time updates) and the email infrastructure (via EmailSender).

##### Architectural Patterns
- Clean Architecture / Hexagonal Architecture:
– Emphasize the separation where the outer layers (interface_adapter and data_access) depend on inner use cases and domain, not vice versa.
- MVC-like Separation:
– Although a strict MVC isn’t used, the separation of controllers (handling input logic), presenters (processing data for the views), and view classes is critical.
- Dependency Inversion:
– The use of interfaces (e.g., data access interfaces in use cases) shows the inversion of dependencies, allowing for better testing and flexibility.

##### Relevant Technologies/Frameworks
- Java with Spring Boot (as indicated by Maven’s pom.xml and Spring Boot’s typical dependencies).
- Firebase (for storage, authentication, and real-time database, managed through FirebaseConfig and FirebaseService).
- JXMapViewer library for the interactive map.
- Maven as the build tool.
- Testing frameworks integrated into the src/test suite (JUnit, etc.).

##### Additional Details
- Asynchronous or real-time elements (especially for email notifications and live event updates via Firebase).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Actor
    U("User"):::external

    %% Presentation Layer
    subgraph "Presentation Layer"
        A["Views"]:::presentation
        B["Interface Adapters"]:::presentation
    end

    %% Application/Use Case Layer
    subgraph "Application/Use Case Layer"
        C["Use Cases"]:::use_case
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        D["Data Access"]:::data_access
        E["Firebase Service"]:::data_access
        F["Email Service"]:::data_access
    end

    %% Domain/Entity Layer
    subgraph "Domain/Entity Layer"
        G["Entities"]:::domain
    end

    %% Testing Layer
    subgraph "Testing"
        H["Unit Tests"]:::testing
    end

    %% Flow Connections
    U -->|"triggers"| A
    A -->|"sendsInput"| B
    B -->|"invokesLogic"| C
    C -->|"accesses"| D
    D -->|"storesData"| E
    D -->|"sendsEmail"| F
    C -->|"manipulates"| G
    G -->|"returnsData"| C
    C -->|"updates"| B
    B -->|"renders"| A
    A -->|"displays"| U

    %% Click Events for Component Mapping
    click A "https://github.com/fionaverzivolli/eventhiveuoft/tree/main/src/main/java/app/view"
    click B "https://github.com/fionaverzivolli/eventhiveuoft/tree/main/src/main/java/app/interface_adapter"
    click C "https://github.com/fionaverzivolli/eventhiveuoft/tree/main/src/main/java/app/use_case"
    click D "https://github.com/fionaverzivolli/eventhiveuoft/tree/main/src/main/java/app/data_access"
    click G "https://github.com/fionaverzivolli/eventhiveuoft/tree/main/src/main/java/app/entity"
    click H "https://github.com/fionaverzivolli/eventhiveuoft/tree/main/src/test"

    %% Class Definitions for Coloring
    classDef presentation fill:#CCF,stroke:#003,stroke-width:2px;
    classDef use_case fill:#CFC,stroke:#030,stroke-width:2px;
    classDef data_access fill:#FFC,stroke:#990,stroke-width:2px;
    classDef domain fill:#CFF,stroke:#039,stroke-width:2px;
    classDef testing fill:#FDD,stroke:#900,stroke-width:2px;
    classDef external fill:#EFE,stroke:#060,stroke-width:2px;
```
