Docs · 13

Running it yourself

Local setup, environment variables, tests, deploying to Vercel.

Run locally#

git clone <repo> everynth && cd everynth
copy .env.example .env.local        # fill in the values below
npm install
npm run dev                          # http://localhost:3000

Without DATABASE_URL the app uses an embedded Postgres (PGlite) in ./data/pg. Same SQL as production; nothing else changes.

Environment variables#

NamePurpose
SESSION_SECRET32+ random chars. Signs session cookies.
MASTER_KEY32 random bytes, base64url. Wraps every content key. Back it up; losing it loses every product.
TREASURY_WALLETReceives the 5% fee.
ADMIN_WALLETSComma-separated wallets allowed on /admin.
NEXT_PUBLIC_RPC_URLRPC used by browsers. Defaults to devnet.
RPC_URLOptional private RPC for server-side verification (e.g. Helius).
DATABASE_URLNeon Postgres. Blank = local PGlite.
BLOB_READ_WRITE_TOKENVercel Blob store for file ciphertext.
GITHUB_APIOptional override of https://api.github.com (used by tests).
node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))"   # SESSION_SECRET / MASTER_KEY

Tests#

npm test                                   # unit: auth, money, key wrap, encryption, payment verification

# full flow over HTTP with a stub RPC and a stub GitHub (nothing touches mainnet)
$env:RPC_URL="http://127.0.0.1:3199"; $env:GITHUB_API="http://127.0.0.1:3198"
$env:PGLITE_DIR="$env:TEMP\everynth-e2e"; $env:DATABASE_URL=" "
$env:ADMIN_WALLETS=(node scripts/e2e.mjs --admin-wallet)
npm run build; npx next start -p 3100     # terminal 1
node --env-file=.env.local scripts/e2e.mjs   # terminal 2 — 21 checks

Deploy to Vercel#

  1. npx vercel link, then add the Neon and Blob integrations from the Vercel Marketplace (they set DATABASE_URL and BLOB_READ_WRITE_TOKEN).
  2. Set the remaining variables for Production. Generate a fresh MASTER_KEY for production and store a copy somewhere safe.
  3. npx vercel deploy --prod.
  4. Point NEXT_PUBLIC_RPC_URL at mainnet, and ideally RPC_URL at a private provider; public RPCs rate-limit.

The Hobby plan forbids commercial use; a marketplace taking a fee belongs on Pro.