Overview
Environment variables are split between three locations:- Backend -
.envfile inbackend/directory - Frontend -
.env.localfile infrontend/directory - Modal - Secrets stored in Modal for serverless containers
Backend Variables
These variables are defined inbackend/.env and loaded by config.py.
AI & Processing
API key for Groq AI inference service. Used for both code analysis and refactoring with Llama models.Where to get: console.groq.comModels used:
llama-3.1-8b-instant- Fast file analysisllama-3.3-70b-versatile- High-quality code refactoring
API key for Anthropic’s Claude models (optional fallback).Where to get: console.anthropic.comStatus: Not currently used in production but available for future features.
Database
URL for your Supabase project. Used for real-time progress updates and session management.Where to get: app.supabase.com → Project Settings → APIFormat:
https://your-project.supabase.coService role key for Supabase. Use the service role key, not the anon key for backend operations.Where to get: app.supabase.com → Project Settings → API → service_role key
GitHub
Client ID for your GitHub OAuth application. Used for user authentication.Where to get: Create an OAuth app at github.com/settings/developersOAuth App Settings:
- Homepage URL:
http://localhost:3000(dev) orhttps://yourdomain.com(prod) - Callback URL:
http://localhost:3000/auth/callback(dev) orhttps://yourdomain.com/auth/callback(prod)
Client secret for your GitHub OAuth application.Where to get: Same location as Client ID. Generate a new secret if needed.
Personal access token for GitHub API operations (creating forks, PRs, pushing code).Where to get: github.com/settings/tokens → Generate new token (classic)Required scopes:
repo- Full control of private repositoriesworkflow- Update GitHub Actions workflows (if needed)
Security
Secret key for signing JWT tokens. Used for session management and API authentication.How to generate:Or use Python:
Server Configuration
Port for the FastAPI backend server.
URL of the frontend application. Used for CORS configuration.Development:
http://localhost:3000Production: Your Vercel deployment URL (e.g., https://dependify.vercel.app)Rate Limiting
Maximum requests per minute per IP address.
Maximum requests per hour per IP address. Applied to the
/update endpoint.Frontend Variables
These variables are defined infrontend/.env.local. All frontend variables must start with NEXT_PUBLIC_ to be available in the browser.
Same GitHub OAuth Client ID used in the backend. Required for initiating OAuth flow.
URL of the backend API.Development:
http://localhost:5001Production: Your Render deployment URL (e.g., https://dependify-api.onrender.com)Same Supabase URL used in the backend. Required for real-time subscriptions.
Supabase anonymous key for frontend. Use the anon key, not the service role key.Where to get: app.supabase.com → Project Settings → API → anon public key
The anon key is safe to expose in frontend code. It has limited permissions controlled by Row Level Security (RLS) policies.
Modal Secrets
Modal containers require secrets to be configured separately using the Modal CLI. These secrets are injected as environment variables when containers run.Modal secrets must use the exact same values as your backend
.env file for Groq and Supabase variables.Configuration Validation
The backend automatically validates required environment variables on startup:Environment-Specific Configuration
Development
Production
Security Best Practices
Never commit secrets
Add
.env and .env.local to .gitignore. Use .env.example for documentation.Use different keys per environment
Generate separate API keys for development and production.
Rotate tokens regularly
Regenerate GitHub tokens and API keys periodically for security.
Limit token scopes
Only grant the minimum required permissions to each token.
Troubleshooting
Configuration validation fails
Configuration validation fails
If you see missing environment variable warnings:
- Verify the
.envfile exists in the correct directory - Check for typos in variable names (they’re case-sensitive)
- Ensure there are no spaces around the
=sign - Restart the server after making changes
Modal secrets not loading
Modal secrets not loading
If containers can’t access secrets:
- Run
modal secret listto verify secrets exist - Check that secret names match exactly:
GROQ_API_KEY,SUPABASE_URL,SUPABASE_KEY - Redeploy containers after creating/updating secrets
- View container logs in Modal dashboard for detailed error messages
CORS errors
CORS errors
If you see CORS errors in the browser:
- Verify
FRONTEND_URLin backend matches your frontend URL exactly - For production, use the full domain (e.g.,
https://dependify.vercel.app) - No trailing slash in URLs
- Restart backend after changing CORS settings
Next Steps
Setup Guide
Complete local development setup
Deployment
Deploy to production