# razzmatazzz/remnantsaveguardian architecture

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

- Interactive diagram: https://gitdiagram.com/razzmatazzz/remnantsaveguardian
- Repository: https://github.com/razzmatazzz/remnantsaveguardian

## Overview

##### Main Components

A. User Interface Layer (MVVM Architecture)
- Views (Windows and Pages)
- ViewModels
- User Controls

B. Core Services Layer
- Save Management
- World Analysis
- Backup System
- Localization System

C. Data Layer
- Game Data (game.json)
- Save File Processing
- Configuration Storage

##### Component Relationships

**┌─ UI Layer ─────────────────────┐**
- ┌─ Views ──┐  ┌─ ViewModels ─┐ │
- Main Window│←→│MainWindowVM  │ │
- Pages     │←→│BackupsVM     │ │
- Controls  │←→│SettingsVM    │ │
- ┘  │WorldAnalyzerVM│ │
- ┘ │
- Services Layer ───────────────┤
- ┌─ Core Services ────────────┐ │
- ApplicationHostService      │ │
- PageService                 │ │
- SaveWatcher                 │ │
- UpdateCheck                 │ │
- ┘ │
- Business Logic Layer ─────────┤
- ┌─ Game Logic ───────────────┐ │
- RemnantSave                 │ │
- RemnantWorldEvent           │ │
- RemnantCharacter            │ │
- SaveBackup                  │ │
- ┘ │
- Data Layer ──────────────────┤
- ┌─ Storage ────┐ ┌─ Config ─┐ │
- WindowsSave   │ │AppConfig │ │
- game.json     │ │Settings  │ │
- ┘ └──────────┘ │
- ┘

##### Key Elements to Highlight

A. MVVM Pattern Implementation:
- Clear separation between Views and ViewModels
- Data binding relationships

B. Localization System:
- Locales directory structure
- Connection to UI components

C. Save Management:
- Flow from game saves to backup storage
- Monitoring system (SaveWatcher)

D. World Analysis:
- Connection between game data and analysis components

##### Implementation Notes

- Maintain consistent styling and naming
- Notes for critical processes

Remember to include the localization system's integration, as the application supports multiple languages, and show how the game.json data flows through the world analyzer components to provide game information to the user.

This structure reflects a desktop application that follows modern .NET practices while maintaining a clear separation of concerns and modularity in its architecture.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#a8d1f0,stroke:#2980b9
    classDef service fill:#a8e6cf,stroke:#1abc9c
    classDef logic fill:#ffd3b6,stroke:#e67e22
    classDef data fill:#ffaaa5,stroke:#e74c3c
    classDef external fill:#d3d3d3,stroke:#7f8c8d

    %% UI Layer
    subgraph UI["User Interface Layer"]
        subgraph Views
            MW["Main Window"]
            Pages["Pages"]
            UC["User Controls"]
        end
        
        subgraph ViewModels
            MWVM["Main Window VM"]
            BVM["Backups VM"]
            SVM["Settings VM"]
            WAVM["World Analyzer VM"]
        end
    end

    %% Services Layer
    subgraph Services["Core Services Layer"]
        AHS["Application Host Service"]
        PS["Page Service"]
        SW["Save Watcher"]
        UC_S["Update Check"]
        LP["Localization Provider"]
    end

    %% Business Logic Layer
    subgraph Logic["Business Logic Layer"]
        RS["Remnant Save"]
        RWE["Remnant World Event"]
        RC["Remnant Character"]
        SB["Save Backup"]
    end

    %% Data Layer
    subgraph Data["Data Layer"]
        WS["Windows Save"]
        GD["game.json"]
        AC["App Config"]
        LR["Localization Resources"]
    end

    %% Relationships
    MW <--> MWVM
    Pages <--> BVM
    Pages <--> SVM
    Pages <--> WAVM
    
    MWVM --> AHS
    MWVM --> PS
    BVM --> SW
    SVM --> AC
    WAVM --> RWE
    
    AHS --> RS
    SW --> SB
    SW --> WS
    
    RS --> WS
    RWE --> GD
    RC --> RS
    
    LP --> LR

    %% Click Events
    click MW "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/Views/Windows/MainWindow.xaml"
    click Pages "https://github.com/Razzmatazzz/RemnantSaveGuardian/tree/main/RemnantSaveGuardian/Views/Pages"
    click UC "https://github.com/Razzmatazzz/RemnantSaveGuardian/tree/main/RemnantSaveGuardian/Views/UserControls"
    click MWVM "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/ViewModels/MainWindowViewModel.cs"
    click BVM "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/ViewModels/BackupsViewModel.cs"
    click SVM "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/ViewModels/SettingsViewModel.cs"
    click WAVM "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/ViewModels/WorldAnalyzerViewModel.cs"
    click AHS "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/Services/ApplicationHostService.cs"
    click PS "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/Services/PageService.cs"
    click SW "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/SaveWatcher.cs"
    click UC_S "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/UpdateCheck.cs"
    click RS "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/RemnantSave.cs"
    click RWE "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/RemnantWorldEvent.cs"
    click RC "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/RemnantCharacter.cs"
    click SB "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/SaveBackup.cs"
    click WS "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/WindowsSave.cs"
    click GD "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/game.json"
    click AC "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/Models/AppConfig.cs"
    click LP "https://github.com/Razzmatazzz/RemnantSaveGuardian/blob/main/RemnantSaveGuardian/LocalizationProvider.cs"
    click LR "https://github.com/Razzmatazzz/RemnantSaveGuardian/tree/main/RemnantSaveGuardian/locales"

    %% Style Applications
    class MW,Pages,UC,MWVM,BVM,SVM,WAVM ui
    class AHS,PS,SW,UC_S,LP service
    class RS,RWE,RC,SB logic
    class WS,GD,AC,LR data
```
