# jsjl29/jspicturestudio architecture

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

- Interactive diagram: https://gitdiagram.com/jsjl29/jspicturestudio
- Repository: https://github.com/jsjl29/jspicturestudio

## Overview

JSPictureStudio is a static photo portfolio for browsing South African travel and wildlife collections. Visitors enter through the home, road-trip, or Kruger pages, then browse a progressively loaded, filterable gallery, open and share photos, and optionally download selected originals. The current documented runtime uses a generated manifest and responsive WebP variants; service-worker caching supports revisits. The image-generation script is included because it is a core module and produces those runtime assets. Some subsystem links reflect README documentation; unsampled page wiring is not inferred.

Main entry points: [`gallery.js`](https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js) (Gallery runtime), [`sw.js`](https://github.com/jsjl29/jspicturestudio/blob/main/sw.js) (Cache strategies), [`photo-manifest.js`](https://github.com/jsjl29/jspicturestudio/blob/main/photo-manifest.js) (Photo manifest), [`img/generated`](https://github.com/jsjl29/jspicturestudio/tree/main/img/generated) (WebP variants)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Portfolio pages"]
  node_home["Home page<br/>[index.html]"]
  node_roadtrip["Road-trip page<br/>[roadTrip.html]"]
  node_kruger["Kruger page<br/>[Krug.html]"]
end

subgraph group_browse["Photo browsing"]
  node_gallery["Gallery runtime<br/>[gallery.js]"]
  node_gallery_grid["Batch gallery<br/>[gallery.js]"]
  node_filters["Theme filters<br/>[gallery.js]"]
  node_lightbox["Photo preview<br/>[gallery.js]"]
  node_sharing["Photo sharing<br/>[gallery.js]"]
  node_selection["Download selection<br/>[gallery.js]"]
end

subgraph group_assets["Photo assets"]
  node_manifest["Photo manifest<br/>[photo-manifest.js]"]
  node_variants["WebP variants"]
  node_originals[("Original JPGs")]
  node_image_builder["Image generation<br/>[build_images.py]"]
end

subgraph group_offline["Offline support"]
  node_service_worker["Cache strategies<br/>[sw.js]"]
  node_browser_cache[("Local cache")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"opens"| node_roadtrip
node_visitor -->|"opens"| node_kruger
node_home -->|"presents"| node_gallery
node_roadtrip -->|"presents"| node_gallery
node_kruger -->|"presents"| node_gallery
node_gallery -->|"reads"| node_manifest
node_gallery -->|"renders"| node_gallery_grid
node_gallery -->|"applies"| node_filters
node_gallery -->|"opens"| node_lightbox
node_gallery -->|"shares"| node_sharing
node_gallery -->|"downloads"| node_selection
node_gallery -->|"loads"| node_variants
node_gallery -->|"fetches on request"| node_originals
node_image_builder -->|"generates"| node_variants
node_image_builder -->|"writes"| node_manifest
node_service_worker -->|"reads/writes"| node_browser_cache
node_service_worker -->|"caches"| node_variants
node_service_worker -->|"refreshes"| node_manifest

click node_home "https://github.com/jsjl29/jspicturestudio/blob/main/index.html"
click node_roadtrip "https://github.com/jsjl29/jspicturestudio/blob/main/roadTrip.html"
click node_kruger "https://github.com/jsjl29/jspicturestudio/blob/main/Krug.html"
click node_gallery "https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js"
click node_gallery_grid "https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js"
click node_filters "https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js"
click node_lightbox "https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js"
click node_sharing "https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js"
click node_selection "https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js"
click node_manifest "https://github.com/jsjl29/jspicturestudio/blob/main/photo-manifest.js"
click node_variants "https://github.com/jsjl29/jspicturestudio/tree/main/img/generated"
click node_image_builder "https://github.com/jsjl29/jspicturestudio/blob/main/Toolbox/build_images.py"
click node_service_worker "https://github.com/jsjl29/jspicturestudio/blob/main/sw.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_home,node_roadtrip,node_kruger toneBlue
class node_gallery,node_gallery_grid,node_filters,node_lightbox,node_sharing,node_selection toneAmber
class node_manifest,node_variants,node_originals,node_image_builder toneMint
class node_service_worker,node_browser_cache toneRose
class node_visitor toneIndigo
```

## Components

### Portfolio pages

- [Home page](https://github.com/jsjl29/jspicturestudio/blob/main/index.html): `index.html`
- [Road-trip page](https://github.com/jsjl29/jspicturestudio/blob/main/roadTrip.html): `roadTrip.html`
- [Kruger page](https://github.com/jsjl29/jspicturestudio/blob/main/Krug.html): `Krug.html`

### Photo browsing

- [Gallery runtime](https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js): `gallery.js`
- [Batch gallery](https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js): `gallery.js`
- [Theme filters](https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js): `gallery.js`
- [Photo preview](https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js): `gallery.js`
- [Photo sharing](https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js): `gallery.js`
- [Download selection](https://github.com/jsjl29/jspicturestudio/blob/main/gallery.js): `gallery.js`

### Photo assets

- [Photo manifest](https://github.com/jsjl29/jspicturestudio/blob/main/photo-manifest.js): `photo-manifest.js`
- [WebP variants](https://github.com/jsjl29/jspicturestudio/tree/main/img/generated): `img/generated`
- **Original JPGs**
- [Image generation](https://github.com/jsjl29/jspicturestudio/blob/main/Toolbox/build_images.py): `Toolbox/build_images.py`

### Offline support

- [Cache strategies](https://github.com/jsjl29/jspicturestudio/blob/main/sw.js): `sw.js`
- **Local cache**

### Other components

- **Visitor**

## Connections

- Visitor → Home page: opens (evidence: `README.md`)
- Visitor → Road-trip page: opens (evidence: `README.md`)
- Visitor → Kruger page: opens (evidence: `README.md`)
- Home page → Gallery runtime: presents (evidence: `README.md`)
- Road-trip page → Gallery runtime: presents (evidence: `README.md`)
- Kruger page → Gallery runtime: presents (evidence: `README.md`)
- Gallery runtime → Photo manifest: reads (evidence: `README.md`)
- Gallery runtime → Batch gallery: renders (evidence: `gallery.js`)
- Gallery runtime → Theme filters: applies (evidence: `gallery.js`)
- Gallery runtime → Photo preview: opens (evidence: `gallery.js`)
- Gallery runtime → Photo sharing: shares (evidence: `gallery.js`)
- Gallery runtime → Download selection: downloads (evidence: `gallery.js`)
- Gallery runtime → WebP variants: loads (evidence: `README.md`)
- Gallery runtime → Original JPGs: fetches on request (evidence: `README.md`)
- Image generation → WebP variants: generates (evidence: `Toolbox/build_images.py`)
- Image generation → Photo manifest: writes (evidence: `Toolbox/build_images.py`)
- Cache strategies → Local cache: reads/writes (evidence: `sw.js`)
- Cache strategies → WebP variants: caches (evidence: `sw.js`)
- Cache strategies → Photo manifest: refreshes (evidence: `sw.js`)
