Pages, data, functions and sign-in
on one NEAR account.
Quay deploys a full-stack app to a NEAR testnet account it creates for you in one command. There is no signup and no server to rent. Every deploy is a sealed release, and production is the one you point at.
Harbour Board is a noticeboard with members, moderation, pins, an hourly digest and a large photo, all on this account. Choose a release to load it. Production stays on 7.
The release is still sealed on chain; only the host is down. Try again in a minute, or run quay gateway --account harbour-board.testnet.
What runs on the account, layer by layer
Each layer was run on testnet for Harbour Board. The proof links open the transaction or the live page, and none of them needs a key. Each layer's name opens its docs.
| Layer | What it does | Command | Runs on | Proof |
|---|---|---|---|---|
| Site | A folder becomes a sealed release with its own URL. Production is a pointer you move. | quay deploy ./dist | NEAR | release 7 sealed production 7 |
| Gateway | Turns a browser request into a web4_get call. Run it on your machine, any server or Cloudflare Workers. | quay gateway --account harbour-board.testnet | web4 Cloudflare Workers | Workers host health testnet.page |
| Routes | The contract fills a template from data, so a post page is complete HTML without JavaScript. | quay up | NEAR web4_get | /posts/5 /api/posts |
| Data | Collections of JSON docs with rules. The site pays for storage, so a visitor needs no NEAR. | quay db collection set posts --write anyone --payer site | NEAR FastData KV | posts collection a FastData write |
| Functions | Rust compiled to WASI, with a secret and outbound HTTPS. moderate checks every new post. | quay functions deploy moderate | OutLayer | moderate deployed a digest run, attested |
| Sign-in | Members are accounts named <name>.harbour-board.testnet, made with no NEAR. A wallet signs a NEP-413 message. | quay members open | near-connect NEP-413 | a member joined a Telegram test join |
| Relay | A relayer pays the gas for a member's signed delegate action. One host runs as an OutLayer function, with no server. | quay relay deploy | OutLayer NEP-366 | a gasless post relay deployed |
| Large files | A file over the size you set goes to FastFS for gas only. The release keeps its URL and sha256. | quay up --store fastfs | FastFS | the 493,183 B photo sealed in release 4 |
| Payments | A product priced in NEAR or one NEP-141 token. The Board sells a 24-hour pin for 0.1 NEAR or 0.1 test USDC. | quay products set pin --name "Pin for a day" --price 0.1 --grant pin --pin-seconds 86400 | NEAR | pin product test USDC accepted |
| Cron | An hourly digest job. The contract keeps itself awake; one arm lasts about 6 hours, then someone must arm it again. | quay cron arm | NEAR | armed, every run a receipt the digest on / |
How a request flows
Reading a post touches only the gateway and the contract. Writing one adds the relayer and a function, and both run on OutLayer.
- A reader's browser asks the gateway for /posts/5.
- The gateway calls web4_get on harbour-board.testnet, and the route fills post.html from the posts collection.
- A member signs a delegate action. The relayer, running on OutLayer, sends it and pays the gas, and the contract adds the post.
- The posts collection's on_add rule asks OutLayer to run moderate, which checks the post and adds a link preview.
What Quay runs on
Next to each tool is what Quay uses it for. The trust table below says what happens if it goes away.
| Tool | What Quay uses it for | Layers |
|---|---|---|
| Accounts, the contract, and all on-chain state: releases, docs, members, receipts, the function registry and cron jobs. Every layer above lives on one testnet account. | All layers | |
| web4 | The web4_get view that turns a path into a page, and the public testnet.page gateway. | Routes, Gateway |
| FastNEAR | The default RPC (test.rpc.fastnear.com), FastFS for large files and function code, and FastData KV as a gas-only data backend. | Large files, Data, every read |
| OutLayer | Runs the WASI functions in its TEE workers, holds their secrets, and hosts the serverless relayer. | Functions, Relay, Cron runs |
| near-connect | The NEAR wallet connector by HOT Labs, @hot-labs/near-connect. On testnet its picker showed Meteor, Intear, Ledger, Nightly and the NEAR CLI; sign-in is proven with the NEAR CLI. The page never holds a key. | Sign-in, the dashboard |
| Cloudflare Workers | Cloudflare Workers™ is one optional host for the gateway. This site and both samples are mirrored there because testnet.page failed for hours. | Gateway |
| NEP-413, NEP-366 | The NEAR standards for a signed sign-in message and for a delegate action a relayer pays for. | Sign-in, Relay |
| near-sdk, near-api-js | The contract is near-sdk 5.30.1. The CLI uses near-api-js 7.4.0, and the tests run on near-sandbox. | Everything |
What you trust, and how to replace it
One account holds the app. Everything else is a service that reads it, writes to it or runs code for it, and most of them have one operator today.
| Piece | What you depend on | How to replace it |
|---|---|---|
| The contract on your account | Releases, routes, data, members, receipts, the function registry and cron jobs. Any RPC node can read them. | Nothing to replace. It is yours. A full-access key can replace the wasm, so keep that key off CI. |
| testnet.page | One operator serves every web4 site. We saw it answer every account with HTTP 400 for hours on Nov 10. | quay gateway on your machine, the single-file build on Node, Deno or Bun, or the Workers build. |
| Cloudflare Workers mirror | The owner's Cloudflare account, running the gateway unchanged. | Deploy the same worker to your account with npx wrangler deploy. |
| OutLayer | One operator's TEE network runs functions and holds their secrets. A run takes 5 to 17 seconds. | No drop-in replacement. Run the logic on your own server, as quay relay serve does, or leave functions out. Posts still land without them. |
| FastNEAR | The default RPC, FastFS for large files, and FastData reads. | Pass --rpc; the gateway falls back to other RPCs. Large files can go to Pinata, Filebase or any https URL, and the release keeps the sha256. |
| The relayer | Its own account and key. Its balance is the spend limit. It cannot move the site. | Run quay relay serve yourself and fund it with quay relay create. |
| The schedule | Nobody runs it. The contract keeps itself awake for about 6 hours per arm with an hourly job. | Run quay cron arm again, on a timer you control. |
| The wallet connector | The client loads @hot-labs/near-connect and the wallets it lists. | Pass your own connector, or sign with an explicit key in Node. |
What it costs on testnet
NEAR locks storage on the account that holds it and unlocks it when the data is deleted. The numbers are Harbour Board's, read from chain on Nov 11.
Questions
Is this on mainnet?
No. Quay runs on NEAR testnet only, the CLI refuses any other network, and nothing here holds real funds. Test USDC is usdc.fakes.testnet, which anyone can mint.
Do I need to sign up?
No. There is no Quay account. quay init asks the testnet faucet for a NEAR account and deploys the contract to it. The account and its keys are yours.
What happens if the gateway is down?
The pages and data stay on chain; only that door is closed. Run quay gateway --account <id> and the same site answers at 127.0.0.1:8787, or deploy the Workers build. testnet.page did fail on Nov 10, which is why the mirrors exist.
Who holds the keys?
You hold the account's full-access key, in ~/.near-credentials. CI gets a publish-only key that cannot move production. Each member holds their own key. The relayer holds its own and can only spend its balance. The dashboard never holds a key.
What can it not do yet?
The schedule stops about 6 hours after each arm, and nobody re-arms it for you. Functions are Rust compiled to WASI, with no JavaScript runtime, and take 5 to 17 seconds on OutLayer. Wallet sign-in is proven with one connector, the NEAR CLI. Telegram sign-in has run only on test data, with no real bot. A full-access key can replace the contract, so a release is not owner-proof against it.
Is Quay a NEAR product?
No. Quay is an independent hackathon project built on NEAR. NEAR and the other tools named here do not run or endorse it.
Start with four commands
Node 20 or newer and a checkout of the repository. The faucet funds the testnet account, and every deploy is a preview with its own URL. Move production on purpose with quay promote, and back with quay rollback.
npm install -g ./cli quay init quay deploy ./dist -m "first release" quay promote 1
For data, functions and routes, describe them in quay.json. quay up --dry-run prints the plan and changes nothing.
