# 6gdav/hangingtree architecture

> Architecture diagram of the GitHub repository 6gdav/hangingtree, 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/6gdav/hangingtree
- Repository: https://github.com/6gdav/hangingtree

## Overview

HangingTree is a small browser-based Hangman game. The player opens the game page, submits individual letter guesses or a full-word guess, and sees the word and hangman state update; winning or reaching the error limit triggers a reset. The game logic and presentation are together in one route component, which uses static images for the hangman states. The sampled source shows no backend or persistent storage.

Main entry points: [`src/routes/+page.svelte`](https://github.com/6gdav/hangingtree/blob/main/src/routes/%2Bpage.svelte) (Hangman Game), [`src/routes/+layout.svelte`](https://github.com/6gdav/hangingtree/blob/main/src/routes/%2Blayout.svelte) (App Layout), [`static/hangman_states`](https://github.com/6gdav/hangingtree/tree/main/static/hangman_states) (Hangman States)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["App Routes"]
  node_layout["App Layout<br/>[+layout.svelte]"]
  node_game["Hangman Game<br/>[+page.svelte]"]
  node_error["Error Page<br/>[+error.svelte]"]
end

subgraph group_assets["Game Assets"]
  node_hangman_images["Hangman States"]
end

node_player(("Player"))

node_player -->|"opens app"| node_layout
node_layout -->|"renders route"| node_game
node_player -->|"submits guesses"| node_game
node_game -->|"loads state image"| node_hangman_images

click node_layout "https://github.com/6gdav/hangingtree/blob/main/src/routes/%2Blayout.svelte"
click node_game "https://github.com/6gdav/hangingtree/blob/main/src/routes/%2Bpage.svelte"
click node_error "https://github.com/6gdav/hangingtree/blob/main/src/routes/%2Berror.svelte"
click node_hangman_images "https://github.com/6gdav/hangingtree/tree/main/static/hangman_states"

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_layout,node_game,node_error toneBlue
class node_hangman_images toneAmber
class node_player toneIndigo
```

## Components

### App Routes

- [App Layout](https://github.com/6gdav/hangingtree/blob/main/src/routes/%2Blayout.svelte): `src/routes/+layout.svelte`
- [Hangman Game](https://github.com/6gdav/hangingtree/blob/main/src/routes/%2Bpage.svelte): `src/routes/+page.svelte`
- [Error Page](https://github.com/6gdav/hangingtree/blob/main/src/routes/%2Berror.svelte): `src/routes/+error.svelte`

### Game Assets

- [Hangman States](https://github.com/6gdav/hangingtree/tree/main/static/hangman_states): `static/hangman_states`

### Other components

- **Player**

## Connections

- Player → App Layout: opens app
- App Layout → Hangman Game: renders route
- Player → Hangman Game: submits guesses
- Hangman Game → Hangman States: loads state image
