Environment Variables¶
This document lists all environment variables used by the BidScript backend application. These variables control configuration settings and must be properly set for the application to function correctly.
Core Configuration¶
PORT: The port on which the application server listens (default: 3000)NODE_ENV: Environment mode (development,production,test)HOST: The host address for the applicationAPI_PREFIX: Prefix for all API routes (default:/api)LOG_LEVEL: Logging verbosity level (error,warn,info,verbose,debug)
Authentication¶
JWT_SECRET: Secret key used for JWT token signingJWT_EXPIRATION: JWT token expiration time (e.g.,8h,1d)REFRESH_TOKEN_SECRET: Secret for refresh tokensREFRESH_TOKEN_EXPIRATION: Refresh token expiration time
Database Connections¶
MongoDB¶
MONGODB_URI: MongoDB connection string URIMONGODB_DATABASE: MongoDB database name
SQL Database¶
SQL_SERVER: SQL Server hostnameSQL_DATABASE: SQL database nameSQL_USER: SQL usernameSQL_PASSWORD: SQL passwordSQL_PORT: SQL Server port (default: 1433)
Redis¶
REDIS_HOST: Redis server hostnameREDIS_PORT: Redis server port (default: 6379)REDIS_PASSWORD: Redis server passwordREDIS_DB: Redis database index
Azure Services¶
Azure Blob Storage¶
AZURE_STORAGE_CONNECTION_STRING: Azure Storage connection stringAZURE_STORAGE_ACCOUNT_NAME: Azure Storage account nameAZURE_STORAGE_ACCOUNT_KEY: Azure Storage account access keyAZURE_STORAGE_CONTAINER: Azure Blob Storage container name
Azure OpenAI¶
AZURE_OPENAI_API_KEY: Azure OpenAI API keyAZURE_OPENAI_ENDPOINT: Azure OpenAI endpoint URLAZURE_OPENAI_API_VERSION: Azure OpenAI API versionAZURE_OPENAI_DEPLOYMENT_NAME: Azure OpenAI deployment name
Azure Form Recognizer¶
AZURE_FORM_RECOGNIZER_KEY: Azure Form Recognizer keyAZURE_FORM_RECOGNIZER_ENDPOINT: Azure Form Recognizer endpoint URL
Azure Computer Vision¶
AZURE_COMPUTER_VISION_KEY: Azure Computer Vision keyAZURE_COMPUTER_VISION_ENDPOINT: Azure Computer Vision endpoint URL
AI Models¶
Anthropic¶
ANTHROPIC_API_KEY: Anthropic API key for Claude models
LangChain¶
LANGCHAIN_TRACING_V2: Enable LangChain tracing (true,false)LANGCHAIN_ENDPOINT: LangChain API endpointLANGCHAIN_API_KEY: LangChain API keyLANGCHAIN_PROJECT: LangChain project name
Vector Database¶
PINECONE_API_KEY: Pinecone API keyPINECONE_ENVIRONMENT: Pinecone environmentPINECONE_INDEX: Pinecone index name
Document Processing¶
MAX_DOCUMENT_SIZE: Maximum allowed document size in bytesMAX_CONCURRENT_JOBS: Maximum number of concurrent document processing jobsPARSE_CHUNK_SIZE: Size of chunks for document parsingCHUNK_OVERLAP: Overlap between document chunks
Monitoring and Logging¶
GRAFANA_API_KEY: Grafana API keyGRAFANA_URL: Grafana instance URLMETRICS_PATH: Path for exposing Prometheus metrics
Security¶
CORS_ORIGINS: Allowed CORS origins (comma-separated list)RATE_LIMIT_WINDOW: Rate limiting window in millisecondsRATE_LIMIT_MAX: Maximum requests per windowHELMET_ENABLED: Enable Helmet security middleware (true,false)
WebSockets¶
WS_PORT: WebSocket server port (if different from main port)WS_PATH: WebSocket endpoint pathWS_HEARTBEAT_INTERVAL: WebSocket heartbeat interval in milliseconds
Email Notifications¶
SMTP_HOST: SMTP server hostnameSMTP_PORT: SMTP server portSMTP_USER: SMTP server usernameSMTP_PASSWORD: SMTP server passwordEMAIL_FROM: Sender email address
Example .env File¶
# Core Configuration
PORT=3000
NODE_ENV=development
API_PREFIX=/api
# Authentication
JWT_SECRET=your-secret-key
JWT_EXPIRATION=8h
# MongoDB Connection
MONGODB_URI=mongodb://localhost:27017
MONGODB_DATABASE=bidscript
# Redis Connection
REDIS_HOST=localhost
REDIS_PORT=6379
# Azure Services
AZURE_STORAGE_CONNECTION_STRING=your-connection-string
AZURE_STORAGE_CONTAINER=documents
AZURE_OPENAI_API_KEY=your-api-key
AZURE_OPENAI_ENDPOINT=https://your-instance.openai.azure.com
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4
# AI Models
ANTHROPIC_API_KEY=your-api-key
# Vector Database
PINECONE_API_KEY=your-api-key
PINECONE_ENVIRONMENT=us-west1-gcp
PINECONE_INDEX=bidscript-index
# Security
CORS_ORIGINS=http://localhost:3000,https://app.bidscript.co.uk
Setting Environment Variables¶
In Development¶
Create a .env file in the root directory of the project with the required variables.
In Production¶
Configure environment variables according to your deployment platform:
- Docker: Use environment variables in your
docker-compose.ymlor Dockerfile - Azure: Configure application settings in the Azure Portal
- Kubernetes: Use ConfigMaps and Secrets to manage environment variables