How cassiojhones/folderflex works
Project Type and Purpose
• This is a desktop application built with WPF (XAML + .NET 8) following the MVVM pattern.
• FolderFlex automates moving/copying of large numbers of files from nested subfolders into a single root or destination folder, with progress feedback, error logging, and auto-update via GitHub Releases.
File-Structure Analysis
Top‐level:
• FolderFlex.sln – solution file for both projects.
• FolderFlex/ – WPF app project.
• FolderFlexCommon/ – shared class library for messaging and settings.
• config.flx – runtime configuration.
Within FolderFlex/:
• View/ (XAML views)
• ViewModel/ (VMs exposing commands & properties)
• Factory/ (ComponentFactory for MainWindow, illustrates Factory Pattern)
• Services/
– FileService.cs (core file‐move/copy operations)
– ErrorManager/ (ErrorHandler, ErrorLogger, LogManager implementing Observer Pattern via IObserver/ISubject)
– OpenDialog.cs (UI file/folder picking)
• Util/ (converters, RelayCommand for ICommand, UpdateChecker for GitHub Releases)
• App.xaml(.cs) (application entry point)
Within FolderFlexCommon/:
• Messages/MessageMap & messages.json (i18n)
• Settings/ (ApplicationSettings, IniFileParameterStore, XmlParameterStore implementing IParameterStore)
README Insights
• Confirms WPF front end, .NET 8 back end.
• Highlights MVVM, multi-language support, progress feedback, auto updates, and logging.
Diagramming the Architecture
a. Main Components
1) UI Layer (WPF View)
2) Presentation Layer (ViewModel, RelayCommand)
3) Component Factory (instantiates MainWindow components)
4) Business Logic / Domain Layer (FileService)
5) Services
• ErrorManager (Observer Pattern)
• OpenDialog service
• UpdateChecker (External GitHub Releases API)
6) Shared Library (FolderFlexCommon):
• Messaging (JSON resources)
• Settings (INI/XML parameter stores)
7) Data Stores:
• Local file system (source/destination folders, config.flx)
• Log files
8) External Service: GitHub Releases
b. Relationships & Data Flow
• User clicks button in View → ViewModel command executes → uses Factory to build processing components → FileService scans file system → raises progress events → ErrorManager logs errors (Observer) → FileService writes to destination FS.
• ViewModel subscribes to FileService events to update UI.
• UpdateChecker periodically calls GitHub Releases REST API → notifies ViewModel → prompts user to update.
• Settings are loaded via IParameterStore implementations (INI or XML) from FolderFlexCommon and injected into services.
c. Architectural Patterns
• MVVM (UI / ViewModel / Model separation)
• Factory Pattern (component creation)
• Observer Pattern (ErrorManager / logging, progress notifications)
• Dependency Injection (services and common library abstractions)
d. Technologies & Libraries
• WPF (XAML, System.Windows)
• .NET 8
• JSON (messages.json for i18n)
• GitHub REST API (auto-update)
• IParameterStore (INI/XML config handling)