# tonymcsauce/dry-season architecture

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

- Interactive diagram: https://gitdiagram.com/tonymcsauce/dry-season
- Repository: https://github.com/tonymcsauce/dry-season

## Overview

Dry Season is an offline-capable web app for logging drinks and estimating when alcohol will clear. The main flow is drink and round entry, round/session management, BAC simulation, then status and visual feedback. The README also documents late logging, stash and catch-up, history, help/settings, and animated visualizations. Source excerpts establish the model and selected rendering relationships; UI wiring for other capabilities is documented but not sampled, so those edges cite the README.

Main entry points: [`index.html`](https://github.com/tonymcsauce/dry-season/blob/main/index.html) (Main app), [`night.js`](https://github.com/tonymcsauce/dry-season/blob/main/night.js) (Night and rounds), [`sw.js`](https://github.com/tonymcsauce/dry-season/blob/main/sw.js) (Offline app cache), [`model.js`](https://github.com/tonymcsauce/dry-season/blob/main/model.js) (BAC estimate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_logging["Drink Logging"]
  node_catalog["Drink catalog<br/>[drinks.js]"]
  node_roundentry["Round time dial<br/>[dial.js]"]
end

subgraph group_domain["Night And Model"]
  node_night["Night and rounds<br/>[night.js]"]
  node_model["BAC estimate<br/>[model.js]"]
  node_history[("Night history<br/>[night.js]")]
end

subgraph group_display["Status And Visuals"]
  node_horizon["BAC horizon<br/>[horizon.js]"]
  node_scene["3D hero scene<br/>[scene3d.js]"]
  node_island["Live island<br/>[island.js]"]
  node_mug["Island mug<br/>[mug.js]"]
end

subgraph group_app["App Experience"]
  node_page["Main app<br/>[index.html]"]
  node_help["Help and settings<br/>[index.html]"]
end

subgraph group_offline["Offline Support"]
  node_offline[("Offline app cache<br/>[sw.js]")]
  node_version["App version<br/>[version.js]"]
end

node_person(("App user"))
node_browser["Web browser"]

node_person -->|"opens and logs"| node_page
node_page -->|"offers drinks"| node_catalog
node_page -->|"sets round times"| node_roundentry
node_page -->|"records rounds"| node_night
node_night -->|"simulates rounds"| node_model
node_page -.->|"shows estimate"| node_model
node_page -->|"renders BAC hills"| node_horizon
node_horizon -->|"reads BAC values"| node_model
node_page -->|"renders 3D hero"| node_scene
node_page -->|"shows live island"| node_island
node_island -->|"draws mug"| node_mug
node_page -->|"opens help and settings"| node_help
node_night -->|"archives nights"| node_history
node_browser -->|"loads cached app"| node_offline
node_offline -->|"names cache"| node_version
node_page -->|"works offline"| node_offline

click node_page "https://github.com/tonymcsauce/dry-season/blob/main/index.html"
click node_catalog "https://github.com/tonymcsauce/dry-season/blob/main/drinks.js"
click node_roundentry "https://github.com/tonymcsauce/dry-season/blob/main/dial.js"
click node_night "https://github.com/tonymcsauce/dry-season/blob/main/night.js"
click node_model "https://github.com/tonymcsauce/dry-season/blob/main/model.js"
click node_horizon "https://github.com/tonymcsauce/dry-season/blob/main/horizon.js"
click node_scene "https://github.com/tonymcsauce/dry-season/blob/main/scene3d.js"
click node_island "https://github.com/tonymcsauce/dry-season/blob/main/island.js"
click node_mug "https://github.com/tonymcsauce/dry-season/blob/main/mug.js"
click node_help "https://github.com/tonymcsauce/dry-season/blob/main/index.html"
click node_history "https://github.com/tonymcsauce/dry-season/blob/main/night.js"
click node_offline "https://github.com/tonymcsauce/dry-season/blob/main/sw.js"
click node_version "https://github.com/tonymcsauce/dry-season/blob/main/version.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_catalog,node_roundentry,node_person,node_browser toneBlue
class node_night,node_model,node_history toneAmber
class node_horizon,node_scene,node_island,node_mug toneMint
class node_page,node_help toneRose
class node_offline,node_version toneIndigo
```

## Components

### Drink Logging

- [Drink catalog](https://github.com/tonymcsauce/dry-season/blob/main/drinks.js): `drinks.js`
- [Round time dial](https://github.com/tonymcsauce/dry-season/blob/main/dial.js): `dial.js`

### Night And Model

- [Night and rounds](https://github.com/tonymcsauce/dry-season/blob/main/night.js): `night.js`
- [BAC estimate](https://github.com/tonymcsauce/dry-season/blob/main/model.js): `model.js`
- [Night history](https://github.com/tonymcsauce/dry-season/blob/main/night.js): `night.js`

### Status And Visuals

- [BAC horizon](https://github.com/tonymcsauce/dry-season/blob/main/horizon.js): `horizon.js`
- [3D hero scene](https://github.com/tonymcsauce/dry-season/blob/main/scene3d.js): `scene3d.js`
- [Live island](https://github.com/tonymcsauce/dry-season/blob/main/island.js): `island.js`
- [Island mug](https://github.com/tonymcsauce/dry-season/blob/main/mug.js): `mug.js`

### App Experience

- [Main app](https://github.com/tonymcsauce/dry-season/blob/main/index.html): `index.html`
- [Help and settings](https://github.com/tonymcsauce/dry-season/blob/main/index.html): `index.html`

### Offline Support

- [Offline app cache](https://github.com/tonymcsauce/dry-season/blob/main/sw.js): `sw.js`
- [App version](https://github.com/tonymcsauce/dry-season/blob/main/version.js): `version.js`

### Other components

- **App user**
- **Web browser**

## Connections

- App user → Main app: opens and logs (evidence: `README.md`)
- Main app → Drink catalog: offers drinks (evidence: `README.md`)
- Main app → Round time dial: sets round times (evidence: `README.md`)
- Main app → Night and rounds: records rounds (evidence: `README.md`)
- Night and rounds → BAC estimate: simulates rounds (evidence: `night.js`)
- Main app → BAC estimate: shows estimate
- Main app → BAC horizon: renders BAC hills (evidence: `README.md`)
- BAC horizon → BAC estimate: reads BAC values (evidence: `horizon.js`)
- Main app → 3D hero scene: renders 3D hero (evidence: `README.md`)
- Main app → Live island: shows live island (evidence: `README.md`)
- Live island → Island mug: draws mug (evidence: `island.js`)
- Main app → Help and settings: opens help and settings (evidence: `README.md`)
- Night and rounds → Night history: archives nights (evidence: `night.js`)
- Web browser → Offline app cache: loads cached app (evidence: `sw.js`)
- Offline app cache → App version: names cache (evidence: `sw.js`)
- Main app → Offline app cache: works offline (evidence: `README.md`)
