# shea4it/ssks-garden-buddy architecture

> Architecture diagram of the GitHub repository shea4it/ssks-garden-buddy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shea4it/ssks-garden-buddy
- Repository: https://github.com/shea4it/ssks-garden-buddy

## Overview

SSK’s Garden Buddy is an Electron companion for Magic Garden. The user opens the game in the app; the Buddy observes game state and shop/weather data, then presents alerts, garden and pet guidance, money forecasts, luck counters, and room tools in its control panel. The graph keeps the main process as the orchestrator and separates analysis domains from persisted settings and optional integrations. Relationships come from the README and the supplied SOURCE INDEX; unsampled implementation details are not inferred.

Main entry points: [`main.js`](https://github.com/shea4it/ssks-garden-buddy/blob/main/main.js) (App controller), [`garden-plan.js`](https://github.com/shea4it/ssks-garden-buddy/blob/main/garden-plan.js) (Garden map plan), [`pet-plan.js`](https://github.com/shea4it/ssks-garden-buddy/blob/main/pet-plan.js) (Pet team planning), [`pity.js`](https://github.com/shea4it/ssks-garden-buddy/blob/main/pity.js) (Egg hatch counters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_main["App controller<br/>[main.js]"]
  node_panel["Control panel<br/>[control.html]"]
  node_observer["Game observer<br/>[garden-observer.js]"]
  node_settings[("Saved settings<br/>[store.js]")]
end

subgraph group_garden["Garden and money"]
  node_gardenplan["Garden map plan<br/>[garden-plan.js]"]
  node_cropdata["Crop valuation<br/>[crop-data.js]"]
  node_budget["Money forecasts<br/>[budget.js]"]
end

subgraph group_pets["Pets and luck"]
  node_petdata["Pet data<br/>[pet-data.js]"]
  node_abilities["Ability data<br/>[ability-data.js]"]
  node_petplan["Pet team planning<br/>[pet-plan.js]"]
  node_sellteam["Sell team value<br/>[sell-team.js]"]
  node_pity["Egg hatch counters<br/>[pity.js]"]
  node_luck["Rare pull counters<br/>[luck.js]"]
end

subgraph group_extras["Alerts and extras"]
  node_alerts["Shop alerts<br/>[alerts.js]"]
  node_voices["Natural voices<br/>[voices.js]"]
  node_tts["Speech output<br/>[tts.js]"]
  node_weather["Weather helpers<br/>[weather.js]"]
  node_rooms["Room sharing<br/>[rooms.js]"]
  node_backup["Backups<br/>[backup.js]"]
  node_fun["Visual effects<br/>[fun.js]"]
  node_updater["App updates<br/>[updater.js]"]
end

node_user(("Player"))
node_game(("Magic Garden"))
node_shopfeed(("Magic Garden shop feed"))
node_roomservice(("Community room service"))
node_github(("GitHub"))
node_voicehost(("Voice downloads"))

node_user -->|"opens and configures"| node_main
node_game -->|"provides game data"| node_observer
node_main -.->|"observes game"| node_observer
node_main -->|"presents controls"| node_panel
node_main -->|"reads and saves"| node_settings
node_main -->|"coordinates alerts"| node_alerts
node_main -->|"records purchases"| node_budget
node_main -->|"plans garden"| node_gardenplan
node_gardenplan -->|"values crops"| node_cropdata
node_main -->|"plans teams"| node_petplan
node_petplan -->|"uses ability data"| node_abilities
node_main -->|"uses pet catalog"| node_petdata
node_main -->|"values sell teams"| node_sellteam
node_main -->|"tracks hatches"| node_pity
node_pity -->|"uses egg data"| node_petdata
node_main -->|"tracks rare pulls"| node_luck
node_main -->|"checks weather teams"| node_weather
node_main -->|"handles room tools"| node_rooms
node_main -->|"handles backups"| node_backup
node_main -.->|"checks updates"| node_updater
node_main -.->|"runs visual effects"| node_fun
node_alerts -->|"fetches shop data"| node_shopfeed
node_main -.->|"manages voice options"| node_voices
node_voices -->|"downloads voices"| node_voicehost
node_main -.->|"speaks alerts"| node_tts
node_main -->|"reads or shares rooms"| node_roomservice
node_main -->|"checks updates"| node_github

click node_main "https://github.com/shea4it/ssks-garden-buddy/blob/main/main.js"
click node_panel "https://github.com/shea4it/ssks-garden-buddy/blob/main/control.html"
click node_observer "https://github.com/shea4it/ssks-garden-buddy/blob/main/garden-observer.js"
click node_settings "https://github.com/shea4it/ssks-garden-buddy/blob/main/store.js"
click node_gardenplan "https://github.com/shea4it/ssks-garden-buddy/blob/main/garden-plan.js"
click node_cropdata "https://github.com/shea4it/ssks-garden-buddy/blob/main/crop-data.js"
click node_budget "https://github.com/shea4it/ssks-garden-buddy/blob/main/budget.js"
click node_petdata "https://github.com/shea4it/ssks-garden-buddy/blob/main/pet-data.js"
click node_abilities "https://github.com/shea4it/ssks-garden-buddy/blob/main/ability-data.js"
click node_petplan "https://github.com/shea4it/ssks-garden-buddy/blob/main/pet-plan.js"
click node_sellteam "https://github.com/shea4it/ssks-garden-buddy/blob/main/sell-team.js"
click node_pity "https://github.com/shea4it/ssks-garden-buddy/blob/main/pity.js"
click node_luck "https://github.com/shea4it/ssks-garden-buddy/blob/main/luck.js"
click node_alerts "https://github.com/shea4it/ssks-garden-buddy/blob/main/alerts.js"
click node_voices "https://github.com/shea4it/ssks-garden-buddy/blob/main/voices.js"
click node_tts "https://github.com/shea4it/ssks-garden-buddy/blob/main/tts.js"
click node_weather "https://github.com/shea4it/ssks-garden-buddy/blob/main/weather.js"
click node_rooms "https://github.com/shea4it/ssks-garden-buddy/blob/main/rooms.js"
click node_backup "https://github.com/shea4it/ssks-garden-buddy/blob/main/backup.js"
click node_fun "https://github.com/shea4it/ssks-garden-buddy/blob/main/fun.js"
click node_updater "https://github.com/shea4it/ssks-garden-buddy/blob/main/updater.js"

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_main,node_panel,node_observer,node_settings toneBlue
class node_gardenplan,node_cropdata,node_budget toneAmber
class node_petdata,node_abilities,node_petplan,node_sellteam,node_pity,node_luck toneMint
class node_alerts,node_voices,node_tts,node_weather,node_rooms,node_backup,node_fun,node_updater toneRose
class node_user,node_game,node_shopfeed,node_roomservice,node_github,node_voicehost toneIndigo
```

## Components

### App runtime

- [App controller](https://github.com/shea4it/ssks-garden-buddy/blob/main/main.js): `main.js`
- [Control panel](https://github.com/shea4it/ssks-garden-buddy/blob/main/control.html): `control.html`
- [Game observer](https://github.com/shea4it/ssks-garden-buddy/blob/main/garden-observer.js): `garden-observer.js`
- [Saved settings](https://github.com/shea4it/ssks-garden-buddy/blob/main/store.js): `store.js`

### Garden and money

- [Garden map plan](https://github.com/shea4it/ssks-garden-buddy/blob/main/garden-plan.js): `garden-plan.js`
- [Crop valuation](https://github.com/shea4it/ssks-garden-buddy/blob/main/crop-data.js): `crop-data.js`
- [Money forecasts](https://github.com/shea4it/ssks-garden-buddy/blob/main/budget.js): `budget.js`

### Pets and luck

- [Pet data](https://github.com/shea4it/ssks-garden-buddy/blob/main/pet-data.js): `pet-data.js`
- [Ability data](https://github.com/shea4it/ssks-garden-buddy/blob/main/ability-data.js): `ability-data.js`
- [Pet team planning](https://github.com/shea4it/ssks-garden-buddy/blob/main/pet-plan.js): `pet-plan.js`
- [Sell team value](https://github.com/shea4it/ssks-garden-buddy/blob/main/sell-team.js): `sell-team.js`
- [Egg hatch counters](https://github.com/shea4it/ssks-garden-buddy/blob/main/pity.js): `pity.js`
- [Rare pull counters](https://github.com/shea4it/ssks-garden-buddy/blob/main/luck.js): `luck.js`

### Alerts and extras

- [Shop alerts](https://github.com/shea4it/ssks-garden-buddy/blob/main/alerts.js): `alerts.js`
- [Natural voices](https://github.com/shea4it/ssks-garden-buddy/blob/main/voices.js): `voices.js`
- [Speech output](https://github.com/shea4it/ssks-garden-buddy/blob/main/tts.js): `tts.js`
- [Weather helpers](https://github.com/shea4it/ssks-garden-buddy/blob/main/weather.js): `weather.js`
- [Room sharing](https://github.com/shea4it/ssks-garden-buddy/blob/main/rooms.js): `rooms.js`
- [Backups](https://github.com/shea4it/ssks-garden-buddy/blob/main/backup.js): `backup.js`
- [Visual effects](https://github.com/shea4it/ssks-garden-buddy/blob/main/fun.js): `fun.js`
- [App updates](https://github.com/shea4it/ssks-garden-buddy/blob/main/updater.js): `updater.js`

### Other components

- **Player**
- **Magic Garden**
- **Magic Garden shop feed**
- **Community room service**
- **GitHub**
- **Voice downloads**

## Connections

- Player → App controller: opens and configures (evidence: `README.md`)
- Magic Garden → Game observer: provides game data (evidence: `README.md`)
- App controller → Game observer: observes game
- App controller → Control panel: presents controls (evidence: `README.md`)
- App controller → Saved settings: reads and saves (evidence: `main.js`)
- App controller → Shop alerts: coordinates alerts (evidence: `main.js`)
- App controller → Money forecasts: records purchases (evidence: `main.js`)
- App controller → Garden map plan: plans garden (evidence: `main.js`)
- Garden map plan → Crop valuation: values crops (evidence: `garden-plan.js`)
- App controller → Pet team planning: plans teams (evidence: `main.js`)
- Pet team planning → Ability data: uses ability data (evidence: `pet-plan.js`)
- App controller → Pet data: uses pet catalog (evidence: `main.js`)
- App controller → Sell team value: values sell teams (evidence: `main.js`)
- App controller → Egg hatch counters: tracks hatches (evidence: `main.js`)
- Egg hatch counters → Pet data: uses egg data (evidence: `pity.js`)
- App controller → Rare pull counters: tracks rare pulls (evidence: `main.js`)
- App controller → Weather helpers: checks weather teams (evidence: `main.js`)
- App controller → Room sharing: handles room tools (evidence: `main.js`)
- App controller → Backups: handles backups (evidence: `main.js`)
- App controller → App updates: checks updates (evidence: `main.js`)
- App controller → Visual effects: runs visual effects (evidence: `main.js`)
- Shop alerts → Magic Garden shop feed: fetches shop data (evidence: `alerts.js`)
- App controller → Natural voices: manages voice options (evidence: `main.js`)
- Natural voices → Voice downloads: downloads voices (evidence: `README.md`)
- App controller → Speech output: speaks alerts (evidence: `main.js`)
- App controller → Community room service: reads or shares rooms (evidence: `README.md`)
- App controller → GitHub: checks updates (evidence: `README.md`)
