# mega6453/appiumwizard architecture

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

- Interactive diagram: https://gitdiagram.com/mega6453/appiumwizard
- Repository: https://github.com/mega6453/appiumwizard

## Overview

##### Project Type and Purpose
- This is a monolithic, Windows desktop application built in .NET C# (Windows Forms) that orchestrates mobile‐automation testing.
- It bundles and manages Appium Server (via NodeJS), iOS/Android drivers, device proxies, screen reflection/control, profile management, IPA signing, and more—wrapping a host of external CLI tools in a single UI.

##### File Structure
- Top-level “Appium Wizard” folder: contains all UI forms (e.g., MainScreen, Server Settings, Object Spy) and core business logic (e.g., AndroidMethods.cs, iOSMethods.cs, Database.cs).
- “Resources”: embedded executables (adb, ffmpeg, iOS tools), data folder (appiumwizard.db), server packages (node.zip).
- Config files: NLog.config, app.manifest, .csproj.
- “Plugins Manager”: suggests a plugin-architecture extension point.
- Build/deployment: InnoSetup scripts under ExcludeInInstaller, CI workflows under .github/workflows.

##### README for Additional Insights
- Built-With stack: .NET C# WinForms, NodeJS, Appium (XCUITest, UIAutomator2), go-ios/pymobiledevice3/imobiledevice-net, adb, zsign, FFMpeg, Newtonsoft.Json, RestSharp.
- Core features: multi-server management, device addition, screen reflection, script execution, troubleshooting, plugins.

##### Main Components & Their Relationships
a. Frontend (Windows Forms UI)
- Screens/Forms (MainScreen, Server Settings, Plugins Manager, etc.)
- User actions → BLL calls
b. Business Logic Layer (.NET classes)
- Orchestrator services (AndroidMethods, iOSMethods, AppiumServerSetup, Database.cs)
- Plugin loader
c. Local Data Store
- SQLite file (appiumwizard.db) for storing device lists, server settings, profiles
d. Appium Server Processes
- NodeJS subprocesses managed by AppiumServerSetup (one per port)
- Default Capabilities & CLI args configured per server
e. External CLI Tools & SDKs
- Android: adb.exe, aapt(.exe/2), apksigner.jar, zipalign, ffmpeg for screen mirror
- iOS: go-ios tools (iproxy, plistutil, unzip, openssl, zsign, iOSServerPy.zip)
- pymobiledevice3/imobiledevice-net wrappers invoked from .NET
f. Plugins
- Dynamically installed node/npm modules or .NET assemblies managed via Plugins Manager
g. Automation Scripts (External)
- Clients connect to Appium server endpoints to drive device actions

##### Architectural Patterns & Design Principles
- Monolithic Desktop Orchestrator: single executable coordinating multiple subprocesses
- Facade/Adapter: .NET classes abstract complex CLI calls into simple methods
- Plugin Architecture: extension points for adding new functionality
- Layered Separation: UI → Orchestration layer → Data/storage + External tools

- Frontend (blue rectangle)
- BLL services (green rectangles)
- UI → BLL calls
- BLL → Database for CRUD
- BLL → NodeJS to start/stop servers
- BLL → CLI tools via shell calls
- External scripts → Appium Server (test execution)
c. Technologies on each component:
- “Windows Forms (.NET C#)” on UI
- “NodeJS Appium Server (npm)” on server processes
- “adb, ffmpeg, zsign, iproxy…” on External Tools

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "UI Layer"
        MS["MainScreen\n(Windows Forms)"]:::frontend
        SS["Server Settings\n(Windows Forms)"]:::frontend
        PM["Plugins Manager\n(Windows Forms)"]:::frontend
        OS["Object Spy\n(Windows Forms)"]:::frontend
        DI["Device Information\n(Windows Forms)"]:::frontend
    end

    subgraph "Business Logic Layer"
        AM["AndroidMethods Service"]:::bll
        IM["iOSMethods Service"]:::bll
        AS["AppiumServerSetup"]:::bll
        DBL["Database Access"]:::bll
        CU["Common Utilities"]:::bll
    end

    subgraph "Data Layer"
        SQL["SQLite Database"]:::db
    end

    subgraph "Appium Server Processes"
        AP["NodeJS/Appium Server"]:::server
    end

    subgraph "External CLI Tools"
        subgraph AndroidTools
            ADB["adb.exe"]:::tool
            AAPT["aapt.exe / aapt2.exe"]:::tool
            APKS["apksigner.jar"]:::tool
            ZIPA["zipalign.exe"]:::tool
        end
        FFM["ffmpeg.exe"]:::tool
        subgraph iOSTools
            IPX["iproxy.exe"]:::tool
            PLST["plistutil.exe"]:::tool
            UNZ["unzip.exe"]:::tool
            OPSL["openssl.exe"]:::tool
            ZP["zip.exe"]:::tool
            ZSN["zsign.exe"]:::tool
            WDA["wda.ipa"]:::tool
            ISPY["iOSServerPy.zip"]:::tool
            ISRV["iOSServer.exe"]:::tool
        end
    end

    subgraph "Plugins"
        Plug["Plugins Loader / Extensions"]:::plugin
    end

    subgraph "Build & CI"
        INS["Installer Script"]:::script
        CIWF["CI/CD Workflows"]:::script
    end

    %% Connections
    MS -->|calls| AM
    MS -->|calls| IM
    MS -->|calls| AS
    MS -->|queries| DBL
    SS -->|reads/writes| DBL
    SS -->|starts/stops| AS
    PM -->|manages| Plug
    CU -->|utilized by| AM
    CU -->|utilized by| IM
    DBL -->|CRUD| SQL
    AS -->|spawns| AP
    AM -->|executes| ADB
    AM -->|executes| AAPT
    AM -->|executes| APKS
    AM -->|executes| ZIPA
    AM -->|executes| FFM
    IM -->|executes| IPX
    IM -->|executes| PLST
    IM -->|executes| UNZ
    IM -->|executes| OPSL
    IM -->|executes| ZP
    IM -->|executes| ZSN
    IM -->|uses| WDA
    IM -->|uses| ISPY
    IM -->|uses| ISRV

    %% Click Events
    click MS "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/MainScreen.cs"
    click SS "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Server Settings.cs"
    click PM "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Plugins Manager.cs"
    click OS "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Object Spy.cs"
    click DI "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/DeviceInformation.cs"
    click AM "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/AndroidMethods.cs"
    click IM "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/iOSMethods.cs"
    click AS "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/AppiumServerSetup.cs"
    click DBL "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Database.cs"
    click CU "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Common.cs"
    click CU "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/CommonProgress.cs"
    click SQL "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/data/appiumwizard.db"
    click AP "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/Server/Backup/node.zip"
    click ADB "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/Executables/adb.exe"
    click AAPT "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/Executables/aapt.exe"
    click AAPT "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/Executables/aapt2.exe"
    click APKS "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/Executables/apksigner.jar"
    click ZIPA "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/Executables/zipalign.exe"
    click FFM "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/Executables/FFMpeg/ffmpeg.exe"
    click IPX "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/Executables/iproxy.exe"
    click PLST "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/Executables/plistutil.exe"
    click UNZ "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/iOS/unzip.exe"
    click OPSL "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/iOS/openssl.exe"
    click ZP "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/iOS/zip.exe"
    click ZSN "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/iOS/zsign.exe"
    click WDA "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/iOS/wda.ipa"
    click ISPY "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/Executables/iOSServerPy.zip"
    click ISRV "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/Resources/Executables/iOSServer.exe"
    click INS "https://github.com/mega6453/appiumwizard/blob/master/Appium Wizard/ExcludeInInstaller/Installer Script.iss"
    click CIWF "https://github.com/mega6453/appiumwizard/blob/master/.github/workflows/main.yml"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085;
    classDef bll fill:#d4edda,stroke:#155724;
    classDef db fill:#fff3cd,stroke:#856404;
    classDef server fill:#e2e3e5,stroke:#6c757d;
    classDef tool fill:#f5c6cb,stroke:#721c24;
    classDef plugin fill:#d1ecf1,stroke:#0c5460,stroke-dasharray:5 5;
    classDef script fill:#f8d7da,stroke:#721c24;
```
