# betsegaw/windowwalker architecture

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

- Interactive diagram: https://gitdiagram.com/betsegaw/windowwalker
- Repository: https://github.com/betsegaw/windowwalker

## Overview

##### Project Type Analysis
This is a Windows desktop application built with WPF (Windows Presentation Foundation) following the MVVM (Model-View-ViewModel) pattern, as evidenced by the project structure and the use of MahApps.Metro UI framework.

##### Main Components

A. Core Components Layer:
- Window Management System
- Search Engine (FuzzyMatching)
- Window Preview System
- Settings Management
- Application Updates

B. UI Layer:
- Main Window Interface
- Live Preview Component
- Search Results View

C. Infrastructure Layer:
- Hotkey System
- Windows API Integration
- Settings Storage

**[UI Layer]**
- ↑↓
**[Core Components]**
- ↑↓
**[Infrastructure Layer]**

##### Specific Component Relationships

a. User Interaction Flow:
HotKeyHandler -> MainWindow -> WindowWalkerViewModel

b. Search Flow:
WindowSearchController -> FuzzyMatching -> OpenWindows -> WindowResult

c. Preview System:
LivePreview -> InteropAndHelpers -> Windows API

##### Critical Elements

**[HotKey System (CTRL + WIN)]**
- ↓
**[Main Window Interface]**
- ↓
**[Search Controller]**
- ↙   ↓    ↘
**[Fuzzy   [Window   [Live**
**Match]   Manager]  Preview]**
- ↘   ↓    ↙
**[Windows API Interface]**

##### Important Details to Note

- MVVM pattern implementation:
- Models: Window.cs, WindowResult.cs
- ViewModels: WindowWalkerViewModel.cs
- Views: MainWindow.xaml

- Asynchronous search functionality
- Settings persistence system
- Application update mechanism

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI
        MW["Main Window"]
        SRV["Search Results View"]
        LPV["Live Preview View"]
    end

    subgraph Core
        WSC["Window Search Controller"]
        FM["Fuzzy Matching"]
        OW["Open Windows"]
        LP["Live Preview"]
        WR["Window Results"]
        SM["Settings Manager"]
        AU["Application Updates"]
    end

    subgraph Infrastructure
        HK["Hotkey Handler"]
        WA["Windows API"]
        IH["Interop & Helpers"]
        MVVM["MVVM Infrastructure"]
        WVM["Window Walker ViewModel"]
    end

    %% UI Layer Connections
    MW --> WVM
    WVM --> SRV
    WVM --> LPV

    %% Core Layer Connections
    WSC --> FM
    FM --> WR
    WSC --> OW
    OW --> WR
    LP --> IH
    SM --> WVM
    AU --> WVM

    %% Infrastructure Layer Connections
    HK --> MW
    IH --> WA
    WVM --> WSC
    MVVM --> WVM

    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef infrastructure fill:#f1c40f,stroke:#f39c12,color:black
    
    class MW,SRV,LPV ui
    class WSC,FM,OW,LP,WR,SM,AU core
    class HK,WA,IH,MVVM,WVM infrastructure

    %% Click Events
    click MW "https://github.com/betsegaw/windowwalker/blob/master/Window Walker/Window Walker/MainWindow.xaml"
    click WSC "https://github.com/betsegaw/windowwalker/blob/master/Window Walker/Window Walker/Components/WindowSearchController.cs"
    click FM "https://github.com/betsegaw/windowwalker/blob/master/Window Walker/Window Walker/Components/FuzzyMatching.cs"
    click OW "https://github.com/betsegaw/windowwalker/blob/master/Window Walker/Window Walker/Components/OpenWindows.cs"
    click LP "https://github.com/betsegaw/windowwalker/blob/master/Window Walker/Window Walker/Components/LivePreview.cs"
    click SM "https://github.com/betsegaw/windowwalker/blob/master/Window Walker/Window Walker/Components/SettingsManager.cs"
    click AU "https://github.com/betsegaw/windowwalker/blob/master/Window Walker/Window Walker/Components/ApplicationUpdates.cs"
    click HK "https://github.com/betsegaw/windowwalker/blob/master/Window Walker/Window Walker/HotKeyHandler.cs"
    click IH "https://github.com/betsegaw/windowwalker/blob/master/Window Walker/Window Walker/Components/InteropAndHelpers.cs"
    click MVVM "https://github.com/betsegaw/windowwalker/tree/master/Window Walker/Window Walker/MVVMHelpers"
    click WVM "https://github.com/betsegaw/windowwalker/blob/master/Window Walker/Window Walker/ViewModels/WindowWalkerViewModel.cs"
    click WR "https://github.com/betsegaw/windowwalker/blob/master/Window Walker/Window Walker/Components/WindowResult.cs"
```
