# kar2/progressor architecture

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

- Interactive diagram: https://gitdiagram.com/kar2/progressor
- Repository: https://github.com/kar2/progressor

## Overview

##### Main Components

a. Core Package Components:
- Progressor Main Module (lib/progressor.js)
- View Layer (lib/progressor-view.js)
- Configuration/Settings Layer (package.json)

b. External Dependencies:
- Atom Editor API
- moment.js
- Chart.js
- Node.js runtime

##### Specific Elements

a. UI Components (Top Layer):
- Progress View Component
- Keybinding Handler (ctrl-alt-o)
- Menu Integration

b. Core Logic (Middle Layer):
- Progress Tracking Module
- Metrics Calculator
- State Management

c. Integration Layer (Bottom Layer):
- Atom Editor Integration
- File System Interface
- External Library Integration

##### Flow Representation

- User interaction flow (keybinding → view toggle)
- Data flow (metrics collection → visualization)
- Event handling (editor events → progress tracking)

##### Important Relationships to Highlight

- How progressor.js acts as the main entry point
- Relationship between progressor-view.js and the visualization components
- Demonstrate how the package integrates with Atom's package system

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI_Layer
        PV["Progress View"]:::ui
        KB["Keybinding Handler"]:::ui
        MI["Menu Integration"]:::ui
        US["UI Styling"]:::ui
    end

    subgraph Business_Logic_Layer
        MM["Main Module"]:::core
        PTM["Progress Tracking Module"]:::core
        MC["Metrics Calculator"]:::core
        SM["State Management"]:::core
    end

    subgraph Integration_Layer
        AEI["Atom Editor Integration"]:::integration
        FSI["File System Interface"]:::integration
        ELI["External Library Integration"]:::integration
    end

    subgraph External_Dependencies
        AEA["Atom Editor API"]:::external
        MJS["moment.js"]:::external
        CJS["Chart.js"]:::external
        NJS["Node.js Runtime"]:::external
    end

    %% Relationships
    KB -->|Triggers| MM
    MI -->|Commands| MM
    MM -->|Updates| PV
    MM -->|Controls| PTM
    PTM -->|Calculates| MC
    MC -->|Updates| SM
    SM -->|Renders| PV
    MM -.->|Events| AEI
    PTM -.->|File Operations| FSI
    ELI -->|Provides| MJS
    ELI -->|Provides| CJS
    AEI -->|API Access| AEA
    FSI -->|Runtime| NJS

    %% Click Events
    click MM "https://github.com/kar2/progressor/blob/master/lib/progressor.js"
    click PV "https://github.com/kar2/progressor/blob/master/lib/progressor-view.js"
    click KB "https://github.com/kar2/progressor/blob/master/keymaps/progressor.json"
    click MI "https://github.com/kar2/progressor/blob/master/menus/progressor.json"
    click US "https://github.com/kar2/progressor/blob/master/styles/progressor.less"

    %% Styling
    classDef ui fill:#FFA500,stroke:#333,stroke-width:2px
    classDef core fill:#3498DB,stroke:#333,stroke-width:2px
    classDef integration fill:#95A5A6,stroke:#333,stroke-width:2px
    classDef external fill:#2ECC71,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["UI Component"]:::ui
        L2["Core Component"]:::core
        L3["Integration Point"]:::integration
        L4["External Dependency"]:::external
    end
```
