# alley-dew/backpacking-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/alley-dew/backpacking-calculator
- Repository: https://github.com/alley-dew/backpacking-calculator

## Overview

This is a client-side backpacking preparation app: users select a tool to plan gear weight, meals, or trekking routes. The sampled code shows local state for planning and route browsing, plus browser localStorage for saved gear lists; no backend or external service is evidenced. UI primitives are included as a shared internal layer. The README is only a title, so additional product capabilities and unsampled implementation details are not inferred.

Main entry points: [`components/ui`](https://github.com/alley-dew/backpacking-calculator/tree/main/components/ui) (UI primitives), [`app/page.tsx`](https://github.com/alley-dew/backpacking-calculator/blob/main/app/page.tsx) (Tool selector), [`components/weight-calculator.tsx`](https://github.com/alley-dew/backpacking-calculator/blob/main/components/weight-calculator.tsx) (Gear weight), [`components/food-planner.tsx`](https://github.com/alley-dew/backpacking-calculator/blob/main/components/food-planner.tsx) (Meal planning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_home["Tool selector<br/>[page.tsx]"]
end

subgraph group_planning["Trip planning"]
  node_weight["Gear weight"]
  node_gearstore[("Saved gear lists")]
  node_mealplan["Meal planning<br/>[food-planner.tsx]"]
  node_mealprototype["Basic meal planner<br/>[food-planner.tsx]"]
  node_mealvariant["Meal planner variant<br/>[MealPlanner.tsx]"]
end

subgraph group_routes["Route discovery"]
  node_routesview["Route browsing"]
end

subgraph group_ui["Shared UI"]
  node_primitives["UI primitives"]
  node_utils["Class utilities<br/>[utils.ts]"]
end

node_backpacker(("Backpacker"))

node_backpacker -->|"opens"| node_home
node_home -->|"renders"| node_weight
node_home -->|"renders"| node_mealplan
node_home -->|"renders"| node_routesview
node_weight -->|"reads and writes"| node_gearstore
node_mealplan -->|"uses controls"| node_primitives
node_weight -->|"uses controls"| node_primitives
node_routesview -->|"uses controls"| node_primitives
node_mealprototype -->|"uses controls"| node_primitives
node_mealvariant -->|"uses controls"| node_primitives
node_primitives -->|"merges classes"| node_utils

click node_home "https://github.com/alley-dew/backpacking-calculator/blob/main/app/page.tsx"
click node_weight "https://github.com/alley-dew/backpacking-calculator/blob/main/components/weight-calculator.tsx"
click node_gearstore "https://github.com/alley-dew/backpacking-calculator/blob/main/components/weight-calculator.tsx"
click node_mealplan "https://github.com/alley-dew/backpacking-calculator/blob/main/components/food-planner.tsx"
click node_mealprototype "https://github.com/alley-dew/backpacking-calculator/blob/main/app/components/food-planner.tsx"
click node_mealvariant "https://github.com/alley-dew/backpacking-calculator/blob/main/app/components/MealPlanner.tsx"
click node_routesview "https://github.com/alley-dew/backpacking-calculator/blob/main/components/tracking-routes.tsx"
click node_primitives "https://github.com/alley-dew/backpacking-calculator/tree/main/components/ui"
click node_utils "https://github.com/alley-dew/backpacking-calculator/blob/main/lib/utils.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_home toneBlue
class node_weight,node_gearstore,node_mealplan,node_mealprototype,node_mealvariant toneAmber
class node_routesview toneMint
class node_primitives,node_utils toneRose
class node_backpacker toneIndigo
```

## Components

### App experience

- [Tool selector](https://github.com/alley-dew/backpacking-calculator/blob/main/app/page.tsx): `app/page.tsx`

### Trip planning

- [Gear weight](https://github.com/alley-dew/backpacking-calculator/blob/main/components/weight-calculator.tsx): `components/weight-calculator.tsx`
- [Saved gear lists](https://github.com/alley-dew/backpacking-calculator/blob/main/components/weight-calculator.tsx): `components/weight-calculator.tsx`
- [Meal planning](https://github.com/alley-dew/backpacking-calculator/blob/main/components/food-planner.tsx): `components/food-planner.tsx`
- [Basic meal planner](https://github.com/alley-dew/backpacking-calculator/blob/main/app/components/food-planner.tsx): `app/components/food-planner.tsx`
- [Meal planner variant](https://github.com/alley-dew/backpacking-calculator/blob/main/app/components/MealPlanner.tsx): `app/components/MealPlanner.tsx`

### Route discovery

- [Route browsing](https://github.com/alley-dew/backpacking-calculator/blob/main/components/tracking-routes.tsx): `components/tracking-routes.tsx`

### Shared UI

- [UI primitives](https://github.com/alley-dew/backpacking-calculator/tree/main/components/ui): `components/ui`
- [Class utilities](https://github.com/alley-dew/backpacking-calculator/blob/main/lib/utils.ts): `lib/utils.ts`

### Other components

- **Backpacker**

## Connections

- Backpacker → Tool selector: opens (evidence: `app/page.tsx`)
- Tool selector → Gear weight: renders (evidence: `app/page.tsx`)
- Tool selector → Meal planning: renders (evidence: `app/page.tsx`)
- Tool selector → Route browsing: renders (evidence: `app/page.tsx`)
- Gear weight → Saved gear lists: reads and writes (evidence: `components/weight-calculator.tsx`)
- Meal planning → UI primitives: uses controls (evidence: `components/food-planner.tsx`)
- Gear weight → UI primitives: uses controls (evidence: `components/weight-calculator.tsx`)
- Route browsing → UI primitives: uses controls (evidence: `components/tracking-routes.tsx`)
- Basic meal planner → UI primitives: uses controls (evidence: `app/components/food-planner.tsx`)
- Meal planner variant → UI primitives: uses controls (evidence: `app/components/MealPlanner.tsx`)
- UI primitives → Class utilities: merges classes (evidence: `components/ui/button.tsx`)
