~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/pds.js

An atproto PDS in JavaScript, for Cloudflare Workers and Node

0
0
main
31 lines · 1.6 KB Raw History

Example apps

Four working apps for the site platform. Each one discovers whose repo it serves from its own origin, so any of them runs on any account that installs it. docs/apps.md explains how they are put together.

AppWhat it does
photos.mjsGalleries from social.grain.* records: justified layouts, a lightbox, terrain headers for located galleries, a map, favourite counts from the network
roasts.mjsA coffee roast log: a live roast timer, weight-loss and development-time metrics against Sweet Maria's roast card, notes and photos
drop.mjsAn image host: drag, paste or choose a file and the link copies itself. The link is the site's /.blobs/<cid> route, so it works anywhere an image URL does
videos.mjsA video gallery from the Drive labs feature: drop a video into Drive on the account page and it plays here, streamed with seeking from /.blobs/<cid>. Read-only; uploads happen in Drive

Each script deploys the site to your repo and publishes the manifest that makes it installable:

PDS_URL=https://pds.example.com \
PDS_DID=did:plc:… \
PDS_APP_PASSWORD=… \
node photos.mjs

Then install it from the account page's Sites section, or with pdsjs-site install at://you.example.com/dev.pdsjs.app.manifest/photos.

roasts.mjs writes to com.chadtmiller.coffee.roast unless ROAST_COLLECTION names another, and drop.mjs writes to com.chadtmiller.drop.image unless DROP_COLLECTION names another. An NSID's authority is every segment but the last, reversed, so use a domain you control.