# entwoy/spring-angular-eagleflicks architecture

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

- Interactive diagram: https://gitdiagram.com/entwoy/spring-angular-eagleflicks
- Repository: https://github.com/entwoy/spring-angular-eagleflicks

## Overview

##### Main Components
- Frontend Application (Angular): This component handles routing, views, user interactions, and connects to backend APIs. Represent the Angular app with its subcomponents (pages, login, movie-listing, detail views, etc.).
- Database (MySQL): Show this as the persistent data storage that holds user records, movie data, and any additional streaming metadata.
- External Resources and Tools: Although not an architectural component per se, reference that the project uses Maven for build processes and configuration files (application.properties) for database and server settings.

##### Relationships and Interactions
- The backend connects to the MySQL database for data persistence. Represent these interactions and indicate that Spring Data JPA is used.

##### Architectural Patterns and Design Principles
- Model–View–Controller (MVC): Present in the backend where controllers handle HTTP requests and delegate to services.
- Layered Architecture: Separate layers (presentation, business, data access) with clear dependency directions.
- Security is implemented using JWT-based authentication and authorization, so include security modules with filters and token utilities.
- For the Angular frontend, display routing and components hierarchies.

##### Technologies and Frameworks
- Backend: Java with Spring Boot, Spring MVC, Spring Data JPA, JWT security.
- Frontend: Angular (with TypeScript) and its components, services, and routing.
- Database: MySQL, with JDBC configuration defined in application.properties.
- Build and Dependency Management: Maven for the backend, npm and Angular CLI for the frontend.

##### Putting It All Together
- Under the Backend block, nest or segment by layers/divisions (Controller layer, Service/Business layer, Data/Repository layer, and Security components) to reflect the MVC and layered architecture.

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Subgraph
    subgraph "Angular Frontend"
        FE["Angular Frontend (localhost:4200)"]:::frontend
        FEComp["Components (pages,login,movie_listing)"]:::frontend
        FEServ["Services & Routing"]:::frontend
    end

    %% Backend Subgraph
    subgraph "Spring Boot Backend"
        API["API Controllers (Spring Boot,localhost:8091)"]:::backend
        SVC["Service Layer"]:::backend
        REPO["Repository Layer"]:::backend
        SEC["Security (JWT Authentication)"]:::backend
        CONF["Application Config"]:::backend
        MAVEN_MAIN["Maven Build (Main)"]:::backend
        MAVEN_BIN["Maven Build (Bin)"]:::backend
    end

    %% Database Node
    DB["MySQL Database"]:::database

    %% Relationships between Frontend and Backend
    FE -->|"HTTP_REST_API"| API

    %% Internal Frontend Details (optional visual grouping with dashed lines)
    FE --> FEComp
    FE --> FEServ

    %% Backend flow: Controllers delegate to Service layer, then Repository layer, then Database
    API -->|"delegates_to"| SVC
    SVC -->|"calls"| REPO
    REPO -->|"persists_data"| DB

    %% Security integration in Backend
    SEC -->|"secures"| API
    CONF -->|"configures"| SEC
    CONF -->|"configures"| API

    %% Maven build configurations feeding into application config
    MAVEN_MAIN -->|"builds"| CONF
    MAVEN_BIN -->|"builds"| CONF

    %% Click Events for Angular Frontend Components
    click FE "https://github.com/entwoy/spring-angular-eagleflicks/tree/main/eagleflicks-frontend"
    click FEComp "https://github.com/entwoy/spring-angular-eagleflicks/tree/main/eagleflicks-frontend/src/app/components"
    click FEServ "https://github.com/entwoy/spring-angular-eagleflicks/blob/main/eagleflicks-frontend/src/app/api.service.ts"
    click FEServ "https://github.com/entwoy/spring-angular-eagleflicks/blob/main/eagleflicks-frontend/src/app/app-routing.module.ts"
    click FEServ "https://github.com/entwoy/spring-angular-eagleflicks/tree/main/eagleflicks-frontend/src/app/services"

    %% Click Events for Spring Boot Backend Components
    click API "https://github.com/entwoy/spring-angular-eagleflicks/tree/main/eagleflicks-backend/src/main/java/com/spring/angular/controllers"
    click SVC "https://github.com/entwoy/spring-angular-eagleflicks/tree/main/eagleflicks-backend/src/main/java/com/spring/angular/services"
    click REPO "https://github.com/entwoy/spring-angular-eagleflicks/tree/main/eagleflicks-backend/src/main/java/com/spring/angular/repositories"
    click SEC "https://github.com/entwoy/spring-angular-eagleflicks/tree/main/eagleflicks-backend/src/main/java/com/spring/angular/security"
    click CONF "https://github.com/entwoy/spring-angular-eagleflicks/blob/main/eagleflicks-backend/src/main/resources/application.properties"
    click MAVEN_MAIN "https://github.com/entwoy/spring-angular-eagleflicks/blob/main/eagleflicks-backend/pom.xml"
    click MAVEN_BIN "https://github.com/entwoy/spring-angular-eagleflicks/blob/main/eagleflicks-backend/bin/pom.xml"

    %% Click Event for Database
    click DB "https://github.com/entwoy/spring-angular-eagleflicks/tree/main/database/database_mysql"

    %% Styling Classes
    classDef frontend fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef backend fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px;
    classDef database fill:#ffe0b2,stroke:#e65100,stroke-width:2px;
```
