# yourtablecloth/tablecloth architecture

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

- Interactive diagram: https://gitdiagram.com/yourtablecloth/tablecloth
- Repository: https://github.com/yourtablecloth/tablecloth

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Core Applications:
- TableCloth (Main Application)
- Spork (Helper Application)
- TableCloth.Resources (Resource Management)
- TableCloth.Shared (Shared Components)

b) Architectural Layers:
- UI Layer (XAML/WPF Components)
- View Models Layer (MVVM Pattern)
- Services Layer (Components)
- Resource Management
- Sandbox Integration

**┌─ User Interface Layer ─────────────────────────────┐**
- MainWindow                                       │
- Dialog Windows (About, Cert Select, Disclaimer)  │
- Pages (Catalog, Detail)                         │
- ┬───────────────────────────────┬─┘

**┌─────────────────▼───────────────────┐ ┌────────▼────────┐**
- View Models Layer                    │ │ Themes          │
- MainWindowViewModel               │ │ - Light/Dark    │
- CatalogPageViewModel             │ │ - Colorful      │
- DetailPageViewModel              │ └─────────────────┘
- ┬───────────────────┘

**┌─────────────────▼───────────────────┐**
- Services Layer                      │
- ┌─ Core Services ──────────────┐    │
- AppStartup                  │    │
- NavigationService          │    │
- ResourceResolver           │    │
- ┘    │
- ┌─ Sandbox Services ─────────┐      │
- SandboxBuilder           │      │
- SandboxLauncher         │      │
- SandboxCleanupManager   │      │
- ┘    │
- ┬───────────────────┘

**┌─────────────────▼───────────────────┐**
- Resource Management                  │
- Localization Resources            │
- UI Resources                      │
- Configuration                     │
- ┬───────────────────┘

**┌─────────────────▼───────────────────┐**
- Windows Sandbox Integration          │
- Sandbox Configuration             │
- Security Program Installation     │
- Internet Banking Support          │
- ┬─┘

**┌─────────────────▼───────────────────┐**
- Host System                         │
- Windows 10/11 (1909+)            │
- Windows Sandbox Feature           │
- ┬─┘

##### Important Relationships

- Unidirectional dependencies from higher to lower layers
- Service communication paths with the Windows Sandbox
- Resource access patterns

##### Additional Elements

- Version information and system requirements
- External dependencies (Windows Sandbox, .NET Framework)
- Localization support (Korean/English)

##### Implementation Notes

- Maintain proper spacing and alignment for readability
- Brief annotations for complex interactions
- Dual-license model indication (AGPL/Commercial)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["User Interface Layer"]
        MainWindow["Main Window"]
        DialogWindows["Dialog Windows"]
        Pages["Pages"]
        MainWindow --> DialogWindows
        MainWindow --> Pages
    end

    subgraph VM["View Models Layer"]
        MainVM["Main Window ViewModel"]
        CatalogVM["Catalog Page ViewModel"]
        DetailVM["Detail Page ViewModel"]
    end

    subgraph Themes["Theme Management"]
        ThemeSystem["Light/Dark Themes"]
        ColorSchemes["Colorful Schemes"]
    end

    subgraph Services["Services Layer"]
        subgraph CoreServices["Core Services"]
            AppStartup["App Startup"]
            Navigation["Navigation Service"]
            ResourceResolver["Resource Resolver"]
        end

        subgraph SandboxServices["Sandbox Services"]
            SandboxBuilder["Sandbox Builder"]
            SandboxLauncher["Sandbox Launcher"]
            SandboxCleanup["Sandbox Cleanup Manager"]
        end
    end

    subgraph Resources["Resource Management"]
        Localization["Localization Resources"]
        UIResources["UI Resources"]
        Configuration["Configuration"]
    end

    subgraph SandboxInt["Windows Sandbox Integration"]
        SandboxConfig["Sandbox Configuration"]
        SecurityPrograms["Security Program Installation"]
        BankingSupport["Internet Banking Support"]
    end

    subgraph System["Host System"]
        Windows["Windows 10/11 (1909+)"]
        SandboxFeature["Windows Sandbox Feature"]
    end

    UI <--> VM
    UI --> Themes
    VM --> Services
    Services --> Resources
    Services --> SandboxInt
    SandboxInt --> System

    %% Component Mappings
    click MainWindow "https://github.com/yourtablecloth/tablecloth/blob/main/src/TableCloth/MainWindow.xaml"
    click DialogWindows "https://github.com/yourtablecloth/tablecloth/tree/main/src/TableCloth/Dialogs/"
    click Pages "https://github.com/yourtablecloth/tablecloth/tree/main/src/TableCloth/Pages/"
    click ThemeSystem "https://github.com/yourtablecloth/tablecloth/tree/main/src/TableCloth/Themes/"
    click MainVM "https://github.com/yourtablecloth/tablecloth/tree/main/src/TableCloth/ViewModels/"
    click AppStartup "https://github.com/yourtablecloth/tablecloth/tree/main/src/TableCloth/Components/"
    click Navigation "https://github.com/yourtablecloth/tablecloth/tree/main/src/TableCloth/Components/Implementations/"
    click SandboxBuilder "https://github.com/yourtablecloth/tablecloth/blob/main/src/TableCloth/Components/Implementations/SandboxBuilder.cs"
    click SandboxLauncher "https://github.com/yourtablecloth/tablecloth/blob/main/src/TableCloth/Components/Implementations/SandboxLauncher.cs"
    click SandboxCleanup "https://github.com/yourtablecloth/tablecloth/blob/main/src/TableCloth/Components/Implementations/SandboxCleanupManager.cs"
    click Localization "https://github.com/yourtablecloth/tablecloth/tree/main/src/TableCloth.Resources/Resources/"
    click UIResources "https://github.com/yourtablecloth/tablecloth/tree/main/src/TableCloth/Resources/"
    click Configuration "https://github.com/yourtablecloth/tablecloth/tree/main/src/TableCloth.Shared/Models/Configuration/"
    click SandboxConfig "https://github.com/yourtablecloth/tablecloth/tree/main/src/TableCloth.Shared/Models/WindowsSandbox/"

    %% Styling
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef vm fill:#2ecc71,stroke:#27ae60,color:white
    classDef services fill:#e67e22,stroke:#d35400,color:white
    classDef resources fill:#9b59b6,stroke:#8e44ad,color:white
    classDef system fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef sandbox fill:#e74c3c,stroke:#c0392b,color:white

    class MainWindow,DialogWindows,Pages ui
    class MainVM,CatalogVM,DetailVM vm
    class AppStartup,Navigation,ResourceResolver,SandboxBuilder,SandboxLauncher,SandboxCleanup services
    class Localization,UIResources,Configuration resources
    class Windows,SandboxFeature system
    class SandboxConfig,SecurityPrograms,BankingSupport sandbox
```
