Environment Configuration
This document details all environment variables and configuration settings used in the STO Education Platform.Environment Variables Overview
The platform uses environment variables for configuration, secrets management, and feature flags. All sensitive data is stored securely and accessed through environment variables.Frontend Environment Variables
Core Configuration
Third-Party Integrations
Feature Flags
Backend Environment Variables (Supabase)
Database Configuration
Authentication
Email Service
Payment Processing
Environment File Structure
Development Environment
File:.env.local (not committed to git)
Production Environment
File: Environment variables set in deployment platform (Vercel)Environment Variable Usage
Frontend Usage
Type Safety
Configuration Management
Environment-Specific Configs
Runtime Configuration
Security Considerations
Sensitive Data Protection
- Never Commit Secrets: Environment files with secrets are gitignored
- Use VITE_ Prefix: Only variables with
VITE_prefix are exposed to frontend - Server-Side Secrets: Backend secrets are kept server-side only
- Environment Validation: Validate required variables at startup
Environment Validation
Deployment Configuration
Vercel Deployment
Environment variables are configured in Vercel dashboard:- Production Variables: Set in Vercel project settings
- Preview Variables: Set for preview deployments
- Development Variables: Set for local development
Build-Time Variables
Feature Flags
Dynamic Feature Control
Runtime Feature Detection
Environment Setup Guide
Development Setup
- Copy Environment Template:
-
Configure Variables:
- Update Supabase credentials
- Set third-party API keys
- Configure feature flags
- Validate Configuration:
Production Setup
- Set Environment Variables in deployment platform
- Configure Secrets for sensitive data
- Test Configuration in staging environment
- Deploy with validated configuration
Troubleshooting
Common Issues
-
Missing Environment Variables:
- Check
.env.localfile exists - Verify variable names match exactly
- Ensure
VITE_prefix for frontend variables
- Check
-
Type Errors:
- Update
ImportMetaEnvinterface - Check variable types in configuration
- Update
-
Build Failures:
- Validate all required variables are set
- Check for typos in variable names
Debug Environment
Related Documentation
- Build Configuration - Build and deployment setup
- Package Configuration - Dependencies and scripts
- Supabase Integration - Backend configuration
- Third-Party Integrations - External service configuration