Environment Variables
Frontend (.env.local)
| Variable | Description | Required | Default |
|---|---|---|---|
VITE_NETWORK | Target blockchain network | No | sepolia (testnet) |
VITE_GITHUB_CLIENT_ID | GitHub OAuth App client ID | Yes (for GitHub linking) | — |
VITE_API_URL | API base URL | No | /api |
Example
bash
# frontend/.env.local
VITE_NETWORK=mainnet
VITE_GITHUB_CLIENT_ID=Iv1.abc123def456Backend (Vercel Environment Variables)
| Variable | Description | Required |
|---|---|---|
JWT_SECRET | Secret for JWT/HMAC signing (min 32 chars) | Yes |
KV_REST_API_URL | Vercel KV (Upstash) REST URL | Yes (prod) |
KV_REST_API_TOKEN | Vercel KV REST auth token | Yes (prod) |
GITHUB_CLIENT_ID | GitHub OAuth App client ID | Yes (for GitHub linking) |
GITHUB_CLIENT_SECRET | GitHub OAuth App secret | Yes (for GitHub linking) |
PLATFORM_WALLET | Platform/Genesis Creator wallet address | No |
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=0x3f11aFcC1d077f7071df71Cf5Fb3429116959543Development 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.mjsFrontend Dev Server
bash
cd frontend
pnpm devNetwork Configuration
Testnet (default)
bash
# No VITE_NETWORK needed, defaults to Base Sepolia- Chain ID: 84532
- Explorer: https://sepolia.basescan.org
Mainnet
bash
VITE_NETWORK=mainnet- Chain ID: 8453
- Explorer: https://basescan.org
GitHub OAuth Setup
- Go to GitHub → Settings → Developer settings → OAuth Apps
- Create new OAuth App:
- Application name: Fetch Quests
- Homepage URL: https://fetchquests.io
- Authorization callback URL: https://fetchquests.io (or localhost for dev)
- Copy Client ID →
VITE_GITHUB_CLIENT_ID+GITHUB_CLIENT_ID - Generate Client Secret →
GITHUB_CLIENT_SECRET
Vercel KV Setup
- Go to Vercel Dashboard → Storage → Create Database
- Select KV (powered by Upstash)
- Connect to your project
- Copy the environment variables (auto-populated):
KV_REST_API_URLKV_REST_API_TOKENKV_URL(not used)
Security Notes
| Variable | Exposure |
|---|---|
JWT_SECRET | Server only, never expose |
GITHUB_CLIENT_SECRET | Server only, never expose |
KV_REST_API_TOKEN | Server only, never expose |
VITE_* | Exposed to frontend (public) |
Never commit secrets to git. Use .env.local (gitignored) for local development.