# bogdan016/mymdb-website architecture

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

- Interactive diagram: https://gitdiagram.com/bogdan016/mymdb-website
- Repository: https://github.com/bogdan016/mymdb-website

## Overview

##### Main Components
- Frontend/UI Layer: This includes the static HTML pages (index.html, movies.html, actors.html, etc.), CSS files (Styles.css), and associated JavaScript (index.js). It represents the client side which interacts with end users.
- Backend Application (Business Logic): The Java Spring Boot application structured with a clear MVC pattern. This is divided into:
- Controllers (e.g., DistributieController, ExceptiiController, FilmController, PersoanaController, StudioController) which handle HTTP requests.
- Services (e.g., FilmService, StudioService, etc.) containing business logic.
- Repositories (e.g., FilmInterface, StudioInterface, etc.) which handle data access for the underlying entities.
- Entities (e.g., FilmEntity, PersoanaEntity, StudioEntity, etc.) representing the data models.
- Database: A MySQL database (as stated in the README) which is used to persist movie data and related information.
- Build/Deployment: Indicate that Gradle (with build.gradle and gradlew scripts) is used as the build tool, hinting at how the project is compiled and deployed.

##### Relationships and Data Flow
- How client requests (from the browser) are sent to the Spring Boot backend.
- Within the backend, illustrate the typical flow: an incoming HTTP request is handled by a Controller, which forwards the request to a Service layer. The Service then calls the appropriate Repository to interact with the database.

##### Architectural Patterns & Design Principles
- MVC pattern within the application’s Java package structure.
- Separation of concerns where each layer (controller, service, repository, entity) has its own responsibility.
- Mention that the project uses Gradle for building and dependency management as an important deployment consideration.
- That the frontend and backend are logically separated – even though they coexist in the same repository, they play distinct roles (one for client-side presentation and one for server-side business logic).

##### Technologies and Frameworks
- Java Spring Boot as the server framework.
- MySQL as the database engine.
- Mention HTML, CSS, Bootstrap, and jQuery for the client interface.
- Postman for API testing.
- Gradle as the build/deployment tool.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend/UI Layer"
        FE1["index.html"]:::frontend
        FE2["movies.html"]:::frontend
        FE3["actors.html"]:::frontend
        FE4["actresses.html"]:::frontend
        FE5["contact.html"]:::frontend
        FE6["Studio&Producator.html"]:::frontend
        FE7["Studioexecutive.html"]:::frontend
        FE8["Styles.css"]:::frontend
        FE9["index.js"]:::frontend
    end

    %% Backend Application (Spring Boot)
    subgraph "Java Spring Boot Application"
        %% Controllers
        subgraph "Controllers"
            C1["DistributieController"]:::controller
            C2["ExceptiiController"]:::controller
            C3["FilmController"]:::controller
            C4["PersoanaController"]:::controller
            C5["StudioController"]:::controller
        end

        %% Services
        subgraph "Services"
            S1["DistributieService"]:::service
            S2["ExceptiiService"]:::service
            S3["FilmService"]:::service
            S4["PersoanaService"]:::service
            S5["StudioService"]:::service
        end

        %% Repositories
        subgraph "Repositories"
            R1["DistributieInterface"]:::repository
            R2["ExceptiiInterface"]:::repository
            R3["FilmInterface"]:::repository
            R4["PersoanaInterface"]:::repository
            R5["StudioInterface"]:::repository
        end

        %% Entities
        subgraph "Entities"
            E1["DistributieEntity"]:::entity
            E2["ExceptiiEntity"]:::entity
            E3["FilmEntity"]:::entity
            E4["PersoanaEntity"]:::entity
            E5["StudioEntity"]:::entity
        end
    end

    %% Database and Configuration
    DB["MySQL Database"]:::database
    AP["application.properties"]:::config

    %% External Tool
    PM["Postman"]:::external

    %% Build/Deployment Configuration
    GB["Gradle Build Scripts"]:::build

    %% Connections

    %% Frontend to Backend Controllers (HTTP Request)
    FE1 -->|"HTTP Request"| C3
    FE2 -->|"HTTP Request"| C3
    FE3 -->|"HTTP Request"| C4
    FE4 -->|"HTTP Request"| C4
    FE5 -->|"HTTP Request"| C2
    FE6 -->|"HTTP Request"| C5
    FE7 -->|"HTTP Request"| C5
    FE8 -->|"Styles applied"| FE1
    FE9 -->|"Script executed"| FE1

    %% Postman interacts with Controllers
    PM ---|"API Testing"| C1
    PM ---|"API Testing"| C2
    PM ---|"API Testing"| C3
    PM ---|"API Testing"| C4
    PM ---|"API Testing"| C5

    %% Controllers to Services
    C1 -->|"calls"| S1
    C2 -->|"calls"| S2
    C3 -->|"calls"| S3
    C4 -->|"calls"| S4
    C5 -->|"calls"| S5

    %% Services to Repositories
    S1 -->|"calls"| R1
    S2 -->|"calls"| R2
    S3 -->|"calls"| R3
    S4 -->|"calls"| R4
    S5 -->|"calls"| R5

    %% Repositories to Entities
    R1 -->|"maps to"| E1
    R2 -->|"maps to"| E2
    R3 -->|"maps to"| E3
    R4 -->|"maps to"| E4
    R5 -->|"maps to"| E5

    %% Entities to Database
    E1 -->|"persists to"| DB
    E2 -->|"persists to"| DB
    E3 -->|"persists to"| DB
    E4 -->|"persists to"| DB
    E5 -->|"persists to"| DB

    %% Database configuration connection
    AP ---|"DB Config"| DB

    %% Build/Deployment affecting Backend
    GB ---|"Builds"| C1
    GB ---|"Builds"| C2
    GB ---|"Builds"| C3
    GB ---|"Builds"| C4
    GB ---|"Builds"| C5
    GB ---|"Builds"| S1
    GB ---|"Builds"| S2
    GB ---|"Builds"| S3
    GB ---|"Builds"| S4
    GB ---|"Builds"| S5
    GB ---|"Builds"| R1
    GB ---|"Builds"| R2
    GB ---|"Builds"| R3
    GB ---|"Builds"| R4
    GB ---|"Builds"| R5
    GB ---|"Builds"| E1
    GB ---|"Builds"| E2
    GB ---|"Builds"| E3
    GB ---|"Builds"| E4
    GB ---|"Builds"| E5

    %% Click Events for Frontend Files
    click FE1 "https://github.com/bogdan016/mymdb-website/blob/main/index.html"
    click FE2 "https://github.com/bogdan016/mymdb-website/blob/main/movies.html"
    click FE3 "https://github.com/bogdan016/mymdb-website/blob/main/actors.html"
    click FE4 "https://github.com/bogdan016/mymdb-website/blob/main/actresses.html"
    click FE5 "https://github.com/bogdan016/mymdb-website/blob/main/contact.html"
    click FE6 "https://github.com/bogdan016/mymdb-website/blob/main/Studio&Producator.html"
    click FE7 "https://github.com/bogdan016/mymdb-website/blob/main/Studioexecutive.html"
    click FE8 "https://github.com/bogdan016/mymdb-website/blob/main/Styles.css"
    click FE9 "https://github.com/bogdan016/mymdb-website/blob/main/index.js"

    %% Click Events for Backend Controllers
    click C1 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Controller/DistributieController.java"
    click C2 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Controller/ExceptiiController.java"
    click C3 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Controller/FilmController.java"
    click C4 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Controller/PersoanaController.java"
    click C5 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Controller/StudioController.java"

    %% Click Events for Backend Services
    click S1 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Service/DistributieService.java"
    click S2 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Service/ExceptiiService.java"
    click S3 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Service/FilmService.java"
    click S4 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Service/PersoanaService.java"
    click S5 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Service/StudioService.java"

    %% Click Events for Backend Repositories
    click R1 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Repository/DistributieInterface.java"
    click R2 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Repository/ExceptiiInterface.java"
    click R3 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Repository/FilmInterface.java"
    click R4 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Repository/PersoanaInterface.java"
    click R5 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Repository/StudioInterface.java"

    %% Click Events for Backend Entities
    click E1 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Entity/DistributieEntity.java"
    click E2 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Entity/ExceptiiEntity.java"
    click E3 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Entity/FilmEntity.java"
    click E4 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Entity/PersoanaEntity.java"
    click E5 "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/java/com/Spring/Spring/Entity/StudioEntity.java"

    %% Click Event for Build/Deployment
    click GB "https://github.com/bogdan016/mymdb-website/tree/main/ProiectJava/Spring/Spring"

    %% Click Event for Database Configuration
    click AP "https://github.com/bogdan016/mymdb-website/blob/main/ProiectJava/Spring/Spring/src/main/resources/application.properties"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef controller fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef service fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef repository fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef entity fill:#f5c6cb,stroke:#721c24,stroke-width:2px;
    classDef database fill:#ffeeba,stroke:#856404,stroke-width:2px,stroke-dasharray: 5 5;
    classDef external fill:#d1ecf1,stroke:#0c5460,stroke-width:2px,stroke-dasharray: 2 2;
    classDef build fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
    classDef config fill:#fefefe,stroke:#6c757d,stroke-width:2px,stroke-dasharray: 3 3;
```
