How sri-aurobindo/filearchiver works
Type: Windows desktop application — .NET Framework 4.8 WPF app using MVVM and “Clean Architecture”-style layering.
Purpose: User configures a set of target folders, supplies a timestamp, and the app scans files, filters them using a temporal strategy, then creates a ZIP archive in the executable directory. It supports async execution, progress reporting, and cancellation.
• WPF UI composition (View ↔ ViewModel)
• Orchestration path from UI action → service workflow → strategy + command → file system + zip output
• Persistence boundary (settings.json via repository)
• Cross-cutting concerns: cancellation, progress, error handling
• Views/
• MainWindow.xaml (+ code-behind) → WPF UI
• ViewModels/
• MainViewModel.cs → UI state + command bindings
• RelayCommand.cs → ICommand plumbing
• Models/
• TargetFolder.cs, FileMetadata.cs → domain entities / DTOs
• Services/
• FileArchiveService.cs → orchestration: scanning → filtering → archiving
• Strategies/
• IFileFilterStrategy.cs, TemporalFilterStrategy.cs → filtering algorithm plug-in
• Commands/
• IArchiveCommand.cs, CreateArchiveCommand.cs → archiving operation plug-in (ZIP)
• Infrastructure/
• IConfigRepository.cs, ConfigRepository.cs → settings.json persistence
• App / composition root:
• External world (important in this project):
• Windows File System (input folders; file metadata)
• settings.json (config store)
• ZIP output file (archive artifact)
What the README implies architecturally (relationships & flows to show)
• MVVM: View binds to ViewModel; ViewModel exposes commands/properties
• Repository: ViewModel or Service depends on IConfigRepository (not ConfigRepository)
• Strategy: Service depends on IFileFilterStrategy and can swap implementations
• Command pattern: Service (or ViewModel) triggers IArchiveCommand.ExecuteAsync(...)
• Service layer: FileArchiveService coordinates scanning/filtering/archiving
• Async + CancellationToken + IProgress: show these as control-flow “channels” from UI to long-running work
MainViewModel (MVVM ViewModel)
Application / Domain
CreateArchiveCommand (ZIP) (implementation)
Infrastructure
ConfigRepository (JSON) (implementation)
External / system boundaries
ZIP archive output (artifact in exe directory)
Composition root
Architectural principles visually
• «View», «ViewModel», «Service», «Repository», «Strategy», «Command», «Model», «External»
And show interfaces as separate nodes with implementations pointing to them:
• ConfigRepository → implements → IConfigRepository
• TemporalFilterStrategy → implements → IFileFilterStrategy
• CreateArchiveCommand → implements → IArchiveCommand
• MainViewModel → IConfigRepository
• FileArchiveService → IFileFilterStrategy, IArchiveCommand
• View → ViewModel → Service → (Strategy + Command + Repository) → externals
• Interfaces and implementations called out
Cancel flow triggers cleanup + partial zip deletion
• App.xaml.cs («Composition Root / DI»)
• MainWindow.xaml («View»)
• MainViewModel («ViewModel»)
• RelayCommand («MVVM Command Helper»)
• FileArchiveService («Service / Orchestrator»)
• TargetFolder, FileMetadata («Models»)
• IConfigRepository («Repository Interface»)
• ConfigRepository («JSON Repository»)
• IFileFilterStrategy («Strategy Interface»)
• TemporalFilterStrategy («Temporal Strategy»)
• IArchiveCommand («Command Interface»)
• CreateArchiveCommand («ZIP Command»)
• settings.json («External Config File»)
• Windows File System («External Input Folders»)
• HH-mm-ss.zip («External Output Artifact»)