# scott910512-source/shift-pwa architecture

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

- Interactive diagram: https://gitdiagram.com/scott910512-source/shift-pwa
- Repository: https://github.com/scott910512-source/shift-pwa

## Overview

This repository is an offline-capable 4-team rotating-shift schedule, presented as a web PWA and companion Windows wallpaper and iOS widget views. The main user workflow is viewing today’s shifts and calendar, checking team status, editing crew rosters, and managing settings and backups. The web app also publishes notices. Companion views calculate and render the same schedule using crew data; the Windows no-install package pre-renders dated wallpapers. Relationships for unsampled web internals follow README descriptions; source evidence is limited to the excerpts shown.

Main entry points: [`app.js`](https://github.com/scott910512-source/shift-pwa/blob/main/app.js) (Schedule App), [`widget.js`](https://github.com/scott910512-source/shift-pwa/blob/main/widget.js) (Schedule Widget), [`desktop/wallpaper.py`](https://github.com/scott910512-source/shift-pwa/blob/main/desktop/wallpaper.py) (Wallpaper Renderer), [`tools/make-noinstall.py`](https://github.com/scott910512-source/shift-pwa/blob/main/tools/make-noinstall.py) (Offline Pack Generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web PWA"]
  node_webapp["Schedule App<br/>[app.js]"]
  node_schedule["Shift Calendar<br/>[app.js]"]
  node_status["Team Status<br/>[app.js]"]
  node_crewedit["Crew Editor<br/>[app.js]"]
  node_notices["Notices<br/>[app.js]"]
  node_settings["Settings Backup<br/>[app.js]"]
  node_serviceworker["Offline Cache<br/>[sw.js]"]
end

subgraph group_crew["Crew Data"]
  node_browserstore[("Browser Storage")]
  node_crewjson["Published Crews<br/>[crew.json]"]
end

subgraph group_desktop["Windows Wallpaper"]
  node_wallpaper["Wallpaper Renderer<br/>[wallpaper.py]"]
  node_wallpaperfile["Wallpaper Image"]
  node_packgenerator["Offline Pack Generator<br/>[make-noinstall.py]"]
  node_offlinepack["Dated Image Pack"]
end

subgraph group_ios["iOS Widget"]
  node_widgetloader["Widget Loader<br/>[widget-loader.js]"]
  node_widget["Schedule Widget<br/>[widget.js]"]
end

node_user(("Schedule User"))
node_scriptable(("Scriptable"))
node_desktopuser(("Desktop User"))
node_windows(("Windows Desktop"))

node_user -->|"opens"| node_webapp
node_webapp -->|"shows"| node_schedule
node_webapp -->|"shows"| node_status
node_webapp -->|"edits"| node_crewedit
node_webapp -->|"shows"| node_notices
node_webapp -->|"manages"| node_settings
node_crewedit -->|"saves"| node_browserstore
node_settings -->|"backs up"| node_browserstore
node_webapp -.->|"supports offline"| node_serviceworker
node_scriptable -->|"runs"| node_widgetloader
node_widgetloader -->|"fetches and runs"| node_widget
node_widget -->|"fetches"| node_crewjson
node_widget -->|"renders"| node_scriptable
node_desktopuser -->|"runs"| node_wallpaper
node_wallpaper -->|"renders"| node_wallpaperfile
node_wallpaperfile -->|"sets background"| node_windows
node_packgenerator -->|"renders dates with"| node_wallpaper
node_packgenerator -->|"creates"| node_offlinepack
node_offlinepack -->|"sets background"| node_windows

click node_webapp "https://github.com/scott910512-source/shift-pwa/blob/main/app.js"
click node_schedule "https://github.com/scott910512-source/shift-pwa/blob/main/app.js"
click node_status "https://github.com/scott910512-source/shift-pwa/blob/main/app.js"
click node_crewedit "https://github.com/scott910512-source/shift-pwa/blob/main/app.js"
click node_notices "https://github.com/scott910512-source/shift-pwa/blob/main/app.js"
click node_settings "https://github.com/scott910512-source/shift-pwa/blob/main/app.js"
click node_crewjson "https://github.com/scott910512-source/shift-pwa/blob/main/crew.json"
click node_serviceworker "https://github.com/scott910512-source/shift-pwa/blob/main/sw.js"
click node_widgetloader "https://github.com/scott910512-source/shift-pwa/blob/main/widget-loader.js"
click node_widget "https://github.com/scott910512-source/shift-pwa/blob/main/widget.js"
click node_wallpaper "https://github.com/scott910512-source/shift-pwa/blob/main/desktop/wallpaper.py"
click node_packgenerator "https://github.com/scott910512-source/shift-pwa/blob/main/tools/make-noinstall.py"

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_webapp,node_schedule,node_status,node_crewedit,node_notices,node_settings,node_serviceworker,node_user,node_desktopuser toneBlue
class node_browserstore,node_crewjson toneAmber
class node_wallpaper,node_wallpaperfile,node_packgenerator,node_offlinepack toneMint
class node_widgetloader,node_widget toneRose
class node_scriptable,node_windows toneIndigo
```

## Components

### Web PWA

- [Schedule App](https://github.com/scott910512-source/shift-pwa/blob/main/app.js): `app.js`
- [Shift Calendar](https://github.com/scott910512-source/shift-pwa/blob/main/app.js): `app.js`
- [Team Status](https://github.com/scott910512-source/shift-pwa/blob/main/app.js): `app.js`
- [Crew Editor](https://github.com/scott910512-source/shift-pwa/blob/main/app.js): `app.js`
- [Notices](https://github.com/scott910512-source/shift-pwa/blob/main/app.js): `app.js`
- [Settings Backup](https://github.com/scott910512-source/shift-pwa/blob/main/app.js): `app.js`
- [Offline Cache](https://github.com/scott910512-source/shift-pwa/blob/main/sw.js): `sw.js`

### Crew Data

- **Browser Storage**
- [Published Crews](https://github.com/scott910512-source/shift-pwa/blob/main/crew.json): `crew.json`

### Windows Wallpaper

- [Wallpaper Renderer](https://github.com/scott910512-source/shift-pwa/blob/main/desktop/wallpaper.py): `desktop/wallpaper.py`
- **Wallpaper Image**
- [Offline Pack Generator](https://github.com/scott910512-source/shift-pwa/blob/main/tools/make-noinstall.py): `tools/make-noinstall.py`
- **Dated Image Pack**

### iOS Widget

- [Widget Loader](https://github.com/scott910512-source/shift-pwa/blob/main/widget-loader.js): `widget-loader.js`
- [Schedule Widget](https://github.com/scott910512-source/shift-pwa/blob/main/widget.js): `widget.js`

### Other components

- **Schedule User**
- **Scriptable**
- **Desktop User**
- **Windows Desktop**

## Connections

- Schedule User → Schedule App: opens (evidence: `README.md`)
- Schedule App → Shift Calendar: shows (evidence: `README.md`)
- Schedule App → Team Status: shows (evidence: `README.md`)
- Schedule App → Crew Editor: edits (evidence: `README.md`)
- Schedule App → Notices: shows (evidence: `README.md`)
- Schedule App → Settings Backup: manages (evidence: `README.md`)
- Crew Editor → Browser Storage: saves (evidence: `README.md`)
- Settings Backup → Browser Storage: backs up (evidence: `README.md`)
- Schedule App → Offline Cache: supports offline
- Scriptable → Widget Loader: runs (evidence: `widget-loader.js`)
- Widget Loader → Schedule Widget: fetches and runs (evidence: `widget-loader.js`)
- Schedule Widget → Published Crews: fetches (evidence: `widget.js`)
- Schedule Widget → Scriptable: renders (evidence: `widget.js`)
- Desktop User → Wallpaper Renderer: runs (evidence: `README.md`)
- Wallpaper Renderer → Wallpaper Image: renders (evidence: `README.md`)
- Wallpaper Image → Windows Desktop: sets background (evidence: `README.md`)
- Offline Pack Generator → Wallpaper Renderer: renders dates with (evidence: `tools/make-noinstall.py`)
- Offline Pack Generator → Dated Image Pack: creates (evidence: `tools/make-noinstall.py`)
- Dated Image Pack → Windows Desktop: sets background
