This guide provides quick setup instructions for environment variables in the YieldVault project.
# 1. Backend setup
cd backend
cp .env.local.example .env.local
# Edit .env.local with your values
nano .env.local
# 2. Frontend setup
cd ../frontend
cp .env.local.example .env.local
# Edit .env.local with your values
nano .env.local
# 3. Verify setup
cd ..
./scripts/verify-env-security.sh# 1. Backend setup
cd backend
cp .env.production.example .env.production
# Edit .env.production with production values
nano .env.production
# 2. Frontend setup
cd ../frontend
cp .env.production.example .env.production
# Edit .env.production with production values
nano .env.production
# 3. Verify setup
cd ..
./scripts/verify-env-security.shSTELLAR_RPC_URL=https://soroban-testnet.stellar.org
STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
VAULT_CONTRACT_ID=your-contract-id-hereVITE_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
VITE_STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
VITE_VAULT_CONTRACT_ID=your-contract-id-here- NEVER commit
.envfiles (except.env.example) - Use different secrets for each environment
- Rotate secrets regularly (see schedule in SECURITY_ENV_CHECKLIST.md)
- Verify before deploying using
./scripts/verify-env-security.sh
- Full Setup Guide: ENVIRONMENT_SETUP_GUIDE.md
- Security Checklist: SECURITY_ENV_CHECKLIST.md
- Backend Env Docs: backend/docs/ENVIRONMENT_VARIABLES.md
# Make sure you've set the contract ID in your .env file
echo "VAULT_CONTRACT_ID=your-id" >> backend/.env.local
echo "VITE_VAULT_CONTRACT_ID=your-id" >> frontend/.env.local# Ensure RPC URL and passphrase match
# For testnet:
STELLAR_RPC_URL=https://soroban-testnet.stellar.org
STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
# For mainnet:
STELLAR_RPC_URL=https://soroban-mainnet.stellar.org
STELLAR_NETWORK_PASSPHRASE=Public Global Stellar Network ; September 2015# Add your frontend URL to backend CORS
echo "CORS_ALLOWED_ORIGINS=http://localhost:5173" >> backend/.env.localRun the security verification script:
./scripts/verify-env-security.shThis checks:
- ✓ .env files are gitignored
- ✓ No secrets committed to git
- ✓ No hardcoded secrets in code
- ✓ Proper file structure
- ✓ No secrets in git history
If you need help:
- Check the ENVIRONMENT_SETUP_GUIDE.md
- Review example files (
.env.*.example) - Contact the DevOps team
- Check the troubleshooting section above
Quick Links: