# lauuu2210/task-manager architecture

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

- Interactive diagram: https://gitdiagram.com/lauuu2210/task-manager
- Repository: https://github.com/lauuu2210/task-manager

## Overview

##### Main Components
- Frontend (Angular Application):
- Represents the user interface and client-side logic.
- Contains multiple components such as “add-task”, “main”, “trello”, and “view-task” which suggest different task management views and interactions.
- Includes services like “tasks.service.ts” (which handles API calls) and “translation.service.ts” for i18n, along with a “material.module.ts” that likely encapsulates Material Design imports.
- Routing is handled via “app-routing.module.ts”, and the main application structure is defined in “app.module.ts”.
- Assets include fonts, styles, and translation files (English/Spanish JSONs).

- Backend (Spring Boot Service):
- Provides a RESTful service for task management.
- The “TaskController.java” handles incoming HTTP requests.
- The “TaskRepository.java” along with the “Task.java” model represent the data access layer following a typical Spring Data pattern.
- Exception handling (e.g., “TaskNotFoundException.java”) indicates error management within the service layer.
- The backend is configured via “application.properties” and initializes its schema (via “schema.sql”) in an H2 in-memory database.
- Standard Maven setup (pom.xml and Maven wrapper scripts) is found at the root of the “task-services” project.

##### Relationships and Data Flow
- The Angular frontend communicates with the Spring Boot backend through REST API calls provided by the TaskController.
- Data flows from the frontend (user inputs through various components) to the backend service (via TasksService), and then the backend interacts with the H2 database for data persistence.
- Responses from the backend are then displayed in the frontend components.

##### Architectural Patterns and Technologies
- Frontend:
- Follows a component-based architecture, typical for Angular applications.
- Utilizes Angular’s routing for component navigation and service injection for handling API calls.
- Backend:
- Implements Spring Boot’s MVC design where controllers handle HTTP requests, the repository layer abstracts data access, and exception handling deals with errors.
- Uses H2 as an in-memory database for quick task management operations.
- Maven is used for project management and build processes.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Angular Frontend"
        Browser["User Browser"]:::frontend
        AppModule["App Module"]:::frontend
        Routing["App Routing Module"]:::frontend
        AddTask["Add Task Component"]:::frontend
        MainComp["Main Component"]:::frontend
        Trello["Trello Component"]:::frontend
        ViewTask["View Task Component"]:::frontend
        TasksService["Tasks Service"]:::frontend
        TranslationService["Translation Service"]:::frontend
        MaterialModule["Material Module"]:::frontend
        Assets["Assets (Fonts & Icons)"]:::frontend
        I18n["Internationalization Files"]:::frontend
    end

    subgraph "Spring Boot Backend"
        TaskServicesApplication["TaskServicesApplication"]:::backend
        TaskController["TaskController"]:::backend
        TaskModel["Task Model"]:::backend
        TaskRepository["TaskRepository"]:::backend
        TaskNotFound["TaskNotFoundException"]:::backend
        Configuration["application.properties"]:::backend
        Schema["schema.sql"]:::backend
    end

    H2["H2 In-Memory Database"]:::database

    %% Frontend Connections
    Browser -->|"loads"| AppModule
    AppModule -->|"manages_routing"| Routing
    AppModule -->|"includes"| MainComp
    AppModule -->|"includes"| AddTask
    AppModule -->|"includes"| Trello
    AppModule -->|"includes"| ViewTask
    MainComp -->|"uses"| TasksService
    AddTask -->|"uses"| TasksService
    Trello -->|"uses"| TasksService
    ViewTask -->|"uses"| TasksService
    AppModule -->|"configures"| TranslationService
    AppModule -->|"configures"| MaterialModule
    AppModule -->|"loads_assets"| Assets
    AppModule -->|"loads_i18n"| I18n

    %% Communication from Frontend to Backend
    TasksService -->|"REST_call"| TaskController

    %% Backend Connections
    TaskServicesApplication -->|"initializes"| TaskController
    TaskController -->|"uses"| TaskRepository
    TaskController -->|"maps_data"| TaskModel
    TaskController -.->|"handles_error"| TaskNotFound
    TaskRepository -->|"persists"| H2
    TaskServicesApplication -->|"configures"| Configuration
    TaskServicesApplication -->|"initializes_db"| Schema

    %% Styles
    classDef frontend fill:#a2d2ff,stroke:#000,stroke-width:2px;
    classDef backend fill:#ffafcc,stroke:#000,stroke-width:2px;
    classDef database fill:#caffbf,stroke:#000,stroke-width:2px;

    %% Click Events for Frontend Components
    click AppModule "https://github.com/lauuu2210/task-manager/blob/main/task-frontend/src/app/app.module.ts"
    click Routing "https://github.com/lauuu2210/task-manager/blob/main/task-frontend/src/app/app-routing.module.ts"
    click AddTask "https://github.com/lauuu2210/task-manager/tree/main/task-frontend/src/app/add-task/"
    click MainComp "https://github.com/lauuu2210/task-manager/tree/main/task-frontend/src/app/main/"
    click Trello "https://github.com/lauuu2210/task-manager/tree/main/task-frontend/src/app/trello/"
    click ViewTask "https://github.com/lauuu2210/task-manager/tree/main/task-frontend/src/app/view-task/"
    click TasksService "https://github.com/lauuu2210/task-manager/blob/main/task-frontend/src/app/services/tasks.service.ts"
    click TranslationService "https://github.com/lauuu2210/task-manager/blob/main/task-frontend/src/app/services/translation.service.ts"
    click MaterialModule "https://github.com/lauuu2210/task-manager/blob/main/task-frontend/src/app/services/material.module.ts"
    click Assets "https://github.com/lauuu2210/task-manager/tree/main/task-frontend/src/assets/fonts/material-design-icons/"
    click I18n "https://github.com/lauuu2210/task-manager/tree/main/task-frontend/src/assets/i18n/"

    %% Click Events for Backend Components
    click TaskServicesApplication "https://github.com/lauuu2210/task-manager/blob/main/task-services/src/main/java/com/imatia/test/taskservices/TaskServicesApplication.java"
    click TaskController "https://github.com/lauuu2210/task-manager/blob/main/task-services/src/main/java/com/imatia/test/taskservices/controller/TaskController.java"
    click TaskModel "https://github.com/lauuu2210/task-manager/blob/main/task-services/src/main/java/com/imatia/test/taskservices/model/Task.java"
    click TaskRepository "https://github.com/lauuu2210/task-manager/blob/main/task-services/src/main/java/com/imatia/test/taskservices/repository/TaskRepository.java"
    click TaskNotFound "https://github.com/lauuu2210/task-manager/blob/main/task-services/src/main/java/com/imatia/test/taskservices/exceptions/TaskNotFoundException.java"
    click Configuration "https://github.com/lauuu2210/task-manager/blob/main/task-services/src/main/resources/application.properties"
    click Schema "https://github.com/lauuu2210/task-manager/blob/main/task-services/src/main/resources/schema.sql"
```
