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:3000Without DATABASE_URL the app uses an embedded Postgres (PGlite) in ./data/pg. Same SQL as production; nothing else changes.
Environment variables#
| Name | Purpose |
|---|---|
SESSION_SECRET | 32+ random chars. Signs session cookies. |
MASTER_KEY | 32 random bytes, base64url. Wraps every content key. Back it up; losing it loses every product. |
TREASURY_WALLET | Receives the 5% fee. |
ADMIN_WALLETS | Comma-separated wallets allowed on /admin. |
NEXT_PUBLIC_RPC_URL | RPC used by browsers. Defaults to devnet. |
RPC_URL | Optional private RPC for server-side verification (e.g. Helius). |
DATABASE_URL | Neon Postgres. Blank = local PGlite. |
BLOB_READ_WRITE_TOKEN | Vercel Blob store for file ciphertext. |
GITHUB_API | Optional override of https://api.github.com (used by tests). |
node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))" # SESSION_SECRET / MASTER_KEYTests#
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 checksDeploy to Vercel#
npx vercel link, then add the Neon and Blob integrations from the Vercel Marketplace (they setDATABASE_URLandBLOB_READ_WRITE_TOKEN).- Set the remaining variables for Production. Generate a fresh
MASTER_KEYfor production and store a copy somewhere safe. npx vercel deploy --prod.- Point
NEXT_PUBLIC_RPC_URLat mainnet, and ideallyRPC_URLat a private provider; public RPCs rate-limit.
The Hobby plan forbids commercial use; a marketplace taking a fee belongs on Pro.