# bytexgrid/neatshift architecture

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

- Interactive diagram: https://gitdiagram.com/bytexgrid/neatshift
- Repository: https://github.com/bytexgrid/neatshift

## Overview

##### Main Components

a. User Interface Layer:
- XAML-based WPF application structure
- Both Views and ViewModels (MVVM pattern is evident)
- Theme support (Light/Dark modes)

b. Core Services Layer:
- File Operation Service
- System Restore Service
- Settings Service
- Update Service
- IO Helper Services

c. Models Layer:
- FileSystemItem
- RestorePoint
- Settings

**┌─ Presentation Layer ─────────────────────┐**
- Views                    ViewModels      │
- MainWindow            - MainWindowVM   │
- SettingsDialog        - RestorePointVM │
- SymbolicLinksDialog                    │
- ┬─────────────────────┘
- ↓
**┌─ Services Layer ──────────────────────────┐**
- ┌─ Core Services ─┐  ┌─ System Services ─┐│
- FileOperation   │  │ SystemRestore     ││
- Settings        │  │ UpdateService     ││
- IOHelper        │  │                   ││
- ┘  └───────────────────┘│
- ┬─────────────────────┘
- ↓
**┌─ Data Layer ────────────────────────────┐**
- Models                                  │
- FileSystemItem                        │
- RestorePoint                          │
- Settings                              │
- ┘

##### Additional Elements

- Version information
- External system dependencies (Windows API calls)
- Configuration storage locations

##### Interaction Flows

- User input → View → ViewModel → Services
- File operations → System calls
- Settings persistence flow
- Update check sequence

##### Technical Details

- .NET 6.0 runtime context
- Windows SDK dependencies
- File system interaction points
- System restore integration points

Remember to include:
- Error handling paths
- Security context transitions
- File system operation flows
- Settings persistence mechanisms
- Update check workflows

This will provide a complete picture of how NeatShift operates while maintaining clarity and usefulness for development and documentation purposes.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#a8d1f0,stroke:#2980b9
    classDef service fill:#a8e6cf,stroke:#1b4332
    classDef model fill:#ffd3b6,stroke:#ff8b3d
    classDef system fill:#ff8585,stroke:#c81e1e
    classDef interface fill:#d3d3d3,stroke:#666

    %% Legend
    subgraph Legend
        UI[UI Components]:::ui
        SVC[Services]:::service
        MDL[Models]:::model
        SYS[System Operations]:::system
        INT[Interfaces]:::interface
    end

    %% Presentation Layer
    subgraph PresentationLayer[Presentation Layer]
        subgraph Views
            MainWindow[MainWindow]:::ui
            SettingsDialog[SettingsDialog]:::ui
            SymbolicLinksDialog[SymbolicLinksDialog]:::ui
            RestorePointDialog[RestorePointDialog]:::ui
        end

        subgraph ViewModels
            MainWindowVM[MainWindowViewModel]:::ui
            RestorePointVM[RestorePointViewModel]:::ui
        end
    end

    %% Service Layer
    subgraph ServiceLayer[Service Layer]
        subgraph Interfaces
            IFileOp[IFileOperationService]:::interface
            ISettings[ISettingsService]:::interface
            IRestore[ISystemRestoreService]:::interface
        end

        subgraph CoreServices[Core Services]
            FileOp[FileOperationService]:::service
            SettingsSvc[SettingsService]:::service
            RestoreSvc[SystemRestoreService]:::service
            UpdateSvc[UpdateService]:::service
            IOHelper[IOHelper]:::service
        end
    end

    %% Data Layer
    subgraph DataLayer[Data Layer]
        FSItem[FileSystemItem]:::model
        RestorePoint[RestorePoint]:::model
        Settings[Settings]:::model
    end

    %% Application Entry
    App[Application Entry]:::ui

    %% Relationships
    App --> MainWindow
    MainWindow --> MainWindowVM
    MainWindowVM --> IFileOp
    MainWindowVM --> ISettings
    MainWindowVM --> IRestore
    
    RestorePointDialog --> RestorePointVM
    RestorePointVM --> IRestore
    
    IFileOp --> FileOp
    ISettings --> SettingsSvc
    IRestore --> RestoreSvc
    
    FileOp --> IOHelper
    SettingsSvc --> Settings
    RestoreSvc --> RestorePoint
    FileOp --> FSItem

    %% Click Events
    click MainWindow "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Views/MainWindow.xaml"
    click SettingsDialog "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Views/SettingsDialog.xaml"
    click SymbolicLinksDialog "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Views/SymbolicLinksDialog.xaml"
    click RestorePointDialog "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Views/RestorePointDialog.xaml"
    click MainWindowVM "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/ViewModels/MainWindowViewModel.cs"
    click RestorePointVM "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/ViewModels/RestorePointViewModel.cs"
    click FileOp "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Services/FileOperationService.cs"
    click RestoreSvc "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Services/SystemRestoreService.cs"
    click SettingsSvc "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Services/SettingsService.cs"
    click UpdateSvc "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Services/UpdateService.cs"
    click IOHelper "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Services/IOHelper.cs"
    click FSItem "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Models/FileSystemItem.cs"
    click RestorePoint "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Models/RestorePoint.cs"
    click Settings "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Models/Settings.cs"
    click IFileOp "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Services/IFileOperationService.cs"
    click ISettings "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Services/ISettingsService.cs"
    click IRestore "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/Services/ISystemRestoreService.cs"
    click App "https://github.com/BytexGrid/NeatShift/blob/main/NeatShift/NeatShift/App.xaml"
```
