# yancyasd/task-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/yancyasd/task-tracker
- Repository: https://github.com/yancyasd/task-tracker

## Overview

##### Project type and purpose
- This is a CLI-based task tracker written in TypeScript. It provides commands to add, update, delete, mark, and list tasks. It stores tasks in a JSON file via a simple file-based “database” layer.

##### File structure
- src/main.ts: entry point that parses CLI arguments and dispatches commands.
- src/service/taskService.ts: business logic for handling tasks (add, update, delete, mark, list).
- src/DB/JsonDb.ts: persistence layer reading/writing tasks to a JSON file.
- src/types/task.ts: Task model definition (id, description, status).
- package.json, tsconfig.json, eslint.config.js, .prettierrc: build/configuration.
- No frontend, no external web services—pure CLI tool.

##### README for additional insights
- The README shows the npm scripts that launch the CLI.
- Commands map directly to calls in main.ts → taskService methods.
- There is no external database or third-party API.

##### Elements
- Clear component labels (e.g., “CLI Parser”, “TaskService”, “JsonDb”, “tasks.json”).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External actor
    User["User/Terminal"]:::external

    %% Application layers
    CLI["CLI Parser"]:::cli
    Service["TaskService"]:::service
    DB["JsonDb"]:::persistence

    %% Storage
    FS[(tasks.json)]:::storage

    %% Data Model
    Data["Task Type"]:::model

    %% Flow
    User -->|"parseArgs()"| CLI
    CLI -->|"calls add/update/delete/list"| Service
    Service -->|"readAllTasks()/writeAllTasks()"| DB
    DB -->|"file I/O"| FS

    %% Data Model usage
    Data -.-> Service
    Data -.-> DB

    %% Click Events
    click CLI "https://github.com/yancyasd/task-tracker/blob/master/src/main.ts"
    click Service "https://github.com/yancyasd/task-tracker/blob/master/src/service/taskService.ts"
    click DB "https://github.com/yancyasd/task-tracker/blob/master/src/DB/JsonDb.ts"
    click Data "https://github.com/yancyasd/task-tracker/blob/master/src/types/task.ts"

    %% Styles
    classDef external fill:#FFECB3,stroke:#FFB300,stroke-width:2px;
    classDef cli fill:#BBDEFB,stroke:#1E88E5,stroke-width:2px;
    classDef service fill:#C8E6C9,stroke:#43A047,stroke-width:2px;
    classDef persistence fill:#FFCCBC,stroke:#E64A19,stroke-width:2px;
    classDef storage fill:#FFE082,stroke:#F9A825,stroke-width:2px;
    classDef model fill:#E1BEE7,stroke:#8E24AA,stroke-width:2px,stroke-dasharray: 5 5;
```
