Skip to main content

Environment Variables

All configuration is driven by a .env file at the monorepo root. Copy .env.example to .env before starting the application.


How Variables Are Loaded

ConsumerMechanism
BackendSpring Boot reads .env via spring.config.import=optional:file:.env[.properties] in application.yml. Local override: backend/.env.
FrontendNext.js loads .env via dotenv in next.config.ts. Local override: frontend/.env.local.
CI/CDVariables are passed as GitHub Actions environment variables (not from .env). Secrets are stored in GitHub repository secrets.
Never commit .env

.env is listed in .gitignore. Never commit real credentials. Use .env.example as the template.


Backend Variables

Database

VariableDefaultDescription
SPRING_DATASOURCE_URLjdbc:postgresql://localhost:5432/nextgenpollJDBC connection URL
SPRING_DATASOURCE_USERNAMEngp_userDatabase username
SPRING_DATASOURCE_PASSWORDngp_local_passDatabase password
SPRING_PROFILES_ACTIVEdevActive Spring profile (dev, prod, test)

Azure Authentication (Resource Server)

VariableDefaultDescription
AZURE_TENANT_IDAzure CIAM tenant ID (used to build JWKS URI)
JWT_JWK_CONNECT_TIMEOUT_MS5000JWKS endpoint connect timeout (ms)
JWT_JWK_READ_TIMEOUT_MS5000JWKS endpoint read timeout (ms)
JWT_JWK_WARMUP_ENABLEDtrueWarm up JWKS cache on startup (false in test profile)

AI Features

VariableDefaultDescription
AZURE_OPENAI_ENDPOINTAzure OpenAI endpoint URL
AZURE_OPENAI_API_KEYAzure OpenAI API key
AZURE_OPENAI_MODELgpt-4oDeployment/model name

Email

VariableDefaultDescription
AZURE_COMMUNICATION_CONNECTION_STRINGAzure Communication Services connection string
AZURE_EMAIL_SENDER[email protected]Sender address

CORS

VariableDefaultDescription
ALLOWED_ORIGINShttp://localhost:3000Comma-separated list of allowed CORS origins

Frontend Variables

All NEXT_PUBLIC_* variables are included in the browser bundle — never put secrets in these.

VariableDefaultDescription
NEXT_PUBLIC_API_URLhttp://localhost:8080Backend REST base URL
NEXT_PUBLIC_WS_URLws://localhost:8080/wsWebSocket endpoint
NEXT_PUBLIC_AZURE_CLIENT_IDMSAL app registration client ID
NEXT_PUBLIC_AZURE_AUTHORITYMSAL authority URL (CIAM tenant)
NEXT_PUBLIC_AZURE_REDIRECT_URIhttp://localhost:3000/auth/callbackOAuth redirect URI
NEXT_PUBLIC_AZURE_POST_LOGOUT_REDIRECT_URIhttp://localhost:3000Post-logout redirect URI
NEXT_PUBLIC_AZURE_API_SCOPEAPI scope for access tokens
NEXT_DEV_ALLOWED_ORIGINSComma-separated dev origins for Next.js (e.g. PowerPoint add-in HTTPS origin)

PowerPoint Add-in Variables

VariableDefaultDescription
NEXTGENPOLL_ADDIN_PROD_URLhttps://nextgenpoll.com/addin/Base URL where add-in assets are served in production

GitHub Actions Secrets

These secrets must be configured in GitHub → Settings → Secrets and Variables → Actions:

SecretUsed ByDescription
AZURE_BACKEND_PUBLISH_PROFILEbackend-cd.ymlAzure App Service publish profile for nextgenpoll-api
AZURE_FRONTEND_PUBLISH_PROFILEfrontend-cd.ymlAzure App Service publish profile for nextgenpoll-web
AZURE_STATIC_WEB_APPS_API_TOKEN_DOCSdocs-cd.ymlAzure Static Web Apps deployment token for nextgenpoll-docs
AZURE_DB_URLbackend-cd.ymlProduction JDBC URL for Flyway migration
AZURE_DB_USERNAMEbackend-cd.ymlProduction DB username for Flyway migration
AZURE_DB_PASSWORDbackend-cd.ymlProduction DB password for Flyway migration
NEXT_PUBLIC_API_URLfrontend-cd.ymlProduction API URL
NEXT_PUBLIC_WS_URLfrontend-cd.ymlProduction WebSocket URL
NEXT_PUBLIC_AZURE_CLIENT_IDfrontend-cd.ymlProduction MSAL client ID
NEXT_PUBLIC_AZURE_AUTHORITYfrontend-cd.ymlProduction MSAL authority
NEXT_PUBLIC_AZURE_REDIRECT_URIfrontend-cd.ymlProduction redirect URI
NEXT_PUBLIC_AZURE_POST_LOGOUT_REDIRECT_URIfrontend-cd.ymlProduction post-logout URI
NEXT_PUBLIC_AZURE_API_SCOPEfrontend-cd.ymlProduction API scope
AZURE_TENANT_IDfrontend-cd.ymlAzure tenant ID (used in build)
NEXTGENPOLL_ADDIN_PROD_URLfrontend-cd.ymlProduction add-in assets URL