Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PicoPages

Design a one-page site, pay 0.01 USDC via x402, get it live at yourslug.pages.dev on Cloudflare Pages. Fully automated — no account, no checkout, no dashboard.

Live: https://picopages.botty4541.workers.dev

How it works

  1. You design a page in the builder (template, headline, tagline, colors, email…).
  2. The publish button returns an x402 URL for /api/site?….
  3. Pay it with any x402-compatible wallet (e.g. awal x402 pay '<url>').
  4. The worker verifies the payment, settles 0.01 USDC to the fee recipient, uploads the rendered HTML to Cloudflare Pages via the assets API, and returns your live https://<slug>.pages.dev URL.

Deployment notes

  • Cloudflare Pages direct upload does not use sha256 file hashes. Asset keys are blake3(base64(utf8(content)) + ext), hex-encoded and truncated to 32 chars (the format wrangler pages deploy produces).
  • The worker uploads assets through the Pages assets API scoped by a per-project upload JWT: GET /pages/projects/{slug}/upload-tokencheck-missinguploadupsert-hashes → create a deployment with a multipart manifest + branch form. A freshly minted JWT can be transiently rejected, so the worker retries with a refreshed token and treats check-missing failure as "upload anyway".
  • Text is base64-encoded from its UTF-8 bytes (btoa alone throws on non-Latin-1 characters like ◆ in the portfolio template).

Secrets (wrangler)

Secret Purpose
CLOUDFLARE_API_TOKEN Pages project/deployment management + assets API
CLOUDFLARE_ACCOUNT_ID Account scoping for all Pages API calls

Plus the x402 config in src/config.ts (fee recipient, price, RPC).

Development

npm install
npm run typecheck
npx wrangler dev       # local dev
npx wrangler deploy    # deploy worker

Endpoints

Route Purpose
/ Builder UI + service metadata (x402 payment-required on paid routes)
/api/site?… Paid endpoint: verify → settle → deploy → return live URL

About

PicoPages: design a page, pay 0.01 USDC on Base via x402, get it live on Cloudflare Pages. No account, no checkout.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages