Environment Configuration
GCMS uses multiple .env files to separate concerns. These files are not
committed to version control and must be obtained from an existing team member
before running the application.
Required files
Place the following files in the project root alongside server.js:
.env.developmentSupabase connection string and storage configuration for the development database. Used when running
npm run dev..env.productionSupabase connection string and storage configuration for the production database. Used when running
npm run prod..env.testConnection details for the test database. Used when running
npm testornpm run test-all(which setNODE_ENV=test)..env.authMicrosoft Azure OAuth credentials, including
CLIENT_IDandCLIENT_SECRET..env.session-secretA shared session secret key used by Express to sign session cookies.
.env.geminiGoogle Gemini API credentials for the in-app AI assistant.
.env.mailconfigMailtrap SMTP credentials used by Nodemailer to send notification emails.
Expected variables
The following variables are read from each file:
.env.development/.env.production/.env.testDB_URL— full PostgreSQL connection string for thenode-postgrespoolSUPABASE_URL— Supabase project URLSUPABASE_SERVICE_ROLE_KEY— Supabase service role key, used server-side for storage operationsSUPABASE_SHARED_FOLDERS_BUCKET— name of the Supabase Storage bucket used for project file uploads
.env.authCLIENT_ID— Azure App Registration client IDCLIENT_SECRET— Azure App Registration client secret
.env.session-secretSESSION_SECRET— any long random string
.env.geminiGEMINI_API_KEY— Google AI Studio API key
.env.mailconfigMAILTRAP_HOST— SMTP hostMAILTRAP_PORT— SMTP portMAILTRAP_USER— SMTP usernameMAILTRAP_PASS— SMTP passwordEMAIL_FROM— optional sender address
Optional variables
MAX_UPLOAD_BYTESOverride for the maximum file size allowed in shared folder uploads. Defaults to
10485760(10 MB) if not set.
Obtaining credentials
All developers working on GCMS share the same set of environment files. Contact an existing team member to receive them before attempting to run the application locally.
If you are setting up GCMS independently, you will need to provision your own resources:
One or more Supabase projects (development, production, and test), with a Storage bucket created in each and the schema applied (see Database Setup)
An Azure App Registration with the required scopes (see External Integrations)
A Google AI Studio API key for Gemini access
A Mailtrap account or another SMTP provider
Warning
Never commit any .env file to version control. All env files
are covered by .gitignore. The Supabase service role key in
particular bypasses all row-level security and must be kept secret.