Skip to content
pubkyPublic

About

A portable social presence that’s build to last.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

mypubky.com

mypubky.com is a portable profile card for the freedom web, powered by Pubky.

It is designed to feel more like a shareable identity card than a typical "link in bio" page. A profile can combine a user’s Pubky identity, avatar, bio, social links, custom background, latest posts, profile tags, sharing tools, and Paykit-ready donation flows into one visual page that can be shared anywhere.

What the product does

  • Presents a public profile at a route like /:pubky
  • Reads shared identity data from pubky.app
  • Lets the owner sign in with Pubky Ring and edit their profile
  • Supports custom image or video backgrounds
  • Supports left, center, or right card placement
  • Supports multiple card background modes: Dark, Blur, and Clear
  • Shows up to 3 latest Pubky posts
  • Shows Pubky profile tags
  • Includes a share flow with profile link + QR
  • Includes a donation flow with Paykit QR and optional Bitcoin QR

The editing experience uses a 3D card flip. The public profile, share state, donate state, and editor all stay inside the same visual card system.

Current feature set

Public profile

  • Avatar, display name, shortened Pubky, and bio
  • Button links under the bio
  • Social icons
  • Optional profile tags
  • Up to 3 latest Pubky posts
  • Share state as a card flip
  • Donate state as a card flip

Editing

  • Sign in with Pubky Ring QR auth
  • Content and Style tabs inside the flipped editor
  • Avatar upload
  • Name and bio editing
  • Link button creation, deletion, and drag-to-reorder
  • Social platform fields, including auto-derived Pubky profile URL
  • Toggles for latest posts, profile tags, and donations
  • Optional Bitcoin address field for Paykit / Bitcoin donate flow

Styling

  • 3 default backgrounds plus custom upload
  • Image and short looping video background support
  • Card background modes:
    • Dark
    • Blur
    • Clear
  • Card position:
    • Left
    • Center
    • Right

Share + donate

  • Share panel with profile link + QR
  • Downloadable profile QR
  • Donate panel with Paykit-native Pubky QR
  • Optional Bitcoin QR tab when a Bitcoin address is set
  • Paykit method publishing under the user’s public Pubky storage

Tech stack

This project is intentionally lightweight. It is built as a static frontend app and does not require a traditional database or custom backend for the core profile flow.

Storage model

The app uses Pubky public storage and keeps shared identity data aligned with pubky.app where possible.

  • Shared profile:
    • /pub/pubky.app/profile.json
  • mypubky card settings:
    • /pub/mypubky.com/card.json
  • mypubky uploads:
    • /pub/mypubky.com/files/*
  • Paykit public method files:
    • /pub/paykit/v0/*

In practice:

  • name, bio, image, and portable links are aligned with pubky.app
  • presentation-specific settings live in mypubky.com
  • optional payment method files live in paykit

Run locally

  1. Install Node.js 24 LTS (Node 22.12 or newer is also supported)

  2. Install dependencies:

    npm ci
  3. Start the dev server:

    npm run dev
  4. Open the local URL shown by Vite

The development server listens on 127.0.0.1 by default. Use npm run dev -- --host only when you intentionally need access from another device.

Checks

npm run check
npm audit

The regression suite covers untrusted profile data, media uploads, Bitcoin checksums, session and navigation races, progressive loading, partial-save retries, Paykit cleanup, and the existing Nexus /v0 integration.

See the security audit for the changes, verification, and remaining manual checks.

Continuous integration

GitHub Actions runs on pull requests, pushes to main, and manual dispatch. It installs the lockfile with lifecycle scripts disabled, then runs tests and the production build on Node 22 and 24. The Node 24 job also runs npm audit --audit-level=high, failing on high or critical advisories. Actions are pinned to commit hashes and the workflow has read-only repository access.

Source layout

Location Responsibility
src/app.js Routes, UI events, state transitions, authentication and save coordination, DOM effects
src/ui/ Homepage, profile, posts, editor, panels and dialog templates; keyboard focus restoration
src/lib/pubky.js Profile loading and saving, retry checkpoints, Paykit synchronization
src/lib/profile-data.js Draft defaults, validation and Social v0 document serialization
src/lib/homeserver.js, src/lib/nexus.js Bounded public reads and Nexus v0 queries
src/lib/media.js, src/lib/posts.js Media resolution, blob ownership and post loading
src/lib/session.js SDK initialization, Ring authentication and session lifecycle

View functions receive explicit data and state; they do not mutate application state or start network requests. The existing pubky.js exports remain available to callers.

Build for production

Create a production build with:

npm run build

Vite will generate a static output in dist/.

Deployment

The Deploy workflow builds and publishes a container on pushes to main, then deploys it to the mypubky-com Cloud Run service behind the Google Cloud load balancer. It also supports manual dispatch. The Docker build runs npm run check before producing the Nginx runtime image, so failed tests or builds stop publication.

nginx.conf serves the SPA on port 3000, caches hashed assets, and supplies the response security headers used by the Cloud Run deployment. GitHub credentials and cloud deployment secrets are managed by the operations workflow.

The app is designed to be deployable as a static site.

Typical flow:

  1. Run npm ci
  2. Run npm run build
  3. Upload the generated dist/ folder to a static host

Good hosting options include:

  • GitHub Pages
  • Netlify
  • Vercel
  • Cloudflare Pages
  • any static host that supports HTTPS

For profile routes like /:pubky, the host must rewrite unknown routes back to index.html so the client app can boot and resolve the Pubky itself.

This repo now includes common static-host fallback files:

  • public/.htaccess for Apache-style hosting
  • public/_redirects for Netlify-style hosting
  • public/_headers for Netlify and Cloudflare Pages security headers

After npm run build, make sure those files are uploaded with the rest of dist/.

The HTML includes a content security policy. Apache (mod_headers), Netlify, and Cloudflare Pages configurations additionally deny framing and set response headers, including long-lived caching for Vite's hashed assets. Other hosts need equivalent response-header configuration; the Vite preview server does not apply these hosting files.

Loading and save recovery

The SDK loads at startup in a separate, cacheable bundle. The profile card appears before optional posts, tags, payment methods and mention details finish loading. Avatar and background preloads run together. Built-in backgrounds and the homepage demo use lossless WebP at their original dimensions; the original PNG sources are retained. Uploaded media is not recompressed.

Saves show the confirmed local profile immediately after storage writes finish. Optional content refreshes separately. Partial failures keep the editor and draft open, reuse successful uploads, and retry unfinished writes. Recovery checkpoints last while the draft remains open in this page; they are not a persistent offline queue. Multiple public-file writes are still not atomic.

Escape closes the topmost dialog first, then an open card panel. Closing the editor uses the same behavior as Cancel and discards unsaved edits. A save in progress cannot be dismissed. Closing the Ring dialog cancels its pending approval, and focus returns to the opening control when available.

Notes

  • Auth is handled with Pubky Ring QR approval
  • Cookie-session metadata is stored locally and restored when possible; the SDK keeps the authentication cookie separate
  • The app includes lightweight session diagnostics to help explain when a session expires or loses required permissions
  • Uploaded media is currently capped by app rules for simpler UX
  • New uploads accept PNG, JPEG, GIF, WebP and AVIF images, plus MP4, WebM, Ogg and MOV backgrounds. SVG and HTML uploads are rejected. The 10 MB limit and media signatures are checked again before writing.
  • Nexus remains on /v0 and shared profiles remain under /pub/pubky.app/. Social v1 migration is intentionally deferred.

Vision

mypubky.com is not just a links page.

It is meant to be a portable public identity surface for Pubky:

  • who you are
  • how to reach you
  • how to verify it is really you
  • how to follow you in the ecosystem
  • how to support you

The goal is to make Pubky useful and shareable anywhere on the web.

About

A portable social presence that’s build to last.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages