# code-env/tidyup architecture

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

- Interactive diagram: https://gitdiagram.com/code-env/tidyup
- Repository: https://github.com/code-env/tidyup

## Overview

##### Main Components

A. CLI Application Core (src directory):
- Command Parser
- File Organization Engine
- File System Operations Module
- Output Generator

B. Documentation Website (www directory):
- React Frontend
- Static Assets
- UI Components
- Documentation Content

**┌─ CLI Application ─────────────────┐    ┌─ Documentation Website ────────┐**

- ┌─────────────┐               │    │    ┌──────────┐ ┌──────────┐  │
- React   │ │  Static  │  │
- Command   │               │    │    │   App    │ │  Assets  │  │
- Parser    │               │    │    │          │ │          │  │
- ┬───────┘               │    │    └────┬─────┘ └──────────┘  │

- ┌─────▼───────┐ ┌─────────┐  │    │    ┌────▼─────┐               │
- File     │ │  File   │  │    │    │   UI     │               │
- Organization ├─►  System │  │    │    │Components │               │
- Engine    │ │   API   │  │    │    │          │               │
- ┘ └────┬────┘  │    │    └──────────┘               │

- ┌─────────────┐     │        │    │    ┌──────────┐               │
- Output    │◄────┘        │    │    │  Utils   │               │
- Generator  │              │    │    │          │               │
- ┘              │    │    └──────────┘               │

- ┘    └────────────────────────────────┘

##### Component Details

A. CLI Application:
- Command Parser: Handles CLI arguments and options (--ext, --name, --date)
- File Organization Engine: Core logic for file categorization
- File System API: Handles file operations (move, create directories)
- Output Generator: Creates summary reports

B. Documentation Website:
- React App: Main application container
- UI Components: Reusable components (buttons, demo, features)
- Static Assets: Images and other resources
- Utils: Shared utility functions

##### Additional Elements

- Version information
- Node.js runtime environment
- File system interaction layer
- Error handling flow
- Configuration options flow

##### Implementation Technologies to Highlight

- TypeScript
- Node.js
- React
- Vite
- Tailwind CSS

##### Key Interactions to Emphasize

- Command line input → Parser → Engine
- Engine → File System → Output
- Website: React Components → UI Rendering
- Configuration flow through the system

Remember to:
- Use consistent styling
- Brief descriptions for main components
- Error handling paths
- Configuration points

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph CLI["CLI Application"]
        direction TB
        CP["Command Parser"]
        FOE["File Organization Engine"]
        FSO["File System Operations"]
        OG["Output Generator"]
        
        CP --> FOE
        FOE --> FSO
        FSO --> OG
    end

    subgraph WEB["Documentation Website"]
        direction TB
        RA["React App"]:::react
        UI["UI Components"]:::ui
        SA["Static Assets"]:::static
        UT["Utils"]:::utils
        
        subgraph Components["Component Layer"]
            direction TB
            DEMO["Demo Interface"]:::ui
            FEAT["Features"]:::ui
            LP["Landing Page"]:::ui
            BCE["Button Component"]:::ui
        end
        
        RA --> UI
        UI --> Components
        UT --> UI
        SA --> UI
    end

    %% Click Events
    click CP "https://github.com/code-env/tidyup/blob/master/src/index.ts"
    click RA "https://github.com/code-env/tidyup/blob/master/www/src/App.tsx"
    click UI "https://github.com/code-env/tidyup/tree/master/www/src/components"
    click DEMO "https://github.com/code-env/tidyup/blob/master/www/src/components/demo.tsx"
    click FEAT "https://github.com/code-env/tidyup/blob/master/www/src/components/features.tsx"
    click LP "https://github.com/code-env/tidyup/blob/master/www/src/components/landing-page.tsx"
    click BCE "https://github.com/code-env/tidyup/blob/master/www/src/components/ui/button.tsx"
    click UT "https://github.com/code-env/tidyup/blob/master/www/src/lib/utils.ts"
    click SA "https://github.com/code-env/tidyup/tree/master/www/src/assets"

    %% Styling
    classDef react fill:#61DAFB,stroke:#333,stroke-width:2px
    classDef ui fill:#FF6B6B,stroke:#333,stroke-width:2px
    classDef static fill:#4CAF50,stroke:#333,stroke-width:2px
    classDef utils fill:#9C27B0,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        direction TB
        L1["React Components"]:::react
        L2["UI Elements"]:::ui
        L3["Static Resources"]:::static
        L4["Utilities"]:::utils
    end
```
