Skip to content

Environment Variables

Frontend (.env.local)

VariableDescriptionRequiredDefault
VITE_NETWORKTarget blockchain networkNosepolia (testnet)
VITE_GITHUB_CLIENT_IDGitHub OAuth App client IDYes (for GitHub linking)
VITE_API_URLAPI base URLNo/api

Example

bash
# frontend/.env.local
VITE_NETWORK=mainnet
VITE_GITHUB_CLIENT_ID=Iv1.abc123def456

Backend (Vercel Environment Variables)

VariableDescriptionRequired
JWT_SECRETSecret for JWT/HMAC signing (min 32 chars)Yes
KV_REST_API_URLVercel KV (Upstash) REST URLYes (prod)
KV_REST_API_TOKENVercel KV REST auth tokenYes (prod)
GITHUB_CLIENT_IDGitHub OAuth App client IDYes (for GitHub linking)
GITHUB_CLIENT_SECRETGitHub OAuth App secretYes (for GitHub linking)
PLATFORM_WALLETPlatform/Genesis Creator wallet addressNo

Example

bash
# Set in Vercel Dashboard → Settings → Environment Variables

JWT_SECRET=your-very-long-secret-key-at-least-32-chars
KV_REST_API_URL=https://your-db.upstash.io
KV_REST_API_TOKEN=AaBbCcDd...
GITHUB_CLIENT_ID=Iv1.abc123def456
GITHUB_CLIENT_SECRET=abc123secretxyz
PLATFORM_WALLET=0x3f11aFcC1d077f7071df71Cf5Fb3429116959543

Development Setup

Local API Server

The dev server (api/dev-server.mjs) runs without KV by default, using JSON seed files.

To test with real KV:

bash
cd api
KV_REST_API_URL=https://your-db.upstash.io \
KV_REST_API_TOKEN=your-token \
JWT_SECRET=dev-secret-key-for-local-testing \
node dev-server.mjs

Frontend Dev Server

bash
cd frontend
pnpm dev

Network Configuration

Testnet (default)

bash
# No VITE_NETWORK needed, defaults to Base Sepolia

Mainnet

bash
VITE_NETWORK=mainnet

GitHub OAuth Setup

  1. Go to GitHub → Settings → Developer settings → OAuth Apps
  2. Create new OAuth App:
  3. Copy Client ID → VITE_GITHUB_CLIENT_ID + GITHUB_CLIENT_ID
  4. Generate Client Secret → GITHUB_CLIENT_SECRET

Vercel KV Setup

  1. Go to Vercel Dashboard → Storage → Create Database
  2. Select KV (powered by Upstash)
  3. Connect to your project
  4. Copy the environment variables (auto-populated):
    • KV_REST_API_URL
    • KV_REST_API_TOKEN
    • KV_URL (not used)

Security Notes

VariableExposure
JWT_SECRETServer only, never expose
GITHUB_CLIENT_SECRETServer only, never expose
KV_REST_API_TOKENServer only, never expose
VITE_*Exposed to frontend (public)

Never commit secrets to git. Use .env.local (gitignored) for local development.

Fetch Quests — Decentralized Gig-Work Platform