# bohdanmoldavets/task-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/bohdanmoldavets/task-management-system
- Repository: https://github.com/bohdanmoldavets/task-management-system

## Overview

##### Project type and purpose
- This is a backend‐focused, RESTful Task Management System built with Spring Boot. It exposes a set of APIs to manage tasks and employees, secures endpoints using JWT/Spring Security, sends email notifications, and persists data in PostgreSQL with Flyway migrations. There is no “browser” frontend shipped here—clients interact over HTTP (e.g., via Swagger UI or any HTTP client).

##### File structure
- Top level:
- Dockerfile / docker-compose.yaml – containerization setup
- pom.xml – Maven build and dependency management
- src/main/java/com/moldavets/task_management_system – application code
- src/main/resources/db/migration – Flyway migrations
- src/main/resources/application.properties – configuration
- auth – JWT configuration, filters, controllers, DTOs, services, repositories
- employee – CRUD controllers, DTOs, mappers, service, repository
- task – similar to employee but for task entities
- email – email‐sending service
- exception – global exception handler and models
- utils – shared base entity, enums, token utilities
- Tests mirror the structure under src/test/java.

##### README for additional insights
- Describes the stack (Java 21, Spring Boot, Security, JPA/Hibernate, PostgreSQL, Flyway, Swagger, Docker)
- Lists key features: authentication, role-based access, email notification, migration scripts, REST docs

##### Essential architectural elements
- Don’t just list packages—show how data flows through JWT authentication, gets mapped by controllers, handled by services, persisted by repositories, and triggers email notifications.
- Docker layer to show containerization and how the app connects to PostgreSQL.
- Flyway in the startup path from application → Flyway → DB schema.
- Use legends or annotations for frameworks/technologies (e.g., “Spring Data JPA → PostgreSQL”, “Swagger UI at /swagger-ui”).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Clients
    Client["HTTP Client / Swagger UI"]:::external
    click Client "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/config/SwaggerConfig.java"

    %% Security Layer
    subgraph "Security Layer"
        direction TB
        JwtFilter["JwtRequestFilter"]:::security
        SecConfig["SecurityConfig"]:::security
    end
    click JwtFilter "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/auth/config/JwtRequestFilter.java"
    click SecConfig "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/auth/config/SecurityConfig.java"

    %% API Layer
    subgraph "Controller Layer"
        direction TB
        AuthCtrl["AuthController"]:::controller
        EmpCtrl["EmployeeController"]:::controller
        TaskCtrl["TaskController"]:::controller
    end
    click AuthCtrl "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/auth/contoller/AuthController.java"
    click EmpCtrl "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/employee/controller/EmployeeController.java"
    click TaskCtrl "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/task/controller/TaskController.java"

    %% Business Layer
    subgraph "Service Layer"
        direction TB
        AuthSvc["AuthService"]:::service
        RoleSvc["RoleService"]:::service
        EmpSvc["EmployeeService"]:::service
        TaskSvc["TaskService"]:::service
        EmailSvc["EmailSenderService"]:::service
    end
    click AuthSvc "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/auth/service/AuthService.java"
    click RoleSvc "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/auth/service/RoleService.java"
    click EmpSvc "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/employee/service/EmployeeService.java"
    click TaskSvc "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/task/service/TaskService.java"
    click EmailSvc "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/email/service/EmailSenderService.java"

    %% Data Access Layer
    subgraph "Repository Layer"
        direction TB
        RoleRepo["RoleRepository"]:::repository
        EmpRepo["EmployeeRepository"]:::repository
        TaskRepo["TaskRepository"]:::repository
    end
    click RoleRepo "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/auth/repository/RoleRepository.java"
    click EmpRepo "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/employee/repository/EmployeeRepository.java"
    click TaskRepo "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/task/repository/TaskRepository.java"

    %% Utilities & Exception
    subgraph "Utilities & Exception"
        direction TB
        JwtUtil["JwtTokenUtils"]:::utils
        BaseEnt["BaseEntity"]:::utils
        Enums["TaskStatus / TaskType"]:::utils
        ExHandler["CustomResponseEntityExceptionHandler"]:::exception
        ExModel["ExceptionDetailsModel"]:::exception
    end
    click JwtUtil "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/auth/utils/JwtTokenUtils.java"
    click BaseEnt "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/utils/entity/BaseEntity.java"
    click Enums "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/utils/enums/TaskStatus.java"
    click ExHandler "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/exception/handler/CustomResponseEntityExceptionHandler.java"
    click ExModel "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/exception/model/ExceptionDetailsModel.java"

    %% Persistence & Migrations
    subgraph "Database & Migrations"
        direction TB
        Flyway["Flyway Migrations"]:::migration
        DB["PostgreSQL Database"]:::database
        Props["application.properties"]:::config
    end
    click Flyway "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/resources/db/migration/V1__init.sql"
    click Props "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/resources/application.properties"
    click DB "https://github.com/bohdanmoldavets/task-management-system/blob/main/docker-compose.yaml"

    %% External SMTP
    SMTP["External SMTP Server"]:::external

    %% Docker Compose
    subgraph "Docker Compose"
        direction TB
        AppContainer["App Container"]:::container
        DBContainer["PostgreSQL Container"]:::container
    end
    click AppContainer "https://github.com/bohdanmoldavets/task-management-system/tree/main/Dockerfile"
    click DBContainer "https://github.com/bohdanmoldavets/task-management-system/blob/main/docker-compose.yaml"

    %% Application Entry
    AppMain["TaskManagementSystemApplication"]:::main
    click AppMain "https://github.com/bohdanmoldavets/task-management-system/blob/main/src/main/java/com/moldavets/task_management_system/TaskManagementSystemApplication.java"

    %% Relations
    Client --> JwtFilter
    JwtFilter --> SecConfig
    SecConfig --> AuthCtrl
    SecConfig --> EmpCtrl
    SecConfig --> TaskCtrl

    AuthCtrl --> AuthSvc
    AuthCtrl --> RoleSvc
    EmpCtrl --> EmpSvc
    TaskCtrl --> TaskSvc

    AuthSvc --> JwtUtil
    AuthSvc --> RoleRepo
    RoleSvc --> RoleRepo

    EmpSvc --> EmpRepo
    TaskSvc --> TaskRepo
    TaskSvc --> EmailSvc

    EmailSvc --> SMTP

    RoleRepo --> DB
    EmpRepo --> DB
    TaskRepo --> DB

    AppMain --> Flyway
    Flyway --> DB

    AppMain --> AppContainer
    AppContainer --> DBContainer

    %% Styles
    classDef external fill:#E3F2FD,stroke:#42A5F5,color:#0D47A1;
    classDef security fill:#FFF3E0,stroke:#FB8C00,color:#E65100;
    classDef controller fill:#E8F5E9,stroke:#43A047,color:#1B5E20;
    classDef service fill:#E1F5FE,stroke:#039BE5,color:#01579B;
    classDef repository fill:#F3E5F5,stroke:#8E24AA,color:#4A148C;
    classDef migration fill:#FBE9E7,stroke:#D84315,color:#BF360C;
    classDef database fill:#EFEBE9,stroke:#6D4C41,color:#3E2723;
    classDef utils fill:#FFFDE7,stroke:#FDD835,color:#F57F17;
    classDef exception fill:#FFEBEE,stroke:#D32F2F,color:#B71C1C;
    classDef config fill:#ECEFF1,stroke:#607D8B,color:#263238;
    classDef container fill:#E0F2F1,stroke:#00897B,color:#004D40;
    classDef main fill:#FFF9C4,stroke:#FBC02D,color:#F57F17;
```
