Skip to main content

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

  1. Create .env file in project root (already in .gitignore)
  2. Add your variables
  3. Variables load automatically on npm run dev
# Create from example
cp env.development.example .env

# Edit with your credentials
nano .env

Vercel Deployment

  1. Go to Vercel project settings
  2. SettingsEnvironment Variables
  3. Add variables for each environment (Preview, Production)
  4. Redeploy to apply changes
# Deploy to apply new env vars
vercel --prod

Netlify Deployment

  1. Go to Netlify site settings
  2. Site SettingsBuild & DeployEnvironment
  3. Add variables
  4. Trigger new deploy

Security Guidelines

✅ Safe to Expose (Anon Keys)

  • VITE_SUPABASE_ANON_KEY - Limited by row-level security
  • VITE_CLOUDINARY_CLOUD_NAME - Public identifier
  • VITE_YOUTUBE_API_KEY - Rate-limited public key
  • VITE_GA_MEASUREMENT_ID - Public tracking ID

🔒 Never Expose (Backend Only)

  • SUPABASE_SERVICE_ROLE_KEY - Bypasses all RLS, backend only
  • SMTP_PASSWORD - Email credentials
  • DATABASE_URL - Connection string with credentials

⚠️ Best Practices

  1. Never commit .env files to Git
  2. Use strong, unique values for service keys
  3. Rotate keys regularly in production
  4. Use environment-specific values (staging vs prod)
  5. 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:

  1. Verify DATABASE_URL is correct
  2. Check Supabase dashboard for database status
  3. Ensure IP whitelist allows your connection

"Email not sending"

Cause: SMTP configuration invalid Fix:

  1. Verify SMTP credentials
  2. Check SMTP_SERVER and SMTP_PORT
  3. Use app password, not account password
  4. Verify email not in spam folder

See Development Setup for complete setup instructions.