Overview
GenLayer Points uses environment variables for configuration. In development, these are stored in.env files. In production, they’re stored in AWS Systems Manager Parameter Store.
Backend Environment Variables
Location:backend/.env
Django Configuration
Django secret key for cryptographic signing. Generate with:Production: Must be kept secret and unique per environment
Enable Django debug mode. Shows detailed error pages.Values:
True- Development onlyFalse- Production (required)
Comma-separated list of domains that can access the backend.Example:Production:
Database Configuration
PostgreSQL connection string. If empty, SQLite is used (development only).Format:Example:Development: Leave empty to use SQLiteProduction: Required - use RDS PostgreSQL
CORS & CSRF Configuration
Comma-separated list of frontend URLs allowed to make API requests.Example:
Must include
http:// or https:// protocolComma-separated list of trusted origins for CSRF protection.Example:
Authentication Configuration
Domain name for Sign-In With Ethereum messages.Example:Production:
Must match the domain where frontend is hosted (no protocol)
Blockchain Configuration
Ethereum address of the Staking.sol validator contract.Example:
This is the contract used for validator verification and node upgrade tracking
RPC endpoint for the GenLayer blockchain.Default:Used for:
- Fetching validator list
- Verifying node versions
- Checking contract state
Ethereum address of the ValidatorWalletFactory.sol contract.Example:
reCAPTCHA Configuration
Google reCAPTCHA v2 site key for spam prevention on contribution submissions.Get keys: https://www.google.com/recaptcha/adminSelect: reCAPTCHA v2 → “I’m not a robot” CheckboxDevelopment (test key):
Test key always passes validation - use for development only
Google reCAPTCHA v2 secret key.Development (test key):Production: Generate real keys at https://www.google.com/recaptcha/admin
GitHub OAuth Configuration
GitHub OAuth App client secret.
GitHub repository that users must star for certain contributions.Example:
Encryption key for storing GitHub access tokens.Generate with:
Optional Configuration
Backend URL for constructing OAuth callback URLs.Production:
Frontend URL for OAuth redirects.Production:
Cloudinary cloud name for image uploads (optional).Sign up: https://cloudinary.com
Cloudinary API key.
Cloudinary API secret.
Authentication token for cron job endpoints.Generate a random string:
Complete Backend .env Example
Frontend Environment Variables
Location:frontend/.env
API Configuration
Backend API base URL.Development:Production:
Must NOT include trailing slash
Application Configuration
Application name displayed in UI.
Application description for meta tags.
Blockchain Configuration
GenLayer blockchain RPC endpoint (same as backend).
Validator contract address (same as backend).
Blockchain explorer URL for linking to transactions.
Analytics & Monitoring
Google Analytics measurement ID.Development:Production:
reCAPTCHA Configuration
Google reCAPTCHA v2 site key (same as backend public key).Development (test key):Production: Use the same site key as
RECAPTCHA_PUBLIC_KEY in backendComplete Frontend .env Example
AWS Parameter Store
Naming Convention
- Production
- Development
Prefix:
/tally/prod/Example:Adding Parameters
Retrieving Parameters
Deleting Parameters
Environment-Specific Configuration
Development Environment
Development Checklist
Development Checklist
-
DEBUG=True - SQLite database (no
DATABASE_URL) - Localhost in
ALLOWED_HOSTSandCORS_ALLOWED_ORIGINS - Test reCAPTCHA keys
-
VITE_API_URL=http://localhost:8000 - No secrets in version control
Production Environment
Production Checklist
Production Checklist
-
DEBUG=False(critical!) - PostgreSQL
DATABASE_URLfrom RDS - Production domains in
ALLOWED_HOSTS - HTTPS URLs in
CORS_ALLOWED_ORIGINSandCSRF_TRUSTED_ORIGINS - Real reCAPTCHA keys
- Strong
SECRET_KEY - All secrets in AWS Parameter Store
-
VITE_API_URLpoints to App Runner - SSL certificate configured
Security Best Practices
Never Commit Secrets
Add
.env to .gitignore. Never commit API keys, passwords, or secret keys to version control.Use Strong Keys
Generate cryptographically secure keys:
Rotate Credentials
Regularly rotate:
- Database passwords
- API keys
- OAuth secrets
Use Parameter Store
Store production secrets in AWS Parameter Store with encryption, not in environment files.
Troubleshooting
Environment Variables Not Loading
Problem: App can’t find environment variables Solutions:Check file location
.env must be in the same directory as manage.py (backend) or package.json (frontend)CORS Errors in Production
Problem: Frontend can’t connect to backend Solution: Ensure matching configurations:reCAPTCHA Validation Failing
Problem: Contribution submissions rejected Solutions:- Verify
RECAPTCHA_PUBLIC_KEYmatchesVITE_RECAPTCHA_SITE_KEY - Check keys are for reCAPTCHA v2 (not v3)
- Ensure domain is registered in reCAPTCHA admin
- Test with Google’s test keys first
Database Connection Failed
Problem: Can’t connect to PostgreSQL Solutions:- Verify
DATABASE_URLformat:postgresql://user:pass@host:5432/db - Check RDS security group allows connections
- Verify VPC connector is configured (App Runner)
- Test connection with
psqlcommand:
Additional Resources
Backend Setup
Django backend configuration
Frontend Setup
Svelte frontend configuration
Deployment
AWS deployment guide
Authentication
SIWE authentication setup