# kietpham-vn/task-management-application architecture

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

- Interactive diagram: https://gitdiagram.com/kietpham-vn/task-management-application
- Repository: https://github.com/kietpham-vn/task-management-application

## Overview

##### Main Components

A. Presentation Layer
- Web Interface (HTML/JSP pages)
- Controllers package (MainController and auth controllers)

B. Business Layer
- Services Layer (with interfaces and implementations)
- DTOs (Data Transfer Objects)
- Entities

C. Data Access Layer
- DAO Layer (with interfaces and implementations)
- Database Connection (DBUtils)

D. Cross-cutting Components
- Utils package
- Constants and Enums
- Authentication/Security

- [Client/Web Browser]
- ↕
- [Presentation Layer]
- ↕
- [Business Layer]
- ↕
- [Data Access Layer]
- ↕
- [Database]

##### Detailed Component Representation

A. Presentation Layer (Blue):
- MainController as the central controller
- Auth controllers (Login/Logout)
- Web pages/views

B. Business Layer (Green):
- Three main service groups:
- UserServices
- ProjectServices
- TaskServices
- DTOs:
- UserDTO
- ProjectDTO
- TaskDTO
- With corresponding entities

C. Data Access Layer (Yellow):
- DAO implementations:
- UserDAO
- ProjectDAO
- TaskDAO
- DBUtils connection management

##### Important Relationships to Highlight

- Data flow between components
- Security boundaries around authenticated areas

##### Additional Elements

- Authentication flow
- Error handling paths
- External system integrations if any

##### Technical Details

- Database connection pool
- Security mechanisms (PasswordUtils)
- Constants and enums usage
- Configuration files (web.xml, context.xml)

##### Implementation Notes

- Maintain consistent spacing and alignment
- Use straight lines for direct relationships
- Use curved lines for indirect relationships
- A title and date

Remember to include the authentication flow as it's a crucial security aspect of the application, showing how user sessions are managed and secured.

This architecture follows a traditional Java EE pattern with clear separation between presentation, business, and data access layers, making it easy to maintain and extend the application as needed.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef presentation fill:#2196F3,stroke:#1565C0,color:white
    classDef business fill:#4CAF50,stroke:#2E7D32,color:white
    classDef data fill:#FFC107,stroke:#FFA000,color:black
    classDef database fill:#795548,stroke:#5D4037,color:white
    classDef utility fill:#9E9E9E,stroke:#616161,color:white
    classDef entity fill:#9C27B0,stroke:#7B1FA2,color:white

    %% Client
    Client[Client Browser]:::presentation

    %% Presentation Layer
    subgraph PresentationLayer[Presentation Layer]
        WebXML["web.xml"]:::presentation
        MainController["MainController"]:::presentation
        AuthControllers["Authentication Controllers"]:::presentation
    end

    %% Business Layer
    subgraph BusinessLayer[Business Layer]
        %% Service Interfaces
        ServiceInterfaces["Service Interfaces"]:::business
        
        %% Service Implementations
        UserServices["UserServices"]:::business
        ProjectServices["ProjectServices"]:::business
        TaskServices["TaskServices"]:::business
        
        %% DTOs
        UserDTO["UserDTO"]:::entity
        ProjectDTO["ProjectDTO"]:::entity
        TaskDTO["TaskDTO"]:::entity
    end

    %% Data Access Layer
    subgraph DataAccessLayer[Data Access Layer]
        %% DAO Interfaces
        DAOInterfaces["DAO Interfaces"]:::data
        
        %% DAO Implementations
        UserDAO["UserDAO"]:::data
        ProjectDAO["ProjectDAO"]:::data
        TaskDAO["TaskDAO"]:::data
        
        %% Entities
        UserEntity["User Entity"]:::entity
        ProjectEntity["Project Entity"]:::entity
        TaskEntity["Task Entity"]:::entity
    end

    %% Utilities
    subgraph Utilities[Common Utilities]
        DBUtils["DBUtils"]:::utility
        PasswordUtils["PasswordUtils"]:::utility
        Constants["Constants"]:::utility
        AccountRole["AccountRole"]:::utility
    end

    %% Database
    Database[(Database)]:::database

    %% Relationships
    Client --> WebXML
    WebXML --> MainController & AuthControllers
    MainController & AuthControllers --> ServiceInterfaces
    
    ServiceInterfaces --> UserServices & ProjectServices & TaskServices
    
    UserServices & ProjectServices & TaskServices --> UserDTO & ProjectDTO & TaskDTO
    UserDTO & ProjectDTO & TaskDTO --> DAOInterfaces
    
    DAOInterfaces --> UserDAO & ProjectDAO & TaskDAO
    UserDAO & ProjectDAO & TaskDAO --> UserEntity & ProjectEntity & TaskEntity
    
    UserDAO & ProjectDAO & TaskDAO --> DBUtils
    DBUtils --> Database
    
    AuthControllers --> PasswordUtils
    UserServices --> PasswordUtils
    
    %% Click Events
    click MainController "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/controllers/MainController.java"
    click AuthControllers "https://github.com/KietPham-VN/Task-Management-Application/tree/main/src/java/controllers/auth/"
    click WebXML "https://github.com/KietPham-VN/Task-Management-Application/blob/main/web/WEB-INF/web.xml"
    click UserServices "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/services/implementations/UserServices.java"
    click ProjectServices "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/services/implementations/ProjectServices.java"
    click TaskServices "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/services/implementations/TaskServices.java"
    click ServiceInterfaces "https://github.com/KietPham-VN/Task-Management-Application/tree/main/src/java/services/interfaces/"
    click UserDTO "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/dto/UserDTO.java"
    click ProjectDTO "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/dto/ProjectDTO.java"
    click TaskDTO "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/dto/TaskDTO.java"
    click UserDAO "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/dao/implementations/UserDAO.java"
    click ProjectDAO "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/dao/implementations/ProjectDAO.java"
    click TaskDAO "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/dao/implementations/TaskDAO.java"
    click DAOInterfaces "https://github.com/KietPham-VN/Task-Management-Application/tree/main/src/java/dao/interfaces/"
    click UserEntity "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/entities/User.java"
    click ProjectEntity "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/entities/Project.java"
    click TaskEntity "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/entities/Task.java"
    click DBUtils "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/common/utils/DBUtils.java"
    click PasswordUtils "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/common/utils/PasswordUtils.java"
    click Constants "https://github.com/KietPham-VN/Task-Management-Application/tree/main/src/java/common/constants/"
    click AccountRole "https://github.com/KietPham-VN/Task-Management-Application/blob/main/src/java/common/enums/AccountRole.java"
```
