# rvnleon/folder-organizer-automation architecture

> Architecture diagram of the GitHub repository rvnleon/folder-organizer-automation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rvnleon/folder-organizer-automation
- Repository: https://github.com/rvnleon/folder-organizer-automation

## Overview

Folder Organizer is a command-line tool that sorts files into category folders while preserving filesystem metadata. The main workflow is CLI configuration and logging, followed by organization planning, collision resolution, and safe filesystem operations. Safety checks, metadata handling, and collision strategies are meaningful supporting subsystems. The excerpts establish the CLI-to-organizer call and several module dependencies; some internal calls are unsampled, so those links are marked unverified rather than asserted.

Main entry points: [`src/folder_organizer/organize.py`](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/organize.py) (Organization runner), [`src/folder_organizer/safety.py`](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/safety.py) (Safe file operations), [`src/folder_organizer/metadata.py`](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/metadata.py) (Metadata preservation), [`src/folder_organizer/cli.py`](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/cli.py) (CLI and logging)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_cli["CLI and logging<br/>[cli.py]"]
end

subgraph group_organization["Organization workflow"]
  node_organizer["Organization runner<br/>[organize.py]"]
  node_categorization["File categorization<br/>[organize.py]"]
  node_planning["Operation planning<br/>[organize.py]"]
end

subgraph group_safety["Filesystem safety"]
  node_path_safety["Path and root checks<br/>[safety.py]"]
  node_safe_ops["Safe file operations<br/>[safety.py]"]
end

subgraph group_support["Operation support"]
  node_collisions["Collision resolution<br/>[collision.py]"]
  node_metadata["Metadata preservation<br/>[metadata.py]"]
end

node_user(("CLI user"))
node_filesystem["Organized filesystem"]

node_user -->|"configures"| node_cli
node_cli -->|"runs"| node_organizer
node_organizer -->|"categorizes"| node_categorization
node_organizer -->|"plans operations"| node_planning
node_organizer -->|"resolves conflicts"| node_collisions
node_organizer -->|"snapshots metadata"| node_metadata
node_organizer -.->|"checks paths"| node_path_safety
node_organizer -.->|"executes moves"| node_safe_ops
node_safe_ops -->|"validates paths"| node_path_safety
node_safe_ops -->|"restores metadata"| node_metadata
node_organizer -->|"organizes files"| node_filesystem
node_metadata -->|"preserves attributes"| node_filesystem

click node_cli "https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/cli.py"
click node_organizer "https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/organize.py"
click node_categorization "https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/organize.py"
click node_planning "https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/organize.py"
click node_collisions "https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/collision.py"
click node_path_safety "https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/safety.py"
click node_safe_ops "https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/safety.py"
click node_metadata "https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/metadata.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_user toneBlue
class node_organizer,node_categorization,node_planning toneAmber
class node_path_safety,node_safe_ops toneMint
class node_collisions,node_metadata toneRose
class node_filesystem toneIndigo
```

## Components

### User interface

- [CLI and logging](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/cli.py): `src/folder_organizer/cli.py`

### Organization workflow

- [Organization runner](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/organize.py): `src/folder_organizer/organize.py`
- [File categorization](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/organize.py): `src/folder_organizer/organize.py`
- [Operation planning](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/organize.py): `src/folder_organizer/organize.py`

### Filesystem safety

- [Path and root checks](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/safety.py): `src/folder_organizer/safety.py`
- [Safe file operations](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/safety.py): `src/folder_organizer/safety.py`

### Operation support

- [Collision resolution](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/collision.py): `src/folder_organizer/collision.py`
- [Metadata preservation](https://github.com/rvnleon/folder-organizer-automation/blob/main/src/folder_organizer/metadata.py): `src/folder_organizer/metadata.py`

### Other components

- **CLI user**
- **Organized filesystem**

## Connections

- CLI user → CLI and logging: configures (evidence: `README.md`)
- CLI and logging → Organization runner: runs (evidence: `src/folder_organizer/cli.py`)
- Organization runner → File categorization: categorizes (evidence: `README.md`)
- Organization runner → Operation planning: plans operations (evidence: `src/folder_organizer/organize.py`)
- Organization runner → Collision resolution: resolves conflicts (evidence: `src/folder_organizer/organize.py`)
- Organization runner → Metadata preservation: snapshots metadata (evidence: `src/folder_organizer/organize.py`)
- Organization runner → Path and root checks: checks paths (evidence: `src/folder_organizer/organize.py`)
- Organization runner → Safe file operations: executes moves (evidence: `src/folder_organizer/organize.py`)
- Safe file operations → Path and root checks: validates paths (evidence: `src/folder_organizer/safety.py`)
- Safe file operations → Metadata preservation: restores metadata (evidence: `src/folder_organizer/safety.py`)
- Organization runner → Organized filesystem: organizes files (evidence: `README.md`)
- Metadata preservation → Organized filesystem: preserves attributes (evidence: `README.md`)
