# dws-2025/project-grupo-18 architecture

> Architecture diagram of the GitHub repository dws-2025/project-grupo-18, 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/dws-2025/project-grupo-18
- Repository: https://github.com/dws-2025/project-grupo-18

## Overview

##### Project Type & Purpose
- The file structure and naming conventions (e.g., “JobmatcherApplication.java”) indicate a web application.
- The use of packages like controller, service, repository, and model confirms an MVC (Model–View–Controller) architecture.
- The presence of static resources (CSS, JavaScript, images) and templates in the “src/main/resources” directory shows that the UI is server-rendered.

##### Analyzing the File Structure
- Top-Level Structure: The project uses Maven (pom.xml, mvnw, etc.) for build and dependency management.
- Package Organization: The “es/grupo18/jobmatcher” package clearly separates concerns:
- Controllers: Manage HTTP requests and dispatch responses (e.g., BlogController, ImageController, etc.).
- Models: Represent domain entities such as Company, Post, Review, and User.
- Repositories: Likely use Spring Data JPA to interact with the database.
- Services: Contain business logic (e.g., CompanyService, DataGeneratorService, PostService, etc.).
- Resources: The “src/main/resources” folder contains application properties, static assets, and Thymeleaf (or similar) templates for views, highlighting the MVC architecture.
- Tests: A typical unit/integration test suite structure is provided under “src/test”.

a. Main Components:
- Web Layer (Frontend):
▪ View Templates: HTML files under the templates directory.
▪ Static Assets: CSS, JavaScript, and image files in the static folder.
- Controller Layer:
▪ Controllers (e.g., BlogController, CompaniesController, etc.) responsible for receiving and processing web requests.
- Service Layer:
▪ Business Logic Services (e.g., UserService, CompanyService) that act as an intermediary between controllers and repositories.
- Data Access Layer:
▪ Repositories (e.g., UserRepository, CompanyRepository) that perform CRUD operations typically via an ORM (likely Hibernate/JPA).
- Domain Layer:
▪ Models (e.g., User, Company, Post, Review) that represent the core business entities.
- External Components:
▪ Database: While not explicitly shown in the tree, it is implied by the existence of repository interfaces.
▪ Possibly other integrations (e.g., error handling through CustomErrorController, external API integrations if any).

b. Relationships and Interactions:
- The client (browser) makes HTTP requests to the controllers.
- Controllers delegate to Services to process business logic.
- Services perform data operations through Repositories.
- Data flows from the database to the domain models, then to the presentation layer via templates.
- Static resources provide front-end styling and behavior for a better user experience.

c. Architectural Patterns & Design Principles:
- MVC Pattern: Explicit separation into Model (domain objects), View (templates/static resources), and Controller (handlers).
- Layered Architecture: Distinct separation among controllers, services, and data access (repositories), which improves maintainability and scalability.
- Use of Dependency Injection: While not visible in the file tree, Spring Boot conventionally employs dependency injection to promote modularity.

d. Technologies and Frameworks:
- Java, Spring Boot, Spring MVC, Spring Data JPA.
- Maven for dependency management and building the project.
- Thymeleaf or a similar templating engine for generating dynamic HTML views.
- Static resources (CSS, JavaScript) enhancing user experience.
- Likely a relational database (implied by the repositories) and possibly JPA/Hibernate as ORM.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Client (Browser)"]:::client

    subgraph "Frontend"
        FT["View Templates"]:::frontendTemplates
        FS["Static Assets"]:::frontendAssets
    end

    subgraph "Backend"
        AP["Application Config & Startup"]:::appConfig
        CT["Controllers"]:::controller
        SV["Services"]:::service
        RP["Repositories"]:::repository
        DM["Domain Models"]:::model
    end

    DB["Database"]:::database
    BM["Build & Dependency Management"]:::build

    A -->|"HTTP-Request"| CT
    CT -->|"DelegatesTo"| SV
    SV -->|"Calls"| RP
    RP -->|"CRUDOperations"| DB
    SV -->|"MapsEntities"| DM
    CT -->|"RendersView"| FT
    CT -->|"UsesStatic"| FS
    BM -->|"Builds"| AP
    AP -->|"WiresControllers"| CT
    AP -->|"WiresServices"| SV
    AP -->|"WiresRepositories"| RP
    AP -->|"InitializesModels"| DM

    click FT "https://github.com/dws-2025/project-grupo-18/tree/main/src/main/resources/templates"
    click FS "https://github.com/dws-2025/project-grupo-18/tree/main/src/main/resources/static"
    click CT "https://github.com/dws-2025/project-grupo-18/tree/main/src/main/java/es/grupo18/jobmatcher/controller"
    click SV "https://github.com/dws-2025/project-grupo-18/tree/main/src/main/java/es/grupo18/jobmatcher/service"
    click RP "https://github.com/dws-2025/project-grupo-18/tree/main/src/main/java/es/grupo18/jobmatcher/repository"
    click DM "https://github.com/dws-2025/project-grupo-18/tree/main/src/main/java/es/grupo18/jobmatcher/model"
    click AP "https://github.com/dws-2025/project-grupo-18/blob/main/src/main/java/es/grupo18/jobmatcher/JobmatcherApplication.java"
    click BM "https://github.com/dws-2025/project-grupo-18/blob/main/pom.xml"

    classDef client fill:#f9f,stroke:#333,stroke-width:2px
    classDef frontendTemplates fill:#ccffcc,stroke:#333,stroke-width:2px
    classDef frontendAssets fill:#ccffcc,stroke:#333,stroke-width:2px
    classDef controller fill:#ffcccc,stroke:#333,stroke-width:2px
    classDef service fill:#cce5ff,stroke:#333,stroke-width:2px
    classDef repository fill:#e6ccff,stroke:#333,stroke-width:2px
    classDef model fill:#ffffcc,stroke:#333,stroke-width:2px
    classDef database fill:#d1e7dd,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5
    classDef build fill:#f8d7da,stroke:#333,stroke-width:2px
    classDef appConfig fill:#ffe5b4,stroke:#333,stroke-width:2px
```
