# liuziyi20081020/swim-web architecture

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

- Interactive diagram: https://gitdiagram.com/liuziyi20081020/swim-web
- Repository: https://github.com/liuziyi20081020/swim-web

## Overview

This is a browser-based swim-training tracker. Its main workflow records a swimmer’s date, stroke distances, duration, and notes in browser storage, then refreshes best-performance, recent-record, and calendar views. The sampled code shows those refresh calls and the shared storage reads and writes; it does not show the HTML wiring or script loading, so those connections are omitted. The repository has no README, and the HTML and styling were not sampled.

Main entry points: [`training.js`](https://github.com/liuziyi20081020/swim-web/blob/main/training.js) (Training Entry), [`best.js`](https://github.com/liuziyi20081020/swim-web/blob/main/best.js) (Best Records), [`week.js`](https://github.com/liuziyi20081020/swim-web/blob/main/week.js) (Recent Records), [`calendar.js`](https://github.com/liuziyi20081020/swim-web/blob/main/calendar.js) (Calendar View)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Training Records"]
  node_entry["Training Entry<br/>[training.js]"]
end

subgraph group_views["Progress Views"]
  node_best["Best Records<br/>[best.js]"]
  node_recent["Recent Records<br/>[week.js]"]
  node_calendar["Calendar View<br/>[calendar.js]"]
end

subgraph group_persistence["Browser Persistence"]
  node_storage[("Swim Records")]
end

node_shell["Page Shell<br/>[index.html]"]

node_entry -->|"saves records"| node_storage
node_storage -->|"reads records"| node_best
node_storage -->|"reads records"| node_recent
node_storage -->|"reads records"| node_calendar
node_entry -->|"refreshes"| node_best
node_entry -->|"refreshes"| node_recent
node_entry -->|"refreshes"| node_calendar

click node_entry "https://github.com/liuziyi20081020/swim-web/blob/main/training.js"
click node_best "https://github.com/liuziyi20081020/swim-web/blob/main/best.js"
click node_recent "https://github.com/liuziyi20081020/swim-web/blob/main/week.js"
click node_calendar "https://github.com/liuziyi20081020/swim-web/blob/main/calendar.js"
click node_shell "https://github.com/liuziyi20081020/swim-web/blob/main/index.html"

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_entry toneBlue
class node_best,node_recent,node_calendar toneAmber
class node_storage toneMint
class node_shell toneTeal
```

## Components

### Training Records

- [Training Entry](https://github.com/liuziyi20081020/swim-web/blob/main/training.js): `training.js`

### Progress Views

- [Best Records](https://github.com/liuziyi20081020/swim-web/blob/main/best.js): `best.js`
- [Recent Records](https://github.com/liuziyi20081020/swim-web/blob/main/week.js): `week.js`
- [Calendar View](https://github.com/liuziyi20081020/swim-web/blob/main/calendar.js): `calendar.js`

### Browser Persistence

- **Swim Records**

### Other components

- [Page Shell](https://github.com/liuziyi20081020/swim-web/blob/main/index.html): `index.html`

## Connections

- Training Entry → Swim Records: saves records (evidence: `training.js`)
- Swim Records → Best Records: reads records (evidence: `best.js`)
- Swim Records → Recent Records: reads records (evidence: `week.js`)
- Swim Records → Calendar View: reads records (evidence: `calendar.js`)
- Training Entry → Best Records: refreshes (evidence: `training.js`)
- Training Entry → Recent Records: refreshes (evidence: `training.js`)
- Training Entry → Calendar View: refreshes (evidence: `training.js`)
