/myrelay.page

your relay is awesome, its canonical should be too

Primary LanguageSvelteMIT LicenseMIT

myrelay.page

Your relay is awesome, its landing page should be too.

A nostr.watch R&D project made possible by OpenSats

Screen Shot 2024-04-10 at 5 26 19 AM

why

That websocket URI representing your relay is floating all over the internet now. Its canonical https shouldn't be a 500, a blank page or some random page. + I both need to do this to eat my own dog food and it's something I've wanted to do since early 2023.

overview

SvelteKit CSR site with SSR disabled that implements ndk, nostr-zap and @nostrwatch/nocap. Utilizes NIP-65, NIP-66, NIP-78 and NIP-115.

Why SvelteKit if no SSR?: No justification other than habit. Convert it in a PR and I won't complain.

todo

  • general
    • tailwind
    • shadcn-svelete UI components
    • progressive load w/skeletons
    • NIP-07 support
    • NIP-46 support
    • mobile compat
  • unique blocks
    • nip-11
    • operator profile/feed
    • map
    • relay feed
    • speed test (need to patch @nostrwatch/nocap)
  • repeatable blocks
    • html
    • image
    • md
  • stateful meta-data
    • nip-11
    • operator profile
    • operator notes
    • notes from relay
    • long-form content feed
    • NIP-19 encoded nevent jumps
    • relay Geodata
    • NIP-66 Monitor Data
      • seen by monitors
      • round-trip time of monitors
      • map reactiveness
      • ssl
    • uptime
  • parsing
    • notes: images
    • notes: videos
    • notes: spotify
    • notes: tidal
    • notes: NIP-19 encoded nostr: links
  • authed User Interactivity
    • login
    • add relay to relay list [10002]
    • zap relay operator
    • follow relay operator
    • "People you follow who are here"
    • "Notes you have here"
  • no-build customization via NIP-78
    • general
      • theme import
      • show/hide blocks
      • order blocks
      • per block customization
      • hide login
      • disable join
    • runtime-imported CSR blocks (svelte)
      • http/https
        • custom block imports
        • custom block options
      • git
        • custom block imports
        • custom block options
      • blossom
        • custom block imports
        • custom block options
    • internationalization (i18n)
      • i18n mapped language
      • NIP-78 overrides

dev

early alpha, things will change, history will be full of haphazard commit messages, force pushes to reset history eminent ... but have at it.

build

pnpm install
pnpm build

Artifacts will end up in the build directory. You just neeed to serve them.

docker

docker build .

notes

You can test relays on localhost by appending ?url=wss://relay.snort.social for instance.

Image is not yet on a registry.

serving from canonical

Depending on your relay software, you'll need to do some proxying to direct websocket, NIP-11 and/or NIP-05 traffic to your relay, and https traffic without application/nostr+json to a page.

nginx/caddy/haproxy

examples soon, see https://relaypag.es for a live example