# alex22379/smkid-konsekvenshjulet architecture

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

- Interactive diagram: https://gitdiagram.com/alex22379/smkid-konsekvenshjulet
- Repository: https://github.com/alex22379/smkid-konsekvenshjulet

## Overview

S/M-KIDs Konsekvenshjul is a small client-side consequence wheel for a student council. On startup, its JavaScript fetches consequences from Google Apps Script, falls back to a local JSON list if that fetch fails, shuffles the results, and builds the wheel. A user clicks the wheel to spin it; while spinning, the app updates the displayed consequence and plays a tick sound. The source excerpt shows these runtime links; HTML and styling details are not sampled.

Main entry points: [`frontend/main.js`](https://github.com/alex22379/smkid-konsekvenshjulet/blob/main/frontend/main.js) (Wheel runtime), [`frontend/data/consequences.json`](https://github.com/alex22379/smkid-konsekvenshjulet/blob/main/frontend/data/consequences.json) (Fallback list), [`frontend/assets/tick.wav`](https://github.com/alex22379/smkid-konsekvenshjulet/blob/main/frontend/assets/tick.wav) (Tick sound)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_wheel_app["Consequence wheel"]
  node_wheel["Wheel runtime<br/>[main.js]"]
end

node_user(("User"))
node_remote_list["Apps Script list"]
node_fallback["Fallback list<br/>[consequences.json]"]
node_tick["Tick sound<br/>[tick.wav]"]

node_user -->|"clicks"| node_wheel
node_wheel -->|"fetches list"| node_remote_list
node_wheel -->|"fallback fetch"| node_fallback
node_wheel -->|"loads sound"| node_tick

click node_wheel "https://github.com/alex22379/smkid-konsekvenshjulet/blob/main/frontend/main.js"
click node_fallback "https://github.com/alex22379/smkid-konsekvenshjulet/blob/main/frontend/data/consequences.json"
click node_tick "https://github.com/alex22379/smkid-konsekvenshjulet/blob/main/frontend/assets/tick.wav"

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_wheel,node_user toneBlue
class node_remote_list toneIndigo
class node_fallback,node_tick toneTeal
```

## Components

### Consequence wheel

- [Wheel runtime](https://github.com/alex22379/smkid-konsekvenshjulet/blob/main/frontend/main.js): `frontend/main.js`

### Other components

- **User**
- **Apps Script list**
- [Fallback list](https://github.com/alex22379/smkid-konsekvenshjulet/blob/main/frontend/data/consequences.json): `frontend/data/consequences.json`
- [Tick sound](https://github.com/alex22379/smkid-konsekvenshjulet/blob/main/frontend/assets/tick.wav): `frontend/assets/tick.wav`

## Connections

- User → Wheel runtime: clicks (evidence: `frontend/main.js`)
- Wheel runtime → Apps Script list: fetches list (evidence: `frontend/main.js`)
- Wheel runtime → Fallback list: fallback fetch (evidence: `frontend/main.js`)
- Wheel runtime → Tick sound: loads sound (evidence: `frontend/main.js`)
