# franfodor/cestafix architecture

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

- Interactive diagram: https://gitdiagram.com/franfodor/cestafix
- Repository: https://github.com/franfodor/cestafix

## Overview

##### Main Components Identification
The system follows a classic three-tier architecture with these main components:

a) Frontend Layer (React-based):
- User Interface Components
- Forms Module
- Account Management Module
- Statistics Module
- API Integration Layer

b) Backend Layer (Spring Boot):
- REST Controllers
- Service Layer
- Repository Layer
- Security/Authentication
- Data Transfer Objects (DTOs)

c) Database Layer (PostgreSQL):
- Data persistence
- Migration management

**[Frontend Layer] ←→ [Backend Layer] ←→ [Database Layer]**

##### Component Relationships

- REST API calls (Frontend ↔ Backend)
- Database operations (Backend ↔ Database)
- Internal component dependencies

##### Additional Elements

- External services integration
- Security boundaries
- Data flow directions
- Error handling paths

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef database fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef security fill:#f1c40f,stroke:#f39c12,color:black
    classDef api fill:#e74c3c,stroke:#c0392b,color:white

    %% Frontend Layer
    subgraph Frontend
        UI[UI Components]
        UI --> Header[Header]
        UI --> Content[Content]
        UI --> Footer[Footer]
        
        Forms[Forms Module]
        Forms --> LoginForm[Login Form]
        Forms --> RegisterForm[Register Form]
        Forms --> ReportForm[Report Form]
        
        Account[Account Management]
        Stats[Statistics Module]
        APIInt[API Integration]
    end

    %% Backend Layer
    subgraph Backend
        Security[Security Layer]
        Security --> JWTFilter[JWT Filter]
        Security --> SecConfig[Security Config]
        
        Controllers[Controllers Layer]
        Controllers --> AuthController[Auth Controller]
        Controllers --> ReportController[Report Controller]
        
        Services[Services Layer]
        Services --> AuthService[Auth Service]
        Services --> ReportService[Report Service]
        
        Repos[Repository Layer]
        Repos --> UserRepo[User Repository]
        Repos --> ReportRepo[Report Repository]
        
        DTOs[DTO Layer]
    end

    %% Database Layer
    subgraph Database
        Models[Domain Models]
        Models --> UserModel[User Model]
        Models --> ReportModel[Report Model]
        
        Migration[Database Migration]
    end

    %% Relationships
    APIInt --> Controllers
    Forms --> APIInt
    Account --> APIInt
    Stats --> APIInt
    Controllers --> Services
    Services --> Repos
    Repos --> Models
    Security --> Controllers

    %% Component Classes
    class UI,Header,Content,Footer,Forms,LoginForm,RegisterForm,ReportForm,Account,Stats frontend
    class Controllers,Services,Repos,AuthController,ReportController,AuthService,ReportService,UserRepo,ReportRepo,DTOs backend
    class Models,Migration,UserModel,ReportModel database
    class Security,JWTFilter,SecConfig security
    class APIInt api

    %% Click Events
    click Header "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Frontend/cestafix_front_v0.2/src/Header.js"
    click Footer "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Frontend/cestafix_front_v0.2/src/Footer.js"
    click Content "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Frontend/cestafix_front_v0.2/src/Content.js"
    click Forms "https://github.com/franFodor/CestaFix/tree/main/IzvorniKod/Frontend/cestafix_front_v0.2/src/forms/"
    click LoginForm "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Frontend/cestafix_front_v0.2/src/forms/LoginForm.js"
    click RegisterForm "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Frontend/cestafix_front_v0.2/src/forms/RegisterForm.js"
    click ReportForm "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Frontend/cestafix_front_v0.2/src/forms/ReportForm.js"
    click Account "https://github.com/franFodor/CestaFix/tree/main/IzvorniKod/Frontend/cestafix_front_v0.2/src/myAccount/"
    click Stats "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Frontend/cestafix_front_v0.2/src/StatisticsComponent.js"
    click APIInt "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Frontend/cestafix_front_v0.2/src/API.js"
    click Controllers "https://github.com/franFodor/CestaFix/tree/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/controller/"
    click AuthController "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/controller/AuthenticationController.java"
    click ReportController "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/controller/ReportController.java"
    click Services "https://github.com/franFodor/CestaFix/tree/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/service/"
    click AuthService "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/service/AuthenticationService.java"
    click ReportService "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/service/ReportService.java"
    click Repos "https://github.com/franFodor/CestaFix/tree/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/repository/"
    click UserRepo "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/repository/UserRepository.java"
    click ReportRepo "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/repository/ReportRepository.java"
    click Security "https://github.com/franFodor/CestaFix/tree/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/config/"
    click JWTFilter "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/config/JwtAuthenticationFilter.java"
    click SecConfig "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/config/SecurityConfig.java"
    click DTOs "https://github.com/franFodor/CestaFix/tree/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/dto/"
    click Migration "https://github.com/franFodor/CestaFix/tree/main/IzvorniKod/Backend/prijave/src/main/resources/db/migration/"
    click Models "https://github.com/franFodor/CestaFix/tree/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/model/"
    click UserModel "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/model/User.java"
    click ReportModel "https://github.com/franFodor/CestaFix/blob/main/IzvorniKod/Backend/prijave/src/main/java/fer/proinz/prijave/model/Report.java"
```
