Backend Environment Variables
Location:backend/.env
Server Configuration
PORT- HTTP server port (default: 8080)IN_PRODUCTION- Set totruefor production environment
Database Configuration
The backend connects to three databases using the same credentials:
app, bot, and ponder.Authentication
ADMIN_KEY- Shared secret for admin API calls viaX-Admin-Keyheader
Blockchain Configuration
TOKEN_ID- SFLUV wrapped token contract addressUNDERLYING_TOKEN_ID- HONEY token contract addressTOKEN_DECIMALS- 18 decimals (1e18)RPC_URL- Berachain RPC endpointBOT_KEY/BOT_ADDRESS- Faucet bot wallet credentialsADMIN_ADDRESS- Primary admin walletREDEEMER_ADMIN_KEY/REDEEMER_ADMIN_ADDRESS- Merchant redemption admin
Privy (Authentication)
PRIVY_APP_ID- Your Privy application IDPRIVY_VKEY- Privy verification key (ES256 public key) for JWT validation
Email (Mailgun)
MAILGUN_API_KEY- Mailgun API keyMAILGUN_DOMAIN- Verified Mailgun sending domainAPP_BASE_URL- Frontend base URL for email links*_ADMIN_EMAIL- Recipients for role request notifications
Ponder Integration
PONDER_SERVER_BASE_URL- Ponder indexer URLPONDER_KEY- Shared secret for authenticating Ponder callbacksPONDER_CALLBACK_URL- Backend endpoint for Ponder webhooks
W9 Compliance
PAID_ADMIN_ADDRESSES- Comma-separated wallet addresses exempt from W9 trackingW9_ADMIN_EMAIL- W9 approval notification recipientW9_SUBMISSION_URL- Public W9 submission form URLW9_LIMIT_WEI/W9_LIMIT_SFLUV- Override $600 threshold for testingW9_WEBHOOK_SECRET- Validate Wordpress webhook calls
TLS Configuration (Optional)
- Backend serves on both HTTP (PORT) and HTTPS (TLS_PORT) when configured
Frontend Environment Variables
Location:frontend/.env
All frontend variables must be prefixed with
NEXT_PUBLIC_ to be accessible in browser code.Privy Authentication
Blockchain Network
CHAIN_NAME- Network identifier for wagmi/viemFACTORY_ADDRESS- Smart account factory contractFAUCET_ADDRESS- SFLUV faucet/treasury addressZAPPER_ADDRESS- Token swap contract
Paymaster (Account Abstraction)
ENGINE_URL- Bundler endpoint for gasless transactionsPAYMASTER_ADDRESS- Paymaster contract (sponsors gas)TOKEN_ADDRESS- SFLUV token contractHONEY_ADDRESS- Underlying HONEY tokenWEB_BURNER_PASSWORD- Password for temporary walletsBYUSD_ADDRESS- Stablecoin for swaps
Google Maps
- Required for merchant location map
Idle Timer
TIMEOUT_SECONDS- Auto-logout after inactivity (default: 10 min)PROMPT_SECONDS- Warning before logout (default: 60 sec)
Token Decimals
Ponder Environment Variables
Location:ponder/.env
RPC Configuration
PONDER_RPC_URL_1- Blockchain RPC endpoint (Alchemy recommended)
Database
- If not provided, SQLite will be used (not recommended for production)
Authentication
- Must match backend
ADMIN_KEYfor webhook authentication
W9 Configuration
PAID_ADMIN_ADDRESSES- Wallets exempt from W9 tracking (must match backend)W9_TRANSACTION_URL- Backend endpoint to POST W9 transactions
Test Environment (Anvil)
Location:scripts/anvil.env
For local blockchain fork testing:
scripts/start_anvil_test.sh and W9 test scripts.
Environment Loading
Backend
- Set
ENV_FILEto override default.envlocation
Frontend
Next.js loads.env.local > .env automatically. No code required.
Ponder
Uses dotenv. Override with shell exports before running:Security Best Practices
Next Steps
Database Schema
Understand the three database structures
Anvil Testing
Test W9 and blockchain flows locally