# f13dev/photo-archive architecture

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

- Interactive diagram: https://gitdiagram.com/f13dev/photo-archive
- Repository: https://github.com/f13dev/photo-archive

## Overview

Photo Archive is a PHP folder-based gallery: visitors choose an image folder, browse paginated image thumbnails and folder previews, and open full images in a lightbox. The main page scans image folders, generates missing resized thumbnails, and renders gallery links; the bundled Colorbox handles image viewing and navigation. README also describes FTP uploading, but the available tree and excerpts show no upload implementation, so it is not mapped. Evidence is limited to the README and sampled excerpts; styling and unshown behavior are not expanded.

Main entry points: [`index.php`](https://github.com/f13dev/photo-archive/blob/master/index.php) (Gallery page), [`inc/jquery.colorbox.js`](https://github.com/f13dev/photo-archive/blob/master/inc/jquery.colorbox.js) (Colorbox viewer), [`images`](https://github.com/f13dev/photo-archive/tree/master/images) (Image folders), [`thumbs`](https://github.com/f13dev/photo-archive/tree/master/thumbs) (Thumbnail files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gallery["Gallery browsing"]
  node_page["Gallery page<br/>[index.php]"]
  node_folderbrowse["Folder browsing<br/>[index.php]"]
  node_pagination["Image pagination<br/>[index.php]"]
  node_metadata["Image metadata<br/>[index.php]"]
  node_thumbnail["Thumbnail generation<br/>[index.php]"]
end

subgraph group_viewer["Image viewing"]
  node_lightbox["Colorbox viewer<br/>[jquery.colorbox.js]"]
  node_jquery["jQuery library"]
  node_style["Gallery styling<br/>[style.css]"]
  node_colorboxstyle["Lightbox styling<br/>[colorbox.css]"]
end

subgraph group_assets["Gallery data"]
  node_images[("Image folders")]
  node_thumbs[("Thumbnail files")]
end

node_visitor(("Gallery visitor"))
node_browser(("Web browser"))

node_visitor -->|"requests gallery"| node_page
node_page -->|"renders folders"| node_folderbrowse
node_page -->|"renders pages"| node_pagination
node_page -->|"reads metadata"| node_metadata
node_page -->|"creates missing"| node_thumbnail
node_folderbrowse -->|"scans folders"| node_images
node_folderbrowse -->|"reads previews"| node_thumbs
node_pagination -->|"scans images"| node_images
node_thumbnail -->|"reads originals"| node_images
node_thumbnail -->|"writes resized"| node_thumbs
node_page -->|"renders thumbnails"| node_thumbs
node_page -->|"configures viewer"| node_lightbox
node_lightbox -->|"uses"| node_jquery
node_browser -->|"displays"| node_page
node_browser -->|"opens images"| node_lightbox
node_page -->|"loads stylesheet"| node_style
node_page -->|"loads stylesheet"| node_colorboxstyle
node_lightbox -->|"loads selected image"| node_images

click node_page "https://github.com/f13dev/photo-archive/blob/master/index.php"
click node_folderbrowse "https://github.com/f13dev/photo-archive/blob/master/index.php"
click node_pagination "https://github.com/f13dev/photo-archive/blob/master/index.php"
click node_metadata "https://github.com/f13dev/photo-archive/blob/master/index.php"
click node_thumbnail "https://github.com/f13dev/photo-archive/blob/master/index.php"
click node_images "https://github.com/f13dev/photo-archive/tree/master/images"
click node_thumbs "https://github.com/f13dev/photo-archive/tree/master/thumbs"
click node_lightbox "https://github.com/f13dev/photo-archive/blob/master/inc/jquery.colorbox.js"
click node_style "https://github.com/f13dev/photo-archive/blob/master/inc/style.css"
click node_colorboxstyle "https://github.com/f13dev/photo-archive/blob/master/inc/colorbox.css"

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_page,node_folderbrowse,node_pagination,node_metadata,node_thumbnail,node_browser toneBlue
class node_lightbox,node_jquery,node_style,node_colorboxstyle toneAmber
class node_images,node_thumbs toneMint
class node_visitor toneIndigo
```

## Components

### Gallery browsing

- [Gallery page](https://github.com/f13dev/photo-archive/blob/master/index.php): `index.php`
- [Folder browsing](https://github.com/f13dev/photo-archive/blob/master/index.php): `index.php`
- [Image pagination](https://github.com/f13dev/photo-archive/blob/master/index.php): `index.php`
- [Image metadata](https://github.com/f13dev/photo-archive/blob/master/index.php): `index.php`
- [Thumbnail generation](https://github.com/f13dev/photo-archive/blob/master/index.php): `index.php`

### Image viewing

- [Colorbox viewer](https://github.com/f13dev/photo-archive/blob/master/inc/jquery.colorbox.js): `inc/jquery.colorbox.js`
- **jQuery library**
- [Gallery styling](https://github.com/f13dev/photo-archive/blob/master/inc/style.css): `inc/style.css`
- [Lightbox styling](https://github.com/f13dev/photo-archive/blob/master/inc/colorbox.css): `inc/colorbox.css`

### Gallery data

- [Image folders](https://github.com/f13dev/photo-archive/tree/master/images): `images`
- [Thumbnail files](https://github.com/f13dev/photo-archive/tree/master/thumbs): `thumbs`

### Other components

- **Gallery visitor**
- **Web browser**

## Connections

- Gallery visitor → Gallery page: requests gallery (evidence: `index.php`)
- Gallery page → Folder browsing: renders folders (evidence: `index.php`)
- Gallery page → Image pagination: renders pages (evidence: `index.php`)
- Gallery page → Image metadata: reads metadata (evidence: `index.php`)
- Gallery page → Thumbnail generation: creates missing (evidence: `index.php`)
- Folder browsing → Image folders: scans folders (evidence: `index.php`)
- Folder browsing → Thumbnail files: reads previews (evidence: `index.php`)
- Image pagination → Image folders: scans images (evidence: `index.php`)
- Thumbnail generation → Image folders: reads originals (evidence: `index.php`)
- Thumbnail generation → Thumbnail files: writes resized (evidence: `index.php`)
- Gallery page → Thumbnail files: renders thumbnails (evidence: `index.php`)
- Gallery page → Colorbox viewer: configures viewer (evidence: `index.php`)
- Colorbox viewer → jQuery library: uses (evidence: `inc/jquery.colorbox.js`)
- Web browser → Gallery page: displays (evidence: `index.php`)
- Web browser → Colorbox viewer: opens images
- Gallery page → Gallery styling: loads stylesheet (evidence: `index.php`)
- Gallery page → Lightbox styling: loads stylesheet (evidence: `index.php`)
- Colorbox viewer → Image folders: loads selected image
