Environment Variables Reference
Complete reference of all environment variables used in Agentification Academy.
Frontend Variables (VITE_*)
Frontend environment variables must be prefixed with VITE_ to be accessible in the browser.
Supabase Configuration
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key-here
Purpose: Connect to your Supabase database and authentication Where to find: Supabase Dashboard → Settings → API
Third-Party Services
VITE_CLOUDINARY_CLOUD_NAME=your-cloud-name
VITE_CLOUDINARY_UPLOAD_PRESET=your-upload-preset
VITE_YOUTUBE_API_KEY=your-youtube-api-key
VITE_GA_MEASUREMENT_ID=G-XXXXXXXXXX
Cloudinary: Image hosting and CDN YouTube: Video metadata and thumbnails GA: Google Analytics 4 event tracking
API Configuration
VITE_API_BASE_URL=https://agentification.academy/api
Purpose: Backend API endpoint (defaults to production if not set)
Backend Variables
Backend variables are set in .env or platform environment variables.
Database
DATABASE_URL=postgresql://user:password@db.host:5432/dbname?sslmode=require
Purpose: PostgreSQL connection string for Supabase database
Supabase Service Keys
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
SUPABASE_ANON_KEY=your-anon-key
Note: Service role key should only be used on the backend (it bypasses RLS)
Email Configuration
SMTP_SERVER=smtp.ionos.com
SMTP_PORT=587
SMTP_USERNAME=your-email@domain.com
SMTP_PASSWORD=your-app-password
SMTP_FROM_EMAIL=noreply@agentification.academy
SMTP_FROM_NAME="Agentification Academy"
Purpose: Email sending via SMTP Default Provider: IONOS (configurable)
Environment Profiles
Development (.env.development)
Use local Supabase instance or staging database:
VITE_SUPABASE_URL=https://staging-project.supabase.co
VITE_SUPABASE_ANON_KEY=staging-anon-key
VITE_API_BASE_URL=http://localhost:5001/api
DEBUG=true
Production (.env.production)
Use production Supabase and verified API keys:
VITE_SUPABASE_URL=https://prod-project.supabase.co
VITE_SUPABASE_ANON_KEY=prod-anon-key
VITE_API_BASE_URL=https://agentification.academy/api
DEBUG=false
Setting Environment Variables
Local Development
- Create
.envfile in project root (already in.gitignore) - Add your variables
- Variables load automatically on
npm run dev
# Create from example
cp env.development.example .env
# Edit with your credentials
nano .env
Vercel Deployment
- Go to Vercel project settings
- Settings → Environment Variables
- Add variables for each environment (Preview, Production)
- Redeploy to apply changes
# Deploy to apply new env vars
vercel --prod
Netlify Deployment
- Go to Netlify site settings
- Site Settings → Build & Deploy → Environment
- Add variables
- Trigger new deploy
Security Guidelines
✅ Safe to Expose (Anon Keys)
VITE_SUPABASE_ANON_KEY- Limited by row-level securityVITE_CLOUDINARY_CLOUD_NAME- Public identifierVITE_YOUTUBE_API_KEY- Rate-limited public keyVITE_GA_MEASUREMENT_ID- Public tracking ID
🔒 Never Expose (Backend Only)
SUPABASE_SERVICE_ROLE_KEY- Bypasses all RLS, backend onlySMTP_PASSWORD- Email credentialsDATABASE_URL- Connection string with credentials
⚠️ Best Practices
- Never commit
.envfiles to Git - Use strong, unique values for service keys
- Rotate keys regularly in production
- Use environment-specific values (staging vs prod)
- Restrict IP addresses for API keys where possible
Checking Your Setup
Verify environment variables are loaded:
# Frontend
npm run dev
# Should connect to Supabase successfully
# Backend
python -c "from src.config import config; print('Database:', config.database_url[:50])"
# Should show your database URL
Troubleshooting
"VITE_SUPABASE_URL is not set"
Cause: Missing environment variables
Fix: Create .env file with required variables
cp env.development.example .env
# Edit and add your values
"Cannot connect to database"
Cause: Wrong credentials or database offline Fix:
- Verify
DATABASE_URLis correct - Check Supabase dashboard for database status
- Ensure IP whitelist allows your connection
"Email not sending"
Cause: SMTP configuration invalid Fix:
- Verify SMTP credentials
- Check SMTP_SERVER and SMTP_PORT
- Use app password, not account password
- Verify email not in spam folder
See Development Setup for complete setup instructions.