# akanosz2/skygarden architecture

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

- Interactive diagram: https://gitdiagram.com/akanosz2/skygarden
- Repository: https://github.com/akanosz2/skygarden

## Overview

SkyGarden is a web app for Hypixel SkyBlock farming: players fetch a profile to inspect farming stats and fortune, while a separate greenhouse planner and crop-rate panel support layout planning. The profile workflow runs from the profile page through shared player state and the server API into a stats pipeline that queries Mojang/Hypixel and computes derived statistics. README documents API credentials; the source index shows a Discord token and server integrations, but does not establish their runtime flow. Several feature branches are mapped from documented routes and module structure; unsampled links are omitted where call ownership is unclear.

Main entry points: [`src/features/playerStats/pipeline.ts`](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/pipeline.ts) (Profile pipeline), [`src/pages/Leaderboard.tsx`](https://github.com/akanosz2/skygarden/blob/main/src/pages/Leaderboard.tsx) (Farm leaderboard), [`server.ts`](https://github.com/akanosz2/skygarden/blob/main/server.ts) (API server), [`src/App.tsx`](https://github.com/akanosz2/skygarden/blob/main/src/App.tsx) (Route app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_app["Route app<br/>[App.tsx]"]
  node_profile["Profile view<br/>[Profile.tsx]"]
  node_state["Player state"]
  node_hook["Player data hook<br/>[usePlayerData.ts]"]
  node_leaderboard["Farm leaderboard<br/>[Leaderboard.tsx]"]
end

subgraph group_player["Player stats"]
  node_pipeline["Profile pipeline<br/>[pipeline.ts]"]
  node_inventory["Inventory decode<br/>[inventory.ts]"]
  node_nbt["NBT decoder<br/>[decode.ts]"]
  node_farming["Farming stats<br/>[farming.ts]"]
  node_misc["Misc stats<br/>[misc.ts]"]
  node_pets["Pet stats<br/>[pets.ts]"]
  node_crops["Crop stats<br/>[crops.ts]"]
  node_fortune["Fortune calculation<br/>[calculate.ts]"]
  node_itemdata["Item metadata<br/>[itemData.ts]"]
end

subgraph group_garden["Garden planning"]
  node_ratepanel["Crop rates<br/>[RatesPanel.tsx]"]
  node_cropdata["Crop catalog<br/>[CropData.ts]"]
  node_greenhouse["Greenhouse planner<br/>[Greenhouse.tsx]"]
  node_grid["Greenhouse grid<br/>[GridLayout.tsx]"]
  node_cropinputs["Crop inputs<br/>[InputCrops.tsx]"]
  node_cropcalc["Crop calculator<br/>[InputCrops.tsx]"]
  node_cropstats["Crop stats<br/>[Stats.tsx]"]
end

subgraph group_services["Data services"]
  node_api["API server<br/>[server.ts]"]
  node_mojang["Mojang lookup<br/>[mojang.ts]"]
  node_hypixel["Hypixel API<br/>[hypixel.ts]"]
  node_prices["Item pricing<br/>[index.ts]"]
  node_bazaar["Bazaar prices<br/>[bazaar.ts]"]
  node_cache[("Response cache<br/>[cache.ts]")]
end

node_player(("Player"))
node_hypixelservice["Hypixel service"]
node_mojangservice["Mojang service"]

node_player -->|"opens"| node_app
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_leaderboard
node_profile -->|"reads state"| node_state
node_state -->|"creates"| node_hook
node_hook -->|"fetches player"| node_api
node_api -->|"loads profile"| node_pipeline
node_pipeline -->|"resolves name"| node_mojang
node_pipeline -->|"fetches profiles"| node_hypixel
node_hypixel -->|"requests data"| node_hypixelservice
node_mojang -->|"resolves UUID"| node_mojangservice
node_pipeline -->|"extracts items"| node_inventory
node_pipeline -->|"decodes backpack"| node_nbt
node_pipeline -->|"computes levels"| node_farming
node_pipeline -->|"computes bonuses"| node_misc
node_pipeline -->|"loads pets"| node_pets
node_pipeline -->|"computes crop data"| node_crops
node_pipeline -->|"calculates fortune"| node_fortune
node_inventory -->|"decodes data"| node_nbt
node_fortune -->|"uses metadata"| node_itemdata
node_misc -->|"uses metadata"| node_itemdata
node_pets -->|"uses metadata"| node_itemdata
node_leaderboard -->|"renders"| node_ratepanel
node_leaderboard -->|"renders"| node_cropcalc
node_leaderboard -->|"renders"| node_cropstats
node_ratepanel -->|"formats crops"| node_cropdata
node_greenhouse -->|"renders"| node_grid
node_greenhouse -->|"renders"| node_cropinputs
node_cropinputs -->|"uses crop data"| node_cropdata
node_cropcalc -->|"uses crop data"| node_cropdata
node_cropstats -->|"uses player stats"| node_pipeline
node_api -->|"serves prices"| node_prices
node_prices -->|"queries bazaar"| node_bazaar
node_api -.->|"uses cache"| node_cache

click node_app "https://github.com/akanosz2/skygarden/blob/main/src/App.tsx"
click node_profile "https://github.com/akanosz2/skygarden/blob/main/src/pages/Profile.tsx"
click node_state "https://github.com/akanosz2/skygarden/blob/main/src/context/PlayerDataContext.tsx"
click node_hook "https://github.com/akanosz2/skygarden/blob/main/src/hooks/usePlayerData.ts"
click node_leaderboard "https://github.com/akanosz2/skygarden/blob/main/src/pages/Leaderboard.tsx"
click node_ratepanel "https://github.com/akanosz2/skygarden/blob/main/src/components/leaderboard/RatesPanel.tsx"
click node_cropdata "https://github.com/akanosz2/skygarden/blob/main/src/components/shared/CropData.ts"
click node_greenhouse "https://github.com/akanosz2/skygarden/blob/main/src/pages/Greenhouse.tsx"
click node_grid "https://github.com/akanosz2/skygarden/blob/main/src/features/greenhouse/components/GridLayout.tsx"
click node_cropinputs "https://github.com/akanosz2/skygarden/blob/main/src/features/greenhouse/components/InputCrops.tsx"
click node_cropcalc "https://github.com/akanosz2/skygarden/blob/main/src/components/calculator/InputCrops.tsx"
click node_cropstats "https://github.com/akanosz2/skygarden/blob/main/src/components/calculator/Stats.tsx"
click node_api "https://github.com/akanosz2/skygarden/blob/main/server.ts"
click node_pipeline "https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/pipeline.ts"
click node_mojang "https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/services/mojang.ts"
click node_hypixel "https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/services/hypixel.ts"
click node_inventory "https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/utils/inventory.ts"
click node_nbt "https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/utils/decode.ts"
click node_farming "https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/stats/farming.ts"
click node_misc "https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/stats/misc.ts"
click node_pets "https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/stats/pets.ts"
click node_crops "https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/stats/crops.ts"
click node_fortune "https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/fortune/calculate.ts"
click node_itemdata "https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/data/itemData.ts"
click node_prices "https://github.com/akanosz2/skygarden/blob/main/src/features/itemPrices/index.ts"
click node_bazaar "https://github.com/akanosz2/skygarden/blob/main/src/features/itemPrices/services/bazaar.ts"
click node_cache "https://github.com/akanosz2/skygarden/blob/main/src/cache/cache.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_profile,node_state,node_hook,node_leaderboard toneBlue
class node_pipeline,node_inventory,node_nbt,node_farming,node_misc,node_pets,node_crops,node_fortune,node_itemdata toneAmber
class node_ratepanel,node_cropdata,node_greenhouse,node_grid,node_cropinputs,node_cropcalc,node_cropstats toneMint
class node_api,node_mojang,node_hypixel,node_prices,node_bazaar,node_cache toneRose
class node_player,node_hypixelservice,node_mojangservice toneIndigo
```

## Components

### Web app

- [Route app](https://github.com/akanosz2/skygarden/blob/main/src/App.tsx): `src/App.tsx`
- [Profile view](https://github.com/akanosz2/skygarden/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [Player state](https://github.com/akanosz2/skygarden/blob/main/src/context/PlayerDataContext.tsx): `src/context/PlayerDataContext.tsx`
- [Player data hook](https://github.com/akanosz2/skygarden/blob/main/src/hooks/usePlayerData.ts): `src/hooks/usePlayerData.ts`
- [Farm leaderboard](https://github.com/akanosz2/skygarden/blob/main/src/pages/Leaderboard.tsx): `src/pages/Leaderboard.tsx`

### Player stats

- [Profile pipeline](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/pipeline.ts): `src/features/playerStats/pipeline.ts`
- [Inventory decode](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/utils/inventory.ts): `src/features/playerStats/utils/inventory.ts`
- [NBT decoder](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/utils/decode.ts): `src/features/playerStats/utils/decode.ts`
- [Farming stats](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/stats/farming.ts): `src/features/playerStats/stats/farming.ts`
- [Misc stats](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/stats/misc.ts): `src/features/playerStats/stats/misc.ts`
- [Pet stats](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/stats/pets.ts): `src/features/playerStats/stats/pets.ts`
- [Crop stats](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/stats/crops.ts): `src/features/playerStats/stats/crops.ts`
- [Fortune calculation](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/fortune/calculate.ts): `src/features/playerStats/fortune/calculate.ts`
- [Item metadata](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/data/itemData.ts): `src/features/playerStats/data/itemData.ts`

### Garden planning

- [Crop rates](https://github.com/akanosz2/skygarden/blob/main/src/components/leaderboard/RatesPanel.tsx): `src/components/leaderboard/RatesPanel.tsx`
- [Crop catalog](https://github.com/akanosz2/skygarden/blob/main/src/components/shared/CropData.ts): `src/components/shared/CropData.ts`
- [Greenhouse planner](https://github.com/akanosz2/skygarden/blob/main/src/pages/Greenhouse.tsx): `src/pages/Greenhouse.tsx`
- [Greenhouse grid](https://github.com/akanosz2/skygarden/blob/main/src/features/greenhouse/components/GridLayout.tsx): `src/features/greenhouse/components/GridLayout.tsx`
- [Crop inputs](https://github.com/akanosz2/skygarden/blob/main/src/features/greenhouse/components/InputCrops.tsx): `src/features/greenhouse/components/InputCrops.tsx`
- [Crop calculator](https://github.com/akanosz2/skygarden/blob/main/src/components/calculator/InputCrops.tsx): `src/components/calculator/InputCrops.tsx`
- [Crop stats](https://github.com/akanosz2/skygarden/blob/main/src/components/calculator/Stats.tsx): `src/components/calculator/Stats.tsx`

### Data services

- [API server](https://github.com/akanosz2/skygarden/blob/main/server.ts): `server.ts`
- [Mojang lookup](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/services/mojang.ts): `src/features/playerStats/services/mojang.ts`
- [Hypixel API](https://github.com/akanosz2/skygarden/blob/main/src/features/playerStats/services/hypixel.ts): `src/features/playerStats/services/hypixel.ts`
- [Item pricing](https://github.com/akanosz2/skygarden/blob/main/src/features/itemPrices/index.ts): `src/features/itemPrices/index.ts`
- [Bazaar prices](https://github.com/akanosz2/skygarden/blob/main/src/features/itemPrices/services/bazaar.ts): `src/features/itemPrices/services/bazaar.ts`
- [Response cache](https://github.com/akanosz2/skygarden/blob/main/src/cache/cache.ts): `src/cache/cache.ts`

### Other components

- **Player**
- **Hypixel service**
- **Mojang service**

## Connections

- Player → Route app: opens (evidence: `src/App.tsx`)
- Route app → Profile view: routes to (evidence: `src/App.tsx`)
- Route app → Farm leaderboard: routes to (evidence: `src/App.tsx`)
- Profile view → Player state: reads state (evidence: `src/pages/Profile.tsx`)
- Player state → Player data hook: creates (evidence: `src/context/PlayerDataContext.tsx`)
- Player data hook → API server: fetches player (evidence: `src/hooks/usePlayerData.ts`)
- API server → Profile pipeline: loads profile (evidence: `server.ts`)
- Profile pipeline → Mojang lookup: resolves name (evidence: `src/features/playerStats/pipeline.ts`)
- Profile pipeline → Hypixel API: fetches profiles (evidence: `src/features/playerStats/pipeline.ts`)
- Hypixel API → Hypixel service: requests data (evidence: `src/features/playerStats/services/hypixel.ts`)
- Mojang lookup → Mojang service: resolves UUID (evidence: `src/features/playerStats/services/mojang.ts`)
- Profile pipeline → Inventory decode: extracts items (evidence: `src/features/playerStats/pipeline.ts`)
- Profile pipeline → NBT decoder: decodes backpack (evidence: `src/features/playerStats/pipeline.ts`)
- Profile pipeline → Farming stats: computes levels (evidence: `src/features/playerStats/pipeline.ts`)
- Profile pipeline → Misc stats: computes bonuses (evidence: `src/features/playerStats/pipeline.ts`)
- Profile pipeline → Pet stats: loads pets (evidence: `src/features/playerStats/pipeline.ts`)
- Profile pipeline → Crop stats: computes crop data (evidence: `src/features/playerStats/pipeline.ts`)
- Profile pipeline → Fortune calculation: calculates fortune (evidence: `src/features/playerStats/pipeline.ts`)
- Inventory decode → NBT decoder: decodes data (evidence: `src/features/playerStats/utils/inventory.ts`)
- Fortune calculation → Item metadata: uses metadata (evidence: `src/features/playerStats/fortune/calculate.ts`)
- Misc stats → Item metadata: uses metadata (evidence: `src/features/playerStats/stats/misc.ts`)
- Pet stats → Item metadata: uses metadata (evidence: `src/features/playerStats/stats/pets.ts`)
- Farm leaderboard → Crop rates: renders (evidence: `src/pages/Leaderboard.tsx`)
- Farm leaderboard → Crop calculator: renders (evidence: `src/pages/Leaderboard.tsx`)
- Farm leaderboard → Crop stats: renders (evidence: `src/pages/Leaderboard.tsx`)
- Crop rates → Crop catalog: formats crops (evidence: `src/components/leaderboard/RatesPanel.tsx`)
- Greenhouse planner → Greenhouse grid: renders (evidence: `src/pages/Greenhouse.tsx`)
- Greenhouse planner → Crop inputs: renders (evidence: `src/pages/Greenhouse.tsx`)
- Crop inputs → Crop catalog: uses crop data (evidence: `src/features/greenhouse/components/InputCrops.tsx`)
- Crop calculator → Crop catalog: uses crop data (evidence: `src/components/calculator/InputCrops.tsx`)
- Crop stats → Profile pipeline: uses player stats (evidence: `src/components/calculator/Stats.tsx`)
- API server → Item pricing: serves prices (evidence: `server.ts`)
- Item pricing → Bazaar prices: queries bazaar (evidence: `src/features/itemPrices/index.ts`)
- API server → Response cache: uses cache (evidence: `server.ts`)
