# jeanjouliacode/wipeclean architecture

> Architecture diagram of the GitHub repository jeanjouliacode/wipeclean, 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/jeanjouliacode/wipeclean
- Repository: https://github.com/jeanjouliacode/wipeclean

## Overview

##### Main Components
- CLI Entry Point (index.js): This is the starting point where the command line arguments are received and processed.
- Argument Parser: A module/component that interprets command‑line flags and options (e.g., –speed or -s).
- Configuration Manager: Reads and merges settings from the user’s config file (~/.wipeclean/config.json) with command‑line options, ensuring the correct “brush speed” or other parameters are applied.
- Animation Engine: Responsible for executing the wipe animation in the terminal. This component takes the speed parameter and implements the gradual clearing effect.
- Terminal Interface: Interfaces with the system’s output stream, sending animated frames to the terminal.

##### Relationships and Interactions
- The CLI Entry Point receives user input when the user types “wipeclean.”
- It immediately hands off the command line parameters to the Argument Parser.
- The Argument Parser sends the parsed options to the Configuration Manager, which also checks for any default settings in the user’s config file.
- The resulting configuration (including the “brush speed”) is then passed to the Animation Engine.
- The Animation Engine communicates with the Terminal Interface to render the animated wiping process.

##### Architectural Patterns and Design Principles
- Modularity: Although the project is small, it follows a separation of concerns – isolating the areas of command-line processing, configuration management, and animation rendering.
- Single Responsibility: Each component does one thing – parsing, configuration, or rendering – making the maintenance and potential extension of the tool easier.
- Extensibility: The use of a config file and command‑line options allows users to modify the behavior without altering the primary code, a useful pattern in CLI tool development.

##### Relevant Technologies
- Node.js: The runtime environment.
- NPM: For package management and installation (reference in package.json, package-lock.json).
- JavaScript: The programming language (index.js).
- Configuration File: JSON format for user preferences (~/.wipeclean/config.json).

- From “User Input” (or “Command Line”) to “CLI Entry Point”.
- From “CLI Entry Point” to “Argument Parser”.
- From “Argument Parser” to “Configuration Manager”.
- From “Configuration Manager” to “Animation Engine”.
- Finally, from “Animation Engine” to “Terminal Output”.
- Notes (or side labels) about critical parameters such as the “brush speed” setting sourced from both command-line options and the config file.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "External Dependencies"
        N["Node.js (runtime)"]:::external
        P["npm Installation"]:::external
    end

    subgraph "User I/O"
        A["Command Line Input"]:::io
        E["Terminal Output"]:::io
    end

    subgraph "Processing Modules"
        B["CLI Entry Point (index.js)"]:::logic
        C["Argument Parser"]:::logic
        D["Configuration Manager"]:::logic
        F["Animation Engine"]:::logic
    end

    P -->|"installs"| B
    N -->|"runs"| B

    A -->|"start"| B
    B -->|"parses"| C
    C -->|"mergesConfig"| D
    D -->|"applies(brushSpeed)"| F
    F -->|"renders"| E

    click B "https://github.com/jeanjouliacode/wipeclean/blob/master/index.js"
    click C "https://github.com/jeanjouliacode/wipeclean/blob/master/index.js"
    click D "https://github.com/jeanjouliacode/wipeclean/blob/master/index.js"
    click F "https://github.com/jeanjouliacode/wipeclean/blob/master/index.js"
    click E "https://github.com/jeanjouliacode/wipeclean/blob/master/index.js"

    classDef external fill:#dff0d8,stroke:#3c763d,stroke-width:2px;
    classDef io fill:#fcf8e3,stroke:#c09853,stroke-width:2px;
    classDef logic fill:#d9edf7,stroke:#31708f,stroke-width:2px;
```
