# agusev/software-engineering-team-project architecture

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

- Interactive diagram: https://gitdiagram.com/agusev/software-engineering-team-project
- Repository: https://github.com/agusev/software-engineering-team-project

## Overview

##### Project type and purpose
- The project is a full-stack web application called “GatorShare,” containing a React-based client and a Java server.
- The client (located in application/client) handles the user interface, comprising various components for authentication, posts, profiles, messages, home, about, etc.
- The server (located in application/server/GatorShare) manages backend logic, data access, and API endpoints. It uses a layered structure (DTOs, Service classes, Repositories, Exceptions, and configuration) indicating a standard MVC or service/repository design.

##### File structure and key architectural clues
- Frontend:
- The package.json, src directory, and organized components (e.g., SearchResults, Auth, Posts, Profile) indicate a React application.
- There are configuration and HTTP utility files (http-common.js, http-form-data.js) that suggest standard REST API communication.
- Backend:
- The server contains a Maven project with a pom.xml and a main Java application entry point (GatorShareApplication.java).
- Its package structure includes:
- Dto for data transfer objects,
- Exceptions for error handling,
- Repo for data persistence,
- Service for business logic,
- Config for configuration such as Swagger for API documentation.
- Such a structure reflects a robust layered architecture with separation of concerns.

##### Main components
a. Frontend Component:
- React application, showing key modules like Home, Authentication (Login/SignUp), Profile, Posts, Messages, Navigation, etc.
- HTTP utilities that serve as the interface for API calls.
b. Backend Component:
- Server application (GatorShare) as a central module.
- Within the server, break down the layered architecture:
- Controllers (implied through request handling even if not explicitly separated in the file tree but integrated within Application.java and exception handlers)
- Service layer (for business logic: UserService, MessageService, ImageStorageService, postService, commentService, etc.)
- Repository layer (for database interactions: UserRepository, RoleRepo, TokenRepo, etc.)
- DTOs used for transferring data between layers.
- Exception handling blocks (custom exceptions and a controller for exceptions)
- Configuration components (SwaggerConfig, application.properties for runtime settings).
c. Data Storage / Database:
- Although no explicit database configuration file is shown, the existence of Repository classes implies an underlying database.
- Database as a separate component interacting with the Repository layer.

- Error handling flows (exceptions) that bubble up from lower layers.
- Configuration components (e.g., Swagger, application.properties) influencing the server behavior.
- Optionally, note logging, security (authentication via tokens), and any external storage (images) managed by services.

##### Architectural Patterns and Relevant Technologies
- Clear client-server separation.
- For the backend, note the use of a layered architecture (DTOs, Service, Repository) which is common in Spring Boot/MVC applications.
- For the frontend, note the component-based structure inherent to React.
- Mention that HTTP communication is central (as seen in HTTP utility files).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend (React Client)"
        RC["React Client Application"]:::frontend
        subgraph "UI Components"
            HOME["Home"]:::frontend
            NAV["Navbar"]:::frontend
            subgraph "Authentication"
                LOGIN["Login"]:::frontend
                SIGNUP["SignUp"]:::frontend
            end
            POSTS["Posts"]:::frontend
            PROFILE["Profile"]:::frontend
            MESSAGES["Messages"]:::frontend
            ABOUT["About"]:::frontend
            MISC["Miscellaneous"]:::frontend
            SEARCH["Search Results"]:::frontend
        end
        subgraph "HTTP Utilities"
            HTTP_CONFIG["HTTP Config"]:::utility
            HTTP_FORM["HTTP Form Data Utility"]:::utility
        end
    end

    %% Backend Layer
    subgraph "Backend"
        SERVER["Server Application (GatorShare)"]:::backend
        SERVER --> CONTROLLER["Controllers (API)"]:::backend
        CONTROLLER --> SERVICE["Service Layer"]:::backend
        SERVICE --> REPOSITORY["Repository Layer"]:::backend
        REPOSITORY -->|"DataAccess"| DB["Database"]:::db

        %% DTO and Exception Layers
        subgraph "DTO & Exceptions"
            DTO_NODE["DTOs"]:::backend
            EXCEPTIONS["Exceptions"]:::backend
        end
        CONTROLLER --> DTO_NODE
        CONTROLLER --> EXCEPTIONS
        SERVICE --> DTO_NODE
        SERVICE --> EXCEPTIONS

        %% Configuration Components
        subgraph "Configuration"
            SWAGGER["Swagger Config"]:::config
            MSGSTR["Message Strings"]:::config
        end
        SERVER --> SWAGGER
        SERVER --> MSGSTR

        %% Application Properties
        APP_PROP["Application Properties"]:::config
        SERVER --> APP_PROP
    end

    %% Interactions between Frontend and Backend
    HTTP_CONFIG ==>|"RESTCalls"| SERVER
    HTTP_FORM ==>|"RESTCalls"| SERVER

    %% Styles
    classDef frontend fill:#8ecae6,stroke:#219ebc,stroke-width:2px,color:#000;
    classDef backend fill:#ffb703,stroke:#fb8500,stroke-width:2px,color:#000;
    classDef utility fill:#90be6d,stroke:#43aa8b,stroke-width:2px,color:#000;
    classDef config fill:#bdb2ff,stroke:#6a4c93,stroke-width:2px,color:#000;
    classDef db fill:#e0fbfc,stroke:#00b4d8,stroke-width:2px,color:#000;

    %% Click Events - Frontend
    click RC "https://github.com/agusev/software-engineering-team-project/tree/master/application/client"
    click HOME "https://github.com/agusev/software-engineering-team-project/blob/master/application/client/src/components/home/Home.js"
    click NAV "https://github.com/agusev/software-engineering-team-project/blob/master/application/client/src/components/navbar/Navbar.js"
    click LOGIN "https://github.com/agusev/software-engineering-team-project/blob/master/application/client/src/components/auth/Login.js"
    click SIGNUP "https://github.com/agusev/software-engineering-team-project/blob/master/application/client/src/components/auth/SignUp.js"
    click POSTS "https://github.com/agusev/software-engineering-team-project/blob/master/application/client/src/components/posts/Posts.js"
    click PROFILE "https://github.com/agusev/software-engineering-team-project/blob/master/application/client/src/components/profile/Profile.js"
    click MESSAGES "https://github.com/agusev/software-engineering-team-project/blob/master/application/client/src/components/messages/Messages.js"
    click ABOUT "https://github.com/agusev/software-engineering-team-project/blob/master/application/client/src/components/about/About.js"
    click MISC "https://github.com/agusev/software-engineering-team-project/tree/master/application/client/src/components/misc/"
    click SEARCH "https://github.com/agusev/software-engineering-team-project/blob/master/application/client/src/components/SearchResults/SearchResults.js"
    click HTTP_CONFIG "https://github.com/agusev/software-engineering-team-project/blob/master/application/client/src/http-common.js"
    click HTTP_FORM "https://github.com/agusev/software-engineering-team-project/blob/master/application/client/src/http-form-data.js"

    %% Click Events - Backend
    click SERVER "https://github.com/agusev/software-engineering-team-project/blob/master/application/server/GatorShare/src/main/java/com/GatorShare/GatorShareApplication.java"
    click DTO_NODE "https://github.com/agusev/software-engineering-team-project/tree/master/application/server/GatorShare/src/main/java/com/GatorShare/Dto"
    click EXCEPTIONS "https://github.com/agusev/software-engineering-team-project/tree/master/application/server/GatorShare/src/main/java/com/GatorShare/Excpetions"
    click REPOSITORY "https://github.com/agusev/software-engineering-team-project/tree/master/application/server/GatorShare/src/main/java/com/GatorShare/Repo"
    click SERVICE "https://github.com/agusev/software-engineering-team-project/tree/master/application/server/GatorShare/src/main/java/com/GatorShare/Service"
    click SWAGGER "https://github.com/agusev/software-engineering-team-project/blob/master/application/server/GatorShare/src/main/java/com/GatorShare/config/SwaggerConfig.java"
    click MSGSTR "https://github.com/agusev/software-engineering-team-project/blob/master/application/server/GatorShare/src/main/java/com/GatorShare/config/messageString.java"
    click APP_PROP "https://github.com/agusev/software-engineering-team-project/blob/master/application/server/GatorShare/src/main/resources/application.properties"
```
