Overview
Interview Simulator is configured through environment variables defined in a.env file. The application uses python-dotenv to load these variables at startup.
Configuration File
Configuration is managed by theConfig class in app/config.py:
app/config.py
Environment Variables
Flask Core Settings
Secret key used for Flask session signing and security features.
Flask environment mode. Controls debug mode and error handling.Values:
development: Enables debug mode, auto-reload, and verbose errorsproduction: Disables debug mode and optimizes for performance
File Upload Settings
Directory path where uploaded CV/resume files are stored.The application creates this directory automatically if it doesn’t exist.
Maximum allowed file upload size in bytes.Default: 16MB (16 * 1024 * 1024)Example values:
5242880= 5MB26214400= 25MB52428800= 50MB
Database Settings
SQLAlchemy database connection string.SQLite (default):PostgreSQL:MySQL:The application automatically creates tables on first run using SQLAlchemy migrations.
AI Provider Settings
Google Gemini API key for AI-powered interview questions and feedback.Get your API key from: https://ai.google.dev/Default model:
gemini-2.5-flashIf not set, the Gemini provider will not be initialized.OpenRouter API key for accessing multiple LLM providers through a unified interface.Get your API key from: https://openrouter.ai/Default model:
openai/gpt-oss-20b:freeIf not set, the OpenRouter provider will not be initialized.Comma-separated list of AI providers to enable.Values:Note: Providers are only enabled if their corresponding API key is set.
openrouter: Enable OpenRoutergemini: Enable Google Gemini
Example Configuration
Development
.env
Production
.env
Configuration Loading
The configuration is loaded at application startup:- Environment variables set in the shell
- Variables defined in
.envfile - Default values in
Configclass
Validation
Required Settings
The following settings must be configured for production:At least one AI provider
Either
GEMINI_API_KEY or OPENROUTER_API_KEY must be set. The application logs a warning if no providers are configured:app/extensions.py
Runtime Checks
The application performs validation during initialization inapp/extensions.py:
app/extensions.py
SQLAlchemy Settings
Internal SQLAlchemy setting. Automatically set from
DATABASE_URL.SQLAlchemy event system. Always set to
False to avoid overhead.This setting is hardcoded in the Config class:Configuration Best Practices
- Never commit
.envfiles: The.envfile is gitignored and should never be committed to version control - Use
.env.exampleas a template: Copy.env.exampleto.envand fill in actual values - Rotate secrets regularly: Change
SECRET_KEYand API keys periodically - Use environment-specific configs: Maintain separate
.envfiles for dev/staging/prod - Validate on startup: The application logs configuration status on initialization
Troubleshooting
”No AI providers configured” warning
Cause: NeitherGEMINI_API_KEY nor OPENROUTER_API_KEY is set.
Solution: Set at least one API key in your .env file.
Database connection errors
Cause: InvalidDATABASE_URL format or unreachable database server.
Solution: Verify connection string format and network connectivity:
File upload 413 errors
Cause: Uploaded file exceedsMAX_CONTENT_LENGTH.
Solution: Increase the limit or reduce file size: