# avj2352/jotdown_rust_cli architecture

> Architecture diagram of the GitHub repository avj2352/jotdown_rust_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/avj2352/jotdown_rust_cli
- Repository: https://github.com/avj2352/jotdown_rust_cli

## Overview

##### Project Type Analysis
This is a command-line interface (CLI) application written in Rust that manages todos, tasks, and reminders with persistent storage in JSON format.

##### Main Components

A. Core Components:
- CLI Interface Layer
- Business Logic Layer (Features)
- Data Access Layer (DAO)
- Storage Layer (JSON File)

B. Module Structure:
- src/
- facade/     (Command handlers)
- features/   (Core business logic)
- dao/        (Data access)
- util/       (Helper utilities)

##### Flow Representation

**User Input → CLI Interface**
- ↓
**Command Handlers (Facade)**
- ↓
**Feature Modules**
- ↓
**DAO Layer ←→ JSON Storage**

##### Additional Elements

**{**
- "tags": [],
- "todos": [],
- "reminders": [],
- "tasks": []
**}**

##### Important Architectural Notes

- Facade pattern used for command handling
- Separation between business logic and data access
- Modular structure allowing for easy feature additions
- Configuration flow for custom storage paths

##### Technical Details

- Rust-specific implementation notes
- JSON file location configuration
- Command syntax examples
- Error handling flow

Remember to include version information (v1.3.0) and note any planned architectural changes for future releases.

This system design will help developers understand both the high-level architecture and the detailed component interactions of the Jotdown CLI application.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef handler fill:#2ecc71,stroke:#27ae60,color:white
    classDef feature fill:#27ae60,stroke:#219a52,color:white
    classDef dao fill:#f1c40f,stroke:#f39c12,color:black
    classDef storage fill:#e74c3c,stroke:#c0392b,color:white
    classDef util fill:#95a5a6,stroke:#7f8c8d,color:white

    %% CLI Layer
    CLI["CLI Interface"]:::ui
    click CLI "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/main.rs"

    %% Command Handlers Layer
    subgraph Handlers
        AddH["Add Handler"]:::handler
        ClearH["Clear Handler"]:::handler
        HelpH["Help Handler"]:::handler
        ListH["List Handler"]:::handler
        MiscH["Misc Handler"]:::handler
    end
    click AddH "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/facade/add_handler.rs"
    click ClearH "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/facade/clear_handler.rs"
    click HelpH "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/facade/help_handler.rs"
    click ListH "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/facade/list_handler.rs"
    click MiscH "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/facade/misc_handler.rs"

    %% Features Layer
    subgraph Features
        AddF["Add Feature"]:::feature
        ClearF["Clear Feature"]:::feature
        ListF["List Feature"]:::feature
        UpdateF["Update Feature"]:::feature
        MiscF["Misc Feature"]:::feature
    end
    click AddF "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/features/add.rs"
    click ClearF "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/features/clear.rs"
    click ListF "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/features/list.rs"
    click UpdateF "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/features/update.rs"
    click MiscF "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/features/misc.rs"

    %% Data Access Layer
    subgraph DAO
        ReadJSON["Read JSON"]:::dao
        WriteJSON["Write JSON"]:::dao
    end
    click ReadJSON "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/dao/read_json.rs"
    click WriteJSON "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/dao/write_json.rs"

    %% Storage Layer
    Storage[("JSON Storage")]:::storage
    click Storage "https://github.com/avj2352/jotdown_rust_cli/blob/master/.jotdown-db.json"

    %% Utility Layer
    subgraph Utilities
        Config["Configuration"]:::util
        Display["Display Formatting"]:::util
        Helpers["Helper Functions"]:::util
        Models["Data Models"]:::util
        Enums["Enumerations"]:::util
    end
    click Config "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/util/config.rs"
    click Display "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/util/display.rs"
    click Helpers "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/util/helpers.rs"
    click Models "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/util/models.rs"
    click Enums "https://github.com/avj2352/jotdown_rust_cli/blob/master/src/util/enums.rs"

    %% Connections
    CLI --> AddH & ClearH & HelpH & ListH & MiscH
    AddH --> AddF
    ClearH --> ClearF
    ListH --> ListF
    MiscH --> MiscF
    AddF & ClearF & ListF & UpdateF & MiscF --> ReadJSON & WriteJSON
    ReadJSON & WriteJSON <--> Storage
    AddF & ClearF & ListF & UpdateF & MiscF --> Models
    Models --> Enums
    Config --> Storage
    Display --> CLI

    %% Legend
    subgraph Legend
        UI["User Interface"]:::ui
        Hand["Command Handler"]:::handler
        Feat["Feature Module"]:::feature
        DataAcc["Data Access"]:::dao
        Store["Storage"]:::storage
        Util["Utility"]:::util
    end
```
