# guravamey/reactiveworkshopnew architecture

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

- Interactive diagram: https://gitdiagram.com/guravamey/reactiveworkshopnew
- Repository: https://github.com/guravamey/reactiveworkshopnew

## Overview

##### Main Components
- Application Entry Point: Represent the main Spring Boot application (ReactiveWorkshopApplication) which bootstraps the whole service.
- Controllers:
- PokemonController: Manages endpoints for fetching Pokémon lists, details, and summaries.
- StreamingController: Handles endpoints that demonstrate real-time reactive streaming (e.g., streaming flux data).
- Service Layer:
- PokemonService: Encapsulates business logic, such as consuming the external Pokémon API client and processing data.
- FluxAndMonoServices: Contains methods that illustrate reactive operations (using Mono and Flux).
- Client Interfaces:
- IPokemonApiClient: Acts as the interface for outbound calls to external services (e.g., https://pokeapi.co), modeling the integration point.
- Data Models:
- Models like PokemonData, PokemonList, PokemonListItem, and PokemonSummary, which represent the data structures exchanged between components.
- Configuration & Properties:
- Multiple properties files (application-development.properties, application-prod.properties, etc.) indicating environment-based configurations.
- Testing Infrastructure:
- Separate test packages and test classes (e.g., ReactiveWorkshopApplicationTests, ReactiveWorkshopControllerTest) to validate the functionality and reactive flows.

##### Relationships and Interactions
- Additionally, include any dependencies on configuration settings (from application.properties files) that determine the application behavior depending on the environment.

##### Architectural Patterns and Design Principles
- Use of reactive streams (Flux and Mono) by labeling the interactions between controllers and services as “reactive flow” to underscore asynchronous data propagation.
- If applicable, add a quick mention of the use of Lombok to reduce boilerplate in the model and service classes.

##### Relevant Technologies, Frameworks, and Libraries
- Java 17 as the runtime environment.
- Maven (with the Maven Wrapper in the repository) for build and dependency management.
- Spring Boot (with Webflux) as the backend framework.
- Lombok for simplifying Java model and service classes.
- External integration with https://pokeapi.co for the Pokémon API data.

- Overall Container: “Reactive Workshop Application (Spring Boot Webflux)” – show it as the outer boundary.
- Within the container, nest the Application Entry Point (ReactiveWorkshopApplication).
- Branch out to show two primary flows:
- HTTP Requests hitting the Controllers (PokemonController and StreamingController).
- Flowers from these controllers to the business logic layer — the services.
- Annotations where required to denote testing and configuration aspects.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Outer container
    subgraph "Reactive Workshop Application (Spring Boot Webflux)"
        A["ReactiveWorkshopApplication - Main Entry"] 
        %% Controllers section
        subgraph "Controllers"
            B["PokemonController - REST Endpoint Controller"]
            C["StreamingController - Real-time Streaming Controller"]
        end
        %% Services section
        subgraph "Services"
            D["PokemonService (Business Logic Service)"]
            E["FluxAndMonoServices (Reactive Service)"]
        end
        F["IPokemonApiClient (External API Client)"]
        G["(External PokeAPI)"]
        %% Auxiliary components
        subgraph "Auxiliary Components"
            H["Data Models"]
            I["Configuration & Properties"]
            J["Testing Infrastructure"]
        end
    end

    %% Client/Browser initiating requests
    K["Client/Browser"]

    %% Arrows representing data flow
    K -->|"HTTP_request"| B
    K -->|"HTTP_request"| C
    A --> B
    A --> C
    B -->|"reactive_flow"| D
    C -->|"reactive_flow"| E
    D -->|"reactive_call"| F
    F -->|"external_call"| G

    %% Click events for component mapping
    click A "https://github.com/guravamey/reactiveworkshopnew/blob/main/src/main/java/com/elsevier/scopus/reactiveworkshop/ReactiveWorkshopApplication.java"
    click B "https://github.com/guravamey/reactiveworkshopnew/blob/main/src/main/java/com/elsevier/scopus/reactiveworkshop/controllers/PokemonController.java"
    click C "https://github.com/guravamey/reactiveworkshopnew/blob/main/src/main/java/com/elsevier/scopus/reactiveworkshop/controllers/StreamingController.java"
    click D "https://github.com/guravamey/reactiveworkshopnew/blob/main/src/main/java/com/elsevier/scopus/reactiveworkshop/services/PokemonService.java"
    click E "https://github.com/guravamey/reactiveworkshopnew/blob/main/src/main/java/com/elsevier/scopus/reactiveworkshop/services/FluxAndMonoServices.java"
    click F "https://github.com/guravamey/reactiveworkshopnew/blob/main/src/main/java/com/elsevier/scopus/reactiveworkshop/clients/IPokemonApiClient.java"
    click H "https://github.com/guravamey/reactiveworkshopnew/tree/main/src/main/java/com/elsevier/scopus/reactiveworkshop/models"
    click I "https://github.com/guravamey/reactiveworkshopnew/tree/main/src/main/resources"
    click J "https://github.com/guravamey/reactiveworkshopnew/tree/main/src/test/java/com/elsevier/scopus/reactiveworkshop"

    %% Styles for colors
    class A application;
    class B,C controller;
    class D,E service;
    class F,G external;
    class H data;
    class I config;
    class J testing;
    
    %% Class Definitions
    classDef application fill:#ffcccc,stroke:#990000,stroke-width:2px;
    classDef controller fill:#cce5ff,stroke:#0066cc,stroke-width:2px;
    classDef service fill:#ccffcc,stroke:#339933,stroke-width:2px;
    classDef external fill:#ffeecc,stroke:#cc6600,stroke-width:2px;
    classDef data fill:#e6e6e6,stroke:#666666,stroke-width:2px;
    classDef config fill:#fff9cc,stroke:#cc9933,stroke-width:2px;
    classDef testing fill:#f2ccff,stroke:#9966cc,stroke-width:2px;
```
