# joeljaison391/downloads-organizer architecture

> Architecture diagram of the GitHub repository joeljaison391/downloads-organizer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joeljaison391/downloads-organizer
- Repository: https://github.com/joeljaison391/downloads-organizer

## Overview

##### Main Components

a) Core System Components:
- File Monitor Service
- File Processor
- File Categorizer
- Report Generator
- Notification System
- Logging System
- Benchmark Module

b) Storage Components:
- Downloads Directory (Input)
- Categorized Directories (Output)
- Images
- Videos
- Documents
- Archives
- Audio
- Others
- Unused

##### Component Relationships

- Data Flow (→): Show how files move through the system
- Dependencies (⇢): Show service relationships
- Event Triggers (⇨): Show notification and logging triggers

##### Specific Implementation Details

- The event-driven nature of the file monitoring system
- The weekly report generation schedule
- The file stability checking mechanism
- The benchmark testing flow

##### Additional Elements

Specific features:
- File type categories list
- Weekly report generation schedule
- Benchmark metrics display

##### Key Flows to Highlight

a) Main File Processing Flow:
**Downloads Folder → File Monitor → Stability Check → Type Analysis → Categorization → Move to Appropriate Folder**

b) Report Generation Flow:
**Trigger (Weekly/Initial) → Data Collection → Report Generation → HTML Output → Notification**

c) Benchmark Flow:
**Benchmark Trigger → Performance Monitoring → Metrics Collection → Results Output**

##### Technical Details

- Operating System Integration points
- Task Scheduler integration (Windows)
- File system watchers
- Error handling paths
- Logging mechanisms

##### Performance Metrics

A section showing:
- CPU Usage (~0.77%)
- Memory Usage (~13 MB)
- System Requirements

## Diagram (Mermaid)

```mermaid
%%{init: {
  'theme': 'base',
  'themeVariables': {
    'primaryColor': '#2b2b2b',
    'primaryTextColor': '#fff',
    'primaryBorderColor': '#7C0000',
    'lineColor': '#F8B229',
    'secondaryColor': '#006100',
    'tertiaryColor': '#0000ff'
  }
}}%%

flowchart TB
    classDef core fill:#2b2b2b,stroke:#333,stroke-width:2px,color:#fff
    classDef support fill:#006100,stroke:#333,stroke-width:2px,color:#fff
    classDef storage fill:#F8B229,stroke:#333,stroke-width:2px,color:#000
    classDef ui fill:#800080,stroke:#333,stroke-width:2px,color:#fff
    classDef config fill:#4B0082,stroke:#333,stroke-width:2px,color:#fff

    subgraph UI["User Interface Layer"]
        DN[Desktop Notifications]:::ui
        RV[Report Viewer]:::ui
    end

    subgraph Core["Core Services Layer"]
        FMS[File Monitor Service]:::core
        FSC[File Stability Checker]:::core
        FTA[File Type Analyzer]:::core
        FO[File Organizer]:::core
    end

    subgraph Support["Support Services Layer"]
        RG[Report Generator]:::support
        LS[Logging System]:::support
        BM[Benchmark Module]:::support
        CI[CI/CD Pipeline]:::support
        TF[Testing Framework]:::support
    end

    subgraph Storage["Storage Layer"]
        DD[Downloads Directory]:::storage
        subgraph CD["Categorized Directories"]
            IMG[Images]:::storage
            VID[Videos]:::storage
            DOC[Documents]:::storage
            ARC[Archives]:::storage
            AUD[Audio]:::storage
            OTH[Others]:::storage
            UNU[Unused]:::storage
        end
    end

    PC[Project Configuration]:::config

    %% Relationships
    DD --> FMS
    FMS --> FSC
    FSC --> FTA
    FTA --> FO
    FO --> CD
    FMS --> RG
    FMS --> LS
    FMS --> BM
    RG --> DN
    RG --> RV

    %% Click Events
    click FMS "https://github.com/Joeljaison391/Downloads-Organizer/blob/main/src/main.rs"
    click RG "https://github.com/Joeljaison391/Downloads-Organizer/blob/main/src/report.rs"
    click BM "https://github.com/Joeljaison391/Downloads-Organizer/blob/main/src/benchmark.rs"
    click CI "https://github.com/Joeljaison391/Downloads-Organizer/blob/main/.github/workflows/build.yml"
    click TF "https://github.com/Joeljaison391/Downloads-Organizer/blob/main/.github/workflows/test.yml"
    click PC "https://github.com/Joeljaison391/Downloads-Organizer/blob/main/Cargo.toml"

    %% Legend
    subgraph Legend
        L1[Core Services]:::core
        L2[Support Services]:::support
        L3[Storage Components]:::storage
        L4[User Interface]:::ui
        L5[Configuration]:::config
    end
```
