# rocha7778/reactive-movie-reviews-service architecture

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

- Interactive diagram: https://gitdiagram.com/rocha7778/reactive-movie-reviews-service
- Repository: https://github.com/rocha7778/reactive-movie-reviews-service

## Overview

##### Project type and purpose
- From the file tree and README, we see a single Spring Boot application called “reactive-movie-reviews-service.”
- It’s a reactive, back-end service (no “frontend” folder) exposing a REST API for CRUD operations on movie reviews.
- It uses Spring WebFlux (functional router+handler) and a reactive data repository (Spring Data Reactive).

##### File structure
- Top-level: pom.xml, mvnw scripts, .mvn wrapper → a Maven-built Java Spring Boot project.
- src/main/java/com/rocha/aws/app:
- ReactiveMovieReviewsServiceApplication.java – the Spring Boot entry point.
- domain/Review.java – the domain model for reviews.
- route/ReviewRouter.java – functional routing definitions (endpoints).
- handler/ReviewHandler.java – the business logic for each route.
- repository/ReviewReactiveRepository.java – reactive CRUD against the data store.
- error/handler/* – a chain of ExceptionHandler implementations for custom error responses.
- src/main/resources/application.properties – externalized configuration.
- Tests in src/test/java mirror the main code’s structure.

##### README for additional insights
- The README only contains the project name, so we infer architecture purely from code structure.

##### Capturing essential details
- Folder’s responsibility as a separate component.
- Exception handling strategy as its own micro-component.
- Don’t overload: keep the focus on request → reactive processing → DB → response.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["Client"]:::client
    API["API Gateway / ALB"]:::gateway
    Client -->|HTTP Request| API
    API -->|Forward Request| Service

    subgraph "ReactiveMovieReviewsService" 
        direction TB
        Application["ReactiveMovieReviewsServiceApplication"]:::application
        Router["ReviewRouter"]:::router
        Handler["ReviewHandler"]:::handler
        Strategy["ExceptionHandlingStrategy"]:::error
        subgraph "Exception Handlers"
            direction TB
            DefaultHandler["DefaultExceptionHandler"]:::error
            GlobalExceptionHandler["GlobalExceptionHandler"]:::error
            GlobalExeptionHandler["GlobalExeptionHandler"]:::error
            ReviewDataExceptionHandler["ReviewDataExceptionHandler"]:::error
            ReviewNotFoundExceptionHandler["ReviewNotFoundExceptionHandler"]:::error
        end
        Repository["ReviewReactiveRepository"]:::repository
        Config["application.properties"]:::config
    end

    Service["ReactiveMovieReviewsService"]:::service
    Service --> Application
    Application --> Router
    Router -->|route request| Handler
    Handler -->|call repository| Repository
    Repository -->|async data| Database
    Handler -->|error| DefaultHandler
    DefaultHandler -->|next| GlobalExceptionHandler
    GlobalExceptionHandler -->|next| GlobalExeptionHandler
    GlobalExeptionHandler -->|next| ReviewDataExceptionHandler
    ReviewDataExceptionHandler -->|next| ReviewNotFoundExceptionHandler
    Config --> Service

    Database["Database"]:::database

    Database -->|Data Response| Handler
    Handler -->|Response| API
    API -->|HTTP Response| Client

    %% Click Events
    click Application "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/java/com/rocha/aws/app/ReactiveMovieReviewsServiceApplication.java"
    click Router "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/java/com/rocha/aws/app/route/ReviewRouter.java"
    click Handler "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/java/com/rocha/aws/app/handler/ReviewHandler.java"
    click Repository "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/java/com/rocha/aws/app/repository/ReviewReactiveRepository.java"
    click Strategy "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/java/com/rocha/aws/app/error/handler/ExceptionHandlingStrategy.java"
    click DefaultHandler "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/java/com/rocha/aws/app/error/handler/DefaultExceptionHandler.java"
    click GlobalExceptionHandler "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/java/com/rocha/aws/app/error/handler/GlobalExceptionHandler.java"
    click GlobalExeptionHandler "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/java/com/rocha/aws/app/error/handler/GlobalExeptionHandler.java"
    click ReviewDataExceptionHandler "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/java/com/rocha/aws/app/error/handler/ReviewDataExceptionHandler.java"
    click ReviewNotFoundExceptionHandler "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/java/com/rocha/aws/app/error/handler/ReviewNotFoundExceptionHandler.java"
    click Config "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/resources/application.properties"
    click Domain "https://github.com/rocha7778/reactive-movie-reviews-service/blob/main/src/main/java/com/rocha/aws/app/domain/Review.java"

    classDef client fill:#D0E6FA,stroke:#0366d6,stroke-width:1px
    classDef gateway fill:#FFE5B4,stroke:#d18b00,stroke-width:1px
    classDef service fill:#E8F5E9,stroke:#2e7d32,stroke-width:1px
    classDef application fill:#E3F2FD,stroke:#1E88E5,stroke-width:1px
    classDef router fill:#BBDEFB,stroke:#1976D2,stroke-width:1px
    classDef handler fill:#BBDEFB,stroke:#1976D2,stroke-width:1px
    classDef repository fill:#C8E6C9,stroke:#388E3C,stroke-width:1px
    classDef database fill:#C8E6C9,stroke:#388E3C,stroke-width:1px,shape:cylinder
    classDef error fill:#FFCDD2,stroke:#C62828,stroke-width:1px
    classDef config fill:#FFF9C4,stroke:#F9A825,stroke-width:1px
    class Domain fill:#E1F5FE,stroke:#0288D1,stroke-width:1px
```
