# thing-t6/taskentity-service architecture

> Architecture diagram of the GitHub repository thing-t6/taskentity-service, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thing-t6/taskentity-service
- Repository: https://github.com/thing-t6/taskentity-service

## Overview

TaskEntity-Service is a Spring REST backend for task lifecycle management. A client sends validated task requests to the controller, which delegates CRUD, completion, and completed/pending queries to the service; the service uses the repository for persistence and the mapper for entity/DTO conversion, then returns response DTOs. The README documents MariaDB-backed persistence and global validation/error handling. Source excerpts establish the main call paths; exception advice dispatch and database runtime wiring are represented only where documented.

Main entry points: [`src/main/java/com/thing/TaskEntity/Controller/TaskEntityController.java`](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/Controller/TaskEntityController.java) (Task Controller), [`src/main/java/com/thing/TaskEntity/Service/TaskService.java`](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/Service/TaskService.java) (Task Service), [`src/main/java/com/thing/TaskEntity/mapper/Mapper.java`](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/mapper/Mapper.java) (Entity DTO Mapper), [`src/main/java/com/thing/TaskEntity/exception/GlobalExceptionHandler.java`](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/exception/GlobalExceptionHandler.java) (Global Exception Handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["REST API"]
  node_application["Spring Boot Application"]
  node_controller["Task Controller"]
  node_requestdto["Validated Request DTO"]
  node_responsedto["Task Response DTO"]
end

subgraph group_domain["Task Domain"]
  node_service["Task Service<br/>[TaskService.java]"]
  node_mapper["Entity DTO Mapper<br/>[Mapper.java]"]
  node_task["Task Entity<br/>[Task.java]"]
end

subgraph group_persistence["Persistence"]
  node_repository["Task Repository"]
  node_database[("MariaDB / MySQL")]
end

subgraph group_errors["Validation and Errors"]
  node_exception["Not Found Exception"]
  node_handler["Global Exception Handler"]
  node_errordto["Error Response DTOs"]
  node_validationdto["Validation Error DTO"]
end

node_client(("API Client"))

node_client -->|"sends requests"| node_controller
node_controller -->|"delegates tasks"| node_service
node_controller -->|"accepts payload"| node_requestdto
node_controller -->|"returns payload"| node_responsedto
node_controller -.->|"validation dispatch"| node_handler
node_service -->|"queries and saves"| node_repository
node_service -->|"maps entities"| node_mapper
node_mapper -->|"converts entity"| node_task
node_mapper -->|"reads request"| node_requestdto
node_mapper -->|"creates response"| node_responsedto
node_repository -->|"persists entity"| node_task
node_repository -.->|"stores records"| node_database
node_service -->|"throws when missing"| node_exception
node_handler -->|"handles not found"| node_exception
node_handler -->|"builds error response"| node_errordto
node_handler -->|"builds validation response"| node_validationdto

click node_application "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/TaskEntityApplication.java"
click node_controller "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/Controller/TaskEntityController.java"
click node_requestdto "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/dto/TaskRequestDTO.java"
click node_responsedto "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/dto/TaskResponseDTO.java"
click node_service "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/Service/TaskService.java"
click node_mapper "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/mapper/Mapper.java"
click node_task "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/Tasks/Task.java"
click node_repository "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/Repository/TaskRepository.java"
click node_exception "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/exception/ResourceNotFoundException.java"
click node_handler "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/exception/GlobalExceptionHandler.java"
click node_errordto "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/dto/ExceptionResponseDTO.java"
click node_validationdto "https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/dto/ValidationExceptionResponseDTO.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_application,node_controller,node_requestdto,node_responsedto,node_client toneBlue
class node_service,node_mapper,node_task toneAmber
class node_repository,node_database toneMint
class node_exception,node_handler,node_errordto,node_validationdto toneRose
```

## Components

### REST API

- [Spring Boot Application](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/TaskEntityApplication.java): `src/main/java/com/thing/TaskEntity/TaskEntityApplication.java`
- [Task Controller](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/Controller/TaskEntityController.java): `src/main/java/com/thing/TaskEntity/Controller/TaskEntityController.java`
- [Validated Request DTO](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/dto/TaskRequestDTO.java): `src/main/java/com/thing/TaskEntity/dto/TaskRequestDTO.java`
- [Task Response DTO](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/dto/TaskResponseDTO.java): `src/main/java/com/thing/TaskEntity/dto/TaskResponseDTO.java`

### Task Domain

- [Task Service](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/Service/TaskService.java): `src/main/java/com/thing/TaskEntity/Service/TaskService.java`
- [Entity DTO Mapper](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/mapper/Mapper.java): `src/main/java/com/thing/TaskEntity/mapper/Mapper.java`
- [Task Entity](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/Tasks/Task.java): `src/main/java/com/thing/TaskEntity/Tasks/Task.java`

### Persistence

- [Task Repository](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/Repository/TaskRepository.java): `src/main/java/com/thing/TaskEntity/Repository/TaskRepository.java`
- **MariaDB / MySQL**

### Validation and Errors

- [Not Found Exception](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/exception/ResourceNotFoundException.java): `src/main/java/com/thing/TaskEntity/exception/ResourceNotFoundException.java`
- [Global Exception Handler](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/exception/GlobalExceptionHandler.java): `src/main/java/com/thing/TaskEntity/exception/GlobalExceptionHandler.java`
- [Error Response DTOs](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/dto/ExceptionResponseDTO.java): `src/main/java/com/thing/TaskEntity/dto/ExceptionResponseDTO.java`
- [Validation Error DTO](https://github.com/thing-t6/taskentity-service/blob/main/src/main/java/com/thing/TaskEntity/dto/ValidationExceptionResponseDTO.java): `src/main/java/com/thing/TaskEntity/dto/ValidationExceptionResponseDTO.java`

### Other components

- **API Client**

## Connections

- API Client → Task Controller: sends requests (evidence: `README.md`)
- Task Controller → Task Service: delegates tasks (evidence: `src/main/java/com/thing/TaskEntity/Controller/TaskEntityController.java`)
- Task Controller → Validated Request DTO: accepts payload (evidence: `src/main/java/com/thing/TaskEntity/Controller/TaskEntityController.java`)
- Task Controller → Task Response DTO: returns payload (evidence: `src/main/java/com/thing/TaskEntity/Controller/TaskEntityController.java`)
- Task Controller → Global Exception Handler: validation dispatch (evidence: `README.md`)
- Task Service → Task Repository: queries and saves (evidence: `src/main/java/com/thing/TaskEntity/Service/TaskService.java`)
- Task Service → Entity DTO Mapper: maps entities (evidence: `src/main/java/com/thing/TaskEntity/Service/TaskService.java`)
- Entity DTO Mapper → Task Entity: converts entity (evidence: `src/main/java/com/thing/TaskEntity/mapper/Mapper.java`)
- Entity DTO Mapper → Validated Request DTO: reads request (evidence: `src/main/java/com/thing/TaskEntity/mapper/Mapper.java`)
- Entity DTO Mapper → Task Response DTO: creates response (evidence: `src/main/java/com/thing/TaskEntity/mapper/Mapper.java`)
- Task Repository → Task Entity: persists entity (evidence: `src/main/java/com/thing/TaskEntity/Repository/TaskRepository.java`)
- Task Repository → MariaDB / MySQL: stores records (evidence: `README.md`)
- Task Service → Not Found Exception: throws when missing (evidence: `src/main/java/com/thing/TaskEntity/Service/TaskService.java`)
- Global Exception Handler → Not Found Exception: handles not found (evidence: `src/main/java/com/thing/TaskEntity/exception/GlobalExceptionHandler.java`)
- Global Exception Handler → Error Response DTOs: builds error response (evidence: `src/main/java/com/thing/TaskEntity/exception/GlobalExceptionHandler.java`)
- Global Exception Handler → Validation Error DTO: builds validation response (evidence: `src/main/java/com/thing/TaskEntity/exception/GlobalExceptionHandler.java`)
