PhotonRelicGitHub

Open source · Apache 2.0

Your images, in your Cloudflare account.

PhotonRelic is a digital asset manager and on-request image resizer built entirely on Cloudflare. Use both Workers together, or either one on its own.

View on GitHub

Public Worker

The resizer

Serves images from an R2 bucket at their own path and resizes them from a fixed menu. Output is cached at the edge, and anything off the menu gets a 400, which limits how many unique transformations anyone can request and so limits your Images bill.

GET /media/products/chair.jpg                      # as stored
GET /media/products/chair.jpg?w=768                # 768 px wide, format from Accept
GET /media/products/chair.jpg?w=320&ar=1:1&f=webp  # 320 × 320 cover crop, WebP

Private Worker, behind Access

The library

Browse the bucket, upload from the browser, and file images by subject, tags, alt text and credit.

Upload a whole shoot

Drop a folder in the browser. Files are hashed and prechecked before any bytes move, then stream straight into R2. If the tab closes, drop the folder again and only the missing files go up.

Nothing is overwritten

A key that already holds different bytes is refused. Removing an object takes an explicit, confirmed delete, and every write goes into an audit log.

File in bulk

Select tiles and set subject, tags, credit and an alt-text pattern together. You see a preview before anything is applied.

Find duplicates

Keys with identical bytes are grouped by R2 etag or SHA-256. Keep one and retire the rest; retired objects keep serving.

The bucket is the record

D1 only holds metadata about keys. Files added with the dashboard, rclone or another app appear after a rescan as unfiled.

Fails closed

The Worker verifies the Cloudflare Access JWT itself on every request, so a misconfigured policy locks people out instead of letting them in.

Run it yourself

You need Node 22.13 or later, pnpm, and a Cloudflare account with R2, D1 and, for resizing, Images enabled.

pnpm install
pnpm test

Read the setup guide