Skip to main content

Environment Configuration

OpenATS requires environment variables for authentication, storage, email delivery, AI features, and external integrations.

Copy the example files below and replace the placeholder values with your own configuration.

Backend Environment

Create:

backend/.env
DATABASE_URL=postgresql://username:password@localhost:5432/openats

R2_ENDPOINT=
R2_ACCESS_KEY_ID=
R2_SECRET_ACCESS_KEY=
R2_BUCKET_NAME=
R2_PUBLIC_URL=

RESEND_API_KEY=
RESEND_FROM_EMAIL=

ASGARDEO_JWKS_URL=
ASGARDEO_ISSUER=

GEMINI_API_KEY=

PORT=8080

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=

GOOGLE_SERVICE_ACCOUNT_JSON=
GOOGLE_CALENDAR_ID=

Frontend Environment

Create:

web/.env.local
NEXT_PUBLIC_ASGARDEO_BASE_URL=""
NEXT_PUBLIC_ASGARDEO_CLIENT_ID=""
ASGARDEO_CLIENT_SECRET=""

NEXT_PUBLIC_ASGARDEO_SCOPES="openid profile email offline_access internal_role_mgt_delete internal_role_mgt_groups_update internal_role_mgt_meta_create internal_role_mgt_meta_update internal_role_mgt_users_update internal_role_mgt_view internal_user_mgt_create internal_user_mgt_delete internal_user_mgt_list internal_user_mgt_update internal_user_mgt_view"

ASGARDEO_SECRET=""
ASGARDEO_CLIENT_ID=""

NEXT_PUBLIC_ASGARDEO_SIGN_IN_URL=""

ASGARDEO_SUPER_ADMIN_ROLE_ID=""
ASGARDEO_HIRING_MANAGER_ROLE_ID=""
ASGARDEO_INTERVIEWER_ROLE_ID=""

OPENATS_API_URL=http://localhost:8080
NEXT_PUBLIC_API_URL=http://localhost:8080

Variable Reference

Database

VariableDescription
DATABASE_URLPostgreSQL database connection string

Cloudflare R2

VariableDescription
R2_ENDPOINTR2 bucket endpoint URL
R2_ACCESS_KEY_IDR2 access key
R2_SECRET_ACCESS_KEYR2 secret key
R2_BUCKET_NAMEBucket name used for file storage
R2_PUBLIC_URLPublic URL used to access uploaded files

Email

VariableDescription
RESEND_API_KEYResend API key
RESEND_FROM_EMAILVerified sender email address

Asgardeo (Backend)

VariableDescription
ASGARDEO_JWKS_URLJWKS endpoint used to validate tokens
ASGARDEO_ISSUERAsgardeo issuer URL

AI

VariableDescription
GEMINI_API_KEYGemini API key used for AI features

Google Calendar

VariableDescription
GOOGLE_CLIENT_IDGoogle OAuth client ID
GOOGLE_CLIENT_SECRETGoogle OAuth client secret
GOOGLE_REDIRECT_URIOAuth redirect URI
GOOGLE_SERVICE_ACCOUNT_JSONService account credentials
GOOGLE_CALENDAR_IDCalendar identifier

Asgardeo (Frontend)

VariableDescription
NEXT_PUBLIC_ASGARDEO_BASE_URLAsgardeo tenant base URL
NEXT_PUBLIC_ASGARDEO_CLIENT_IDSPA application client ID
ASGARDEO_CLIENT_SECRETApplication client secret
ASGARDEO_SECRETSecret used by authentication layer
ASGARDEO_CLIENT_IDInternal application client ID
NEXT_PUBLIC_ASGARDEO_SIGN_IN_URLAuthentication sign-in URL

Role Configuration

VariableDescription
ASGARDEO_SUPER_ADMIN_ROLE_IDSuper Admin role ID
ASGARDEO_HIRING_MANAGER_ROLE_IDHiring Manager role ID
ASGARDEO_INTERVIEWER_ROLE_IDInterviewer role ID

API Configuration

VariableDescription
OPENATS_API_URLBackend API URL
NEXT_PUBLIC_API_URLPublic API URL exposed to the frontend

Next Steps

After configuring the environment variables, continue to the Quick Start guide.