# thedogecraft/sparkle architecture

> Architecture diagram of the GitHub repository thedogecraft/sparkle, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thedogecraft/sparkle
- Repository: https://github.com/thedogecraft/sparkle

## Overview

Sparkle is a Windows desktop optimizer. Users navigate its dashboard to inspect system information, then choose tools to apply/revert tweaks, debloat, clean files, manage DNS, install apps, run utilities, or create/restore backups. The React renderer communicates with Electron’s main process through the preload IPC bridge; main-process handlers perform system operations and PowerShell execution. The README documents capabilities not represented in sampled source; their module paths are supported by the tree, but unsampled page-to-handler calls are not asserted here.

Main entry points: [`src/renderer/src/App.tsx`](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/App.tsx) (App router), [`src/main/index.ts`](https://github.com/thedogecraft/sparkle/blob/v2/src/main/index.ts) (Main process), [`src/main/tweakHandler.ts`](https://github.com/thedogecraft/sparkle/blob/v2/src/main/tweakHandler.ts) (Tweak engine), [`src/preload/index.ts`](https://github.com/thedogecraft/sparkle/blob/v2/src/preload/index.ts) (IPC bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["App router<br/>[App.tsx]"]
  node_home["System dashboard<br/>[Home.tsx]"]
  node_tweaks["Tweak controls<br/>[Tweaks.tsx]"]
  node_debloat["Debloat controls<br/>[Debloat.tsx]"]
  node_clean["Cleaner controls<br/>[Clean.tsx]"]
  node_backup["Backup controls<br/>[Backup.tsx]"]
  node_utilities["System utilities<br/>[Utilities.tsx]"]
  node_dns["DNS controls<br/>[DNS.tsx]"]
  node_apps["App installer<br/>[Apps.tsx]"]
  node_settings["Settings<br/>[Settings.tsx]"]
  node_updater["Update manager<br/>[updatemanager.tsx]"]
end

subgraph group_runtime["Electron runtime"]
  node_preload["IPC bridge<br/>[index.ts]"]
  node_main["Main process<br/>[index.ts]"]
  node_powershell["PowerShell runner<br/>[powershell.ts]"]
  node_updates["Auto updater<br/>[updates.ts]"]
end

subgraph group_optimization["Optimization tools"]
  node_system["System information<br/>[system.ts]"]
  node_tweakhandler["Tweak engine<br/>[tweakHandler.ts]"]
  node_gpu["GPU detection<br/>[gpu.ts]"]
  node_debloathandler["Debloat engine<br/>[debloat.ts]"]
end

subgraph group_maintenance["PC maintenance"]
  node_cleanerhandler["Cleaner engine<br/>[cleaner.ts]"]
  node_backuphandler["Restore points<br/>[backup.ts]"]
  node_dnshandler["DNS manager<br/>[dnsHandler.ts]"]
end

node_user(("Windows user"))
node_windows["Windows system"]
node_winget["Winget / Chocolatey"]

node_user -->|"uses"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_tweaks
node_app -->|"routes"| node_debloat
node_app -->|"routes"| node_clean
node_app -->|"routes"| node_backup
node_app -->|"routes"| node_utilities
node_app -->|"routes"| node_dns
node_app -->|"routes"| node_apps
node_app -->|"routes"| node_settings
node_app -->|"renders"| node_updater
node_app -->|"IPC requests"| node_preload
node_preload -->|"dispatches IPC"| node_main
node_main -->|"registers handlers"| node_system
node_main -->|"registers handlers"| node_tweakhandler
node_main -->|"registers handlers"| node_debloathandler
node_main -->|"registers handlers"| node_cleanerhandler
node_main -->|"registers handlers"| node_backuphandler
node_main -->|"registers handlers"| node_dnshandler
node_main -->|"initializes"| node_updates
node_apps -->|"checks Winget"| node_preload
node_apps -.->|"requests installs"| node_winget
node_tweakhandler -->|"detects GPU"| node_gpu
node_tweakhandler -->|"runs scripts"| node_powershell
node_dnshandler -->|"runs scripts"| node_powershell
node_system -->|"reads system data"| node_windows
node_tweakhandler -->|"applies tweaks"| node_windows
node_debloathandler -->|"debloats"| node_windows
node_cleanerhandler -->|"cleans files"| node_windows
node_backuphandler -->|"creates / restores"| node_windows
node_dnshandler -->|"configures DNS"| node_windows
node_updater -->|"requests update"| node_preload
node_updates -->|"downloads update"| node_windows

click node_app "https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/App.tsx"
click node_home "https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Home.tsx"
click node_tweaks "https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Tweaks.tsx"
click node_debloat "https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Debloat.tsx"
click node_clean "https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Clean.tsx"
click node_backup "https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Backup.tsx"
click node_utilities "https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Utilities.tsx"
click node_dns "https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/DNS.tsx"
click node_apps "https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Apps.tsx"
click node_settings "https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Settings.tsx"
click node_updater "https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/components/updatemanager.tsx"
click node_preload "https://github.com/thedogecraft/sparkle/blob/v2/src/preload/index.ts"
click node_main "https://github.com/thedogecraft/sparkle/blob/v2/src/main/index.ts"
click node_system "https://github.com/thedogecraft/sparkle/blob/v2/src/main/system.ts"
click node_tweakhandler "https://github.com/thedogecraft/sparkle/blob/v2/src/main/tweakHandler.ts"
click node_gpu "https://github.com/thedogecraft/sparkle/blob/v2/src/main/gpu.ts"
click node_debloathandler "https://github.com/thedogecraft/sparkle/blob/v2/src/main/debloat.ts"
click node_cleanerhandler "https://github.com/thedogecraft/sparkle/blob/v2/src/main/cleaner.ts"
click node_backuphandler "https://github.com/thedogecraft/sparkle/blob/v2/src/main/backup.ts"
click node_dnshandler "https://github.com/thedogecraft/sparkle/blob/v2/src/main/dnsHandler.ts"
click node_powershell "https://github.com/thedogecraft/sparkle/blob/v2/src/main/powershell.ts"
click node_updates "https://github.com/thedogecraft/sparkle/blob/v2/src/main/updates.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_home,node_tweaks,node_debloat,node_clean,node_backup,node_utilities,node_dns,node_apps,node_settings,node_updater,node_user toneBlue
class node_preload,node_main,node_powershell,node_updates toneAmber
class node_system,node_tweakhandler,node_gpu,node_debloathandler toneMint
class node_cleanerhandler,node_backuphandler,node_dnshandler toneRose
class node_windows,node_winget toneIndigo
```

## Components

### Desktop interface

- [App router](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/App.tsx): `src/renderer/src/App.tsx`
- [System dashboard](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Home.tsx): `src/renderer/src/pages/Home.tsx`
- [Tweak controls](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Tweaks.tsx): `src/renderer/src/pages/Tweaks.tsx`
- [Debloat controls](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Debloat.tsx): `src/renderer/src/pages/Debloat.tsx`
- [Cleaner controls](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Clean.tsx): `src/renderer/src/pages/Clean.tsx`
- [Backup controls](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Backup.tsx): `src/renderer/src/pages/Backup.tsx`
- [System utilities](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Utilities.tsx): `src/renderer/src/pages/Utilities.tsx`
- [DNS controls](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/DNS.tsx): `src/renderer/src/pages/DNS.tsx`
- [App installer](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Apps.tsx): `src/renderer/src/pages/Apps.tsx`
- [Settings](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/pages/Settings.tsx): `src/renderer/src/pages/Settings.tsx`
- [Update manager](https://github.com/thedogecraft/sparkle/blob/v2/src/renderer/src/components/updatemanager.tsx): `src/renderer/src/components/updatemanager.tsx`

### Electron runtime

- [IPC bridge](https://github.com/thedogecraft/sparkle/blob/v2/src/preload/index.ts): `src/preload/index.ts`
- [Main process](https://github.com/thedogecraft/sparkle/blob/v2/src/main/index.ts): `src/main/index.ts`
- [PowerShell runner](https://github.com/thedogecraft/sparkle/blob/v2/src/main/powershell.ts): `src/main/powershell.ts`
- [Auto updater](https://github.com/thedogecraft/sparkle/blob/v2/src/main/updates.ts): `src/main/updates.ts`

### Optimization tools

- [System information](https://github.com/thedogecraft/sparkle/blob/v2/src/main/system.ts): `src/main/system.ts`
- [Tweak engine](https://github.com/thedogecraft/sparkle/blob/v2/src/main/tweakHandler.ts): `src/main/tweakHandler.ts`
- [GPU detection](https://github.com/thedogecraft/sparkle/blob/v2/src/main/gpu.ts): `src/main/gpu.ts`
- [Debloat engine](https://github.com/thedogecraft/sparkle/blob/v2/src/main/debloat.ts): `src/main/debloat.ts`

### PC maintenance

- [Cleaner engine](https://github.com/thedogecraft/sparkle/blob/v2/src/main/cleaner.ts): `src/main/cleaner.ts`
- [Restore points](https://github.com/thedogecraft/sparkle/blob/v2/src/main/backup.ts): `src/main/backup.ts`
- [DNS manager](https://github.com/thedogecraft/sparkle/blob/v2/src/main/dnsHandler.ts): `src/main/dnsHandler.ts`

### Other components

- **Windows user**
- **Windows system**
- **Winget / Chocolatey**

## Connections

- Windows user → App router: uses
- App router → System dashboard: routes
- App router → Tweak controls: routes
- App router → Debloat controls: routes
- App router → Cleaner controls: routes
- App router → Backup controls: routes
- App router → System utilities: routes
- App router → DNS controls: routes
- App router → App installer: routes
- App router → Settings: routes
- App router → Update manager: renders
- App router → IPC bridge: IPC requests
- IPC bridge → Main process: dispatches IPC
- Main process → System information: registers handlers
- Main process → Tweak engine: registers handlers
- Main process → Debloat engine: registers handlers
- Main process → Cleaner engine: registers handlers
- Main process → Restore points: registers handlers
- Main process → DNS manager: registers handlers
- Main process → Auto updater: initializes
- App installer → IPC bridge: checks Winget
- App installer → Winget / Chocolatey: requests installs
- Tweak engine → GPU detection: detects GPU
- Tweak engine → PowerShell runner: runs scripts
- DNS manager → PowerShell runner: runs scripts
- System information → Windows system: reads system data
- Tweak engine → Windows system: applies tweaks
- Debloat engine → Windows system: debloats
- Cleaner engine → Windows system: cleans files
- Restore points → Windows system: creates / restores
- DNS manager → Windows system: configures DNS
- Update manager → IPC bridge: requests update
- Auto updater → Windows system: downloads update
