LiteSnap is a snapshot/backup manager for Minecraft saves (and any folder). It stores file-level snapshots using content-addressable storage (SHA-512) with a LiteDB index.
dotnet build
dotnet run --project src/LiteSnap.Appsrc/
├── LiteSnap.Core/ # Class library — no UI dependency
│ ├── IO/HashStorage.cs # Content-addressable file store
│ ├── Models/ # VersionData, FileVersionObjects, ObjectType, FileVersionObjectsComparer
│ └── SnapLiteManager.cs # Full read/write snapshot management
└── LiteSnap.App/ # Avalonia desktop app
├── ViewModels/ # MainWindowViewModel (CommunityToolkit.Mvvm)
├── Views/ # MainWindow.axaml (WinUI3-style toolbar layout)
├── App.axaml / Program.cs
└── LiteSnap.App.csproj
- Nullable enabled everywhere. Use nullable annotations (
?,!) correctly. - File-scoped namespaces (
namespace X.Y;). - Primary constructors preferred for simple classes.
- No regions (
#region). Use comment headers (// ── X ──) for section grouping. - Async:
async Taskfor I/O,ConfigureAwait(false)on library code, not in UI layer. - MVVM:
[ObservableProperty]for bindable fields,[RelayCommand]for commands. - Use
Collection<T>overList<T>for public bindable APIs. - SCREAMING_SNAKE for
private constfields.
- Theme:
RequestedThemeVariant="Dark"enforced inApp.axaml. All brushes useDynamicResourceorStaticResourcefromApplication.Resources(PageBackground, CardBackground, ToolbarBackground, AccentBrush). - Toolbar buttons: Use
Classes="ToolbarButton"— flat, transparent bg, accent hover. - Card panels:
BorderwithCornerRadius="8",Background="{StaticResource CardBackgroundBrush}",BorderBrush="{StaticResource SubtleBorderBrush}". - Color palette defined in
App.axaml<Application.Resources>:PageBackground#1A1A1A,CardBackground#252525,ToolbarBackground#2D2D2DAccentColor#60CDE0,SubtleBorder#3D3D3DPrimaryText#FFFFFF,SecondaryText#9A9A9A,TertiaryText#6B6B6B
- List spacing: 12px margins, 8px corner radius on cards, 16px inner padding.
- Avoid inline colors; always define in
App.axamlresources. - Refer to BedrockBoot (OnePointUI.Avalonia) for WinUI3/Fluent design patterns.
| Type | Location | Purpose |
|---|---|---|
SnapLiteManager |
Core | Entry point: read/write/export snapshots |
HashStorage |
Core | Get/Put/Delete files by SHA-512 hash |
VersionData |
Core.Models | Snapshot metadata (NodeId, Name, Created, Desc) |
FileVersionObjects |
Core.Models | Single file/dir entry (Path, Hash, Length, ObjectType) |
ObjectType |
Core.Models | File / Directory |
MainWindowViewModel |
App | UI state & commands |
.litesnap/
├── index.db # LiteDB — VersionData table ("index"), per-version tables ("node_{guid}")
└── objects/
└── {hash[..2]}/ # Prefix folder (first 2 hex chars of SHA-512)
└── {hash} # Raw file content
HashStoragecomputes SHA-512 of file contents.LiteDBstores the version index and per-version file object lists.SnapLiteManager.Initialize(rootPath)creates a fresh.litesnapstructure.
No tests yet. When adding tests:
- Unit test
SnapLiteManagermethods with a temp folder + LiteDB in-memory. - Use
HashStoragewith a temp directory. - No Mock frameworks unless necessary.