# littleoddboy/doer-cli architecture

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

- Interactive diagram: https://gitdiagram.com/littleoddboy/doer-cli
- Repository: https://github.com/littleoddboy/doer-cli

## Overview

##### Main Components

a. User Interface Layer:
- Command Line Interface (CLI)
- Main commands: add, list, update, mark, delete

b. Core Application Layer:
- TaskManager (from TaskManager.ts)
- Command Processor (from index.ts)
- Utilities (from utils.ts)

c. Data Persistence Layer:
- Local Storage/File System (since this is a CLI tool, it likely stores tasks locally)

##### Component Relationships

- CLI Input → Command Processor → TaskManager → Data Storage
- Data Storage → TaskManager → CLI Output

##### Specific Implementation Details

- Command Parser (handling CLI arguments)
- Task State Management (status: todo, pending, done)
- Interactive Prompt System (using inquirer-checkbox-plus-prompt)

##### Important Elements to Highlight

a. Data Flow:
- User Input → Command Processing → Task Operations → Storage
- Storage → Task Retrieval → Display Output

b. Key Interfaces:
- Task Interface (showing task properties)
- Command Interface (showing available commands)

##### Technical Stack Indicators
- Node.js Runtime
- TypeScript
- NPM Package Management
- Inquirer.js for CLI interactions

##### Architectural Patterns
- Command Pattern (for handling different CLI commands)
- Repository Pattern (for task storage)
- Single Responsibility Principle (separate files for different concerns)

**[User Interface Layer]**
- ↓   ↑
**[Command Processing Layer]**
- ↓   ↑
**[Task Management Layer]**
- ↓   ↑
**[Data Persistence Layer]**

Additional Considerations:

- Grouping related functionality
- Maintaining proper spacing between components

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef util fill:#95a5a6,stroke:#7f8c8d,color:white

    %% User Interface Layer
    CLI["Command Line Interface (CLI)"]:::ui
    click CLI "https://github.com/LittleOddBoy/doer-cli/blob/main/src/index.ts"

    %% Command Processing Layer
    subgraph CommandLayer["Command Processing"]
        CP["Command Processor"]:::core
        Parser["Command Parser"]:::core
        IPS["Interactive Prompt System"]:::core
    end
    click CP "https://github.com/LittleOddBoy/doer-cli/blob/main/src/index.ts"
    click Parser "https://github.com/LittleOddBoy/doer-cli/blob/main/src/index.ts"
    click IPS "https://github.com/LittleOddBoy/doer-cli/blob/main/src/inquirer-checkbox-plus-prompt.d.ts"

    %% Task Management Layer
    subgraph TaskLayer["Task Management"]
        TM["Task Manager"]:::core
        TSM["Task State Management"]:::core
        Utils["Utilities"]:::util
    end
    click TM "https://github.com/LittleOddBoy/doer-cli/blob/main/src/TaskManager.ts"
    click TSM "https://github.com/LittleOddBoy/doer-cli/blob/main/src/TaskManager.ts"
    click Utils "https://github.com/LittleOddBoy/doer-cli/blob/main/src/utils.ts"

    %% Data Layer
    DS["Data Storage"]:::data
    click DS "https://github.com/LittleOddBoy/doer-cli/blob/main/src/TaskManager.ts"

    %% Connections
    CLI --> CP
    CP --> Parser
    CP --> IPS
    Parser --> TM
    IPS --> TM
    TM --> TSM
    TM <--> DS
    Utils --> TM
    TM --> CLI

    %% Legend
    subgraph Legend
        UI["User Interface"]:::ui
        Core["Core Components"]:::core
        Data["Data Components"]:::data
        Utility["Utility Components"]:::util
    end
```
