# studcroc/blissful_backdrop architecture

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

- Interactive diagram: https://gitdiagram.com/studcroc/blissful_backdrop
- Repository: https://github.com/studcroc/blissful_backdrop

## Overview

##### Project type and purpose
- This is a cross-platform Flutter application (“Blissful Backdrop”) whose primary function is a desktop wallpaper setter for Windows (with support also for MacOS, Linux, Android, iOS, and Web).
- There is no self-hosted backend in the repo; network calls (e.g., for updates or wallpaper catalogs) would go to external APIs.

##### File structure
- Top‐level “lib/” directory holds all Dart application code (UI widgets, business logic, services).
- Platform folders—“android/”, “ios/”, “linux/”, “macos/”, “windows/”, “web/”—contain the embedding code and build configurations:
- android: Gradle project with Kotlin MainActivity
- ios: Xcode project with Swift/Objective-C bridge
- linux/windows: CMake + native C++ code for Flutter embedder & plugin registration
- macos: Xcode with Swift & plugin registrant
- Build/config files: pubspec.yaml, Android Gradle scripts, CMakeLists.txt, Xcode configs, Inno-Setup .iss installer script.

##### README for additional insights
- Describes client features: browsing categories, auto-detect multi-monitor layouts, random wallpapers, update checks.
- No mention of an internal server—images and update metadata must come from external services.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Flutter Core Layers
    subgraph "Flutter Dart Core" 
        direction TB
        UI["Flutter UI"]:::dart
        Logic["App Logic & Services"]:::dart
        Data["Data Layer"]:::dart
    end

    %% UI Layer
    subgraph "Flutter UI Layer"
        direction TB
        Main["main.dart"]:::dart
        Home["home.dart"]:::dart
        About["about.dart"]:::dart
    end

    %% Logic & Services
    subgraph "Application Logic & Services"
        direction TB
        ActiveWP["active_wallpaper.dart"]:::dart
        CheckUpd["check_update.dart"]:::dart
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        NetSvc["Network Service"]:::external
        Assets["Local Assets"]:::dart
        Pubspec["pubspec.yaml"]:::dart
    end

    %% External APIs
    WallpaperAPI[("Wallpaper Catalog API")]:::external
    UpdateAPI[("Update Metadata API")]:::external

    %% Platform Embedders
    subgraph "Platform Embedders"
        direction TB
        subgraph Android
            direction TB
            AAndroid["MainActivity.kt"]:::native
        end
        subgraph iOS
            direction TB
            AIOS1["AppDelegate.swift"]:::native
            AIOS2["Runner-Bridging-Header.h"]:::native
        end
        subgraph Linux
            direction TB
            ALin1["main.cc"]:::native
            ALin2["my_application.cc/.h"]:::native
            ALin3["generated_plugin_registrant.cc/.h"]:::native
        end
        subgraph macOS
            direction TB
            AMac1["MainFlutterWindow.swift"]:::native
            AMac2["GeneratedPluginRegistrant.swift"]:::native
        end
        subgraph Windows
            direction TB
            AWin1["main.cpp"]:::native
            AWin2["flutter_window.cpp/.h"]:::native
            AWin3["utils.cpp/.h"]:::native
            AWin4["generated_plugin_registrant.cc/.h"]:::native
        end
    end

    %% Native OS APIs
    subgraph "Native Platform & OS APIs"
        direction TB
        WinAPI["win32_window.cpp/.h"]:::os
        LinAPI["my_application.cc/.h"]:::os
        MacAPI["AppDelegate.swift"]:::os
    end

    %% Build & Packaging
    subgraph "Build & Packaging Subsystems"
        direction TB
        subgraph "Flutter Pub"
            PubYAML["pubspec.yaml"]:::dart
            PubLock["pubspec.lock"]:::dart
        end
        subgraph "Android (Gradle)"
            AG1["android/app/build.gradle"]:::pack
            AG2["android/gradle/"]:::pack
        end
        subgraph "iOS (Xcode)"
            IOS1["ios/Runner.xcodeproj/"]:::pack
            IOS2["ios/Runner.xcworkspace/"]:::pack
            IOS3["ios/Flutter/*.xcconfig"]:::pack
        end
        subgraph "Linux (CMake)"
            LCM1["linux/CMakeLists.txt"]:::pack
            LCM2["linux/flutter/generated_plugins.cmake"]:::pack
        end
        subgraph "macOS (Xcode)"
            MCM1["macos/Runner.xcodeproj/"]:::pack
            MCM2["macos/Runner/Configs/*.xcconfig"]:::pack
        end
        subgraph "Windows (CMake & Inno)"
            WCM1["windows/CMakeLists.txt"]:::pack
            WCM2["windows/runner/CMakeLists.txt"]:::pack
            WCM3["installers/installer.iss"]:::pack
            WCM4["installers/blissful_backdrop.exe"]:::pack
        end
        subgraph "Web"
            WS1["web/index.html"]:::pack
            WS2["web/manifest.json"]:::pack
            WS3["web/icons/"]:::pack
        end
    end

    %% Connections
    Main -->|taps| Logic
    Home --> Logic
    About --> Logic
    Logic -->|requests wallpapers| NetSvc
    NetSvc -->|fetches| WallpaperAPI
    Logic -->|requests updates| NetSvc
    NetSvc -->|fetches| UpdateAPI
    Assets --> Data
    Pubspec --> Data

    Logic -->|invoke| PlatformChannel["MethodChannel"]:::dart
    PlatformChannel -->|dispatch| AAndroid
    PlatformChannel --> AIOS1
    PlatformChannel --> ALin1
    PlatformChannel --> AMac1
    PlatformChannel --> AWin1

    AAndroid --> WinAPI
    AIOS1 --> MacAPI
    ALin1 --> LinAPI
    AMac1 --> MacAPI
    AWin1 --> WinAPI

    CheckUpd -->|polls| UpdateAPI
    CheckUpd -->|notifies| Main

    %% Click Events
    click Main "https://github.com/studcroc/blissful_backdrop/blob/master/lib/main.dart"
    click Home "https://github.com/studcroc/blissful_backdrop/blob/master/lib/home.dart"
    click About "https://github.com/studcroc/blissful_backdrop/blob/master/lib/about.dart"
    click ActiveWP "https://github.com/studcroc/blissful_backdrop/blob/master/lib/active_wallpaper.dart"
    click CheckUpd "https://github.com/studcroc/blissful_backdrop/blob/master/lib/check_update.dart"
    click NetSvc "https://github.com/studcroc/blissful_backdrop/blob/master/lib/check_update.dart"
    click Assets "https://github.com/studcroc/blissful_backdrop/tree/master/lib/assets/"
    click Pubspec "https://github.com/studcroc/blissful_backdrop/blob/master/pubspec.yaml"
    click AAndroid "https://github.com/studcroc/blissful_backdrop/blob/master/android/app/src/main/kotlin/com/example/blissful_backdrop/MainActivity.kt"
    click AIOS1 "https://github.com/studcroc/blissful_backdrop/blob/master/ios/Runner/AppDelegate.swift"
    click AIOS2 "https://github.com/studcroc/blissful_backdrop/blob/master/ios/Runner/Runner-Bridging-Header.h"
    click ALin1 "https://github.com/studcroc/blissful_backdrop/blob/master/linux/main.cc"
    click ALin2 "https://github.com/studcroc/blissful_backdrop/blob/master/linux/my_application.cc/.h"
    click ALin3 "https://github.com/studcroc/blissful_backdrop/blob/master/linux/flutter/generated_plugin_registrant.cc/.h"
    click AMac1 "https://github.com/studcroc/blissful_backdrop/blob/master/macos/Runner/MainFlutterWindow.swift"
    click AMac2 "https://github.com/studcroc/blissful_backdrop/blob/master/macos/Flutter/GeneratedPluginRegistrant.swift"
    click AWin1 "https://github.com/studcroc/blissful_backdrop/blob/master/windows/runner/main.cpp"
    click AWin2 "https://github.com/studcroc/blissful_backdrop/blob/master/windows/runner/flutter_window.cpp/.h"
    click AWin3 "https://github.com/studcroc/blissful_backdrop/blob/master/windows/runner/utils.cpp/.h"
    click AWin4 "https://github.com/studcroc/blissful_backdrop/blob/master/windows/flutter/generated_plugin_registrant.cc/.h"
    click WinAPI "https://github.com/studcroc/blissful_backdrop/blob/master/windows/runner/win32_window.cpp/.h"
    click LinAPI "https://github.com/studcroc/blissful_backdrop/blob/master/linux/my_application.cc/.h"
    click MacAPI "https://github.com/studcroc/blissful_backdrop/blob/master/macos/Runner/AppDelegate.swift"
    click PubYAML "https://github.com/studcroc/blissful_backdrop/blob/master/pubspec.yaml"
    click PubLock "https://github.com/studcroc/blissful_backdrop/blob/master/pubspec.lock"
    click AG1 "https://github.com/studcroc/blissful_backdrop/blob/master/android/app/build.gradle"
    click AG2 "https://github.com/studcroc/blissful_backdrop/tree/master/android/gradle/"
    click IOS1 "https://github.com/studcroc/blissful_backdrop/tree/master/ios/Runner.xcodeproj/"
    click IOS2 "https://github.com/studcroc/blissful_backdrop/tree/master/ios/Runner.xcworkspace/"
    click IOS3 "https://github.com/studcroc/blissful_backdrop/blob/master/ios/Flutter/Debug.xcconfig"
    click LCM1 "https://github.com/studcroc/blissful_backdrop/blob/master/linux/CMakeLists.txt"
    click LCM2 "https://github.com/studcroc/blissful_backdrop/blob/master/linux/flutter/generated_plugins.cmake"
    click MCM1 "https://github.com/studcroc/blissful_backdrop/tree/master/macos/Runner.xcodeproj/"
    click MCM2 "https://github.com/studcroc/blissful_backdrop/blob/master/macos/Runner/Configs/*.xcconfig"
    click WCM1 "https://github.com/studcroc/blissful_backdrop/blob/master/windows/CMakeLists.txt"
    click WCM2 "https://github.com/studcroc/blissful_backdrop/blob/master/windows/runner/CMakeLists.txt"
    click WCM3 "https://github.com/studcroc/blissful_backdrop/blob/master/installers/installer.iss"
    click WCM4 "https://github.com/studcroc/blissful_backdrop/blob/master/installers/blissful_backdrop.exe"
    click WS1 "https://github.com/studcroc/blissful_backdrop/blob/master/web/index.html"
    click WS2 "https://github.com/studcroc/blissful_backdrop/blob/master/web/manifest.json"
    click WS3 "https://github.com/studcroc/blissful_backdrop/tree/master/web/icons/"

    %% Styles
    classDef dart fill:#AED6F1,stroke:#2E86C1,color:#1B4F72
    classDef external fill:#ABEBC6,stroke:#229954,color:#1D8348
    classDef native fill:#F5B041,stroke:#B9770E,color:#7E5109
    classDef os fill:#D5DBDB,stroke:#566573,color:#2C3E50
    classDef pack fill:#D7BDE2,stroke:#8E44AD,color:#4A235A
```
