Skip to main content

Environment Variables

This document provides a comprehensive reference for all environment variables used across the Zynomi CTMS platform. Configure these variables in your .env file for each component.

Unified Environment File

The ctms-data-pipeline-ai-analytics monorepo includes a unified .env.production file that consolidates all data pipeline and AI analytics variables in one place.


CTMS Web Application

The main Next.js web application for clinical trial management.

Application Settings

NameDefaultDescription
NODE_ENVproductionEnvironment mode (development, production)
PORT3000Application port
APP_VERSION1.0.0Application version
NEXT_TELEMETRY_DISABLED1Disable Next.js telemetry

Database

NameDefaultDescription
DATABASE_URLPostgreSQL connection string with SSL

API Configuration

NameDefaultDescription
NEXT_PUBLIC_API_BASE_URLBase URL for backend API services
NEXT_PUBLIC_PUBLIC_ROUTES/login,/signup,...Routes accessible without authentication

Supabase (Authentication)

NameDefaultDescription
SUPABASE_URLSupabase project URL
SUPABASE_ANON_KEYSupabase anonymous key for client-side operations

Frappe (Backend ERP)

NameDefaultDescription
FRAPPE_API_TOKENFrappe API authentication token (key:secret format)
FRAPPE_BASE_URLFrappe Cloud site URL

Clinical Trials

NameDefaultDescription
NEXT_PUBLIC_DEFAULT_PRACTITIONER_IDDefault practitioner ID for the system
PRACTITIONER_NAMEDefault practitioner display name
NEXT_PUBLIC_STUDY_PARTICIPATION_CONCENTStudy participation consent text
NEXT_PUBLIC_STUDY_PERSONNEL_ROLESStudy Coordinator,Principal InvestigatorComma-separated list of roles that can be added as study personnel
NEXT_PUBLIC_USER_ROLESAvailable roles for user management (comma-separated)

Branding & UI

NameDefaultDescription
NEXT_PUBLIC_LOGO_PREFIX/i/hb/logo-hbLogo path prefix (without extension)
NEXT_PUBLIC_LOGO_EXTpngLogo file extension
NEXT_PUBLIC_BRAND_NAMEClient brand name (leave blank for unbranded)
NEXT_PUBLIC_SITE_URLSite URL for SEO
NEXT_PUBLIC_SITE_DESCRIPTIONSite description for SEO
NEXT_PUBLIC_OG_IMAGE/og-image.pngOpenGraph image path

Push Notifications

NameDefaultDescription
FIREBASE_SERVER_KEYFirebase Cloud Messaging server key

Cube.dev Semantic Layer

Analytics semantic layer providing metrics and dimensions for dashboards.

Database Connection

NameDefaultDescription
CUBEJS_DB_TYPEpostgresDatabase type
CUBEJS_DB_HOSTDatabase host
CUBEJS_DB_PORT5432Database port
CUBEJS_DB_NAMEDatabase name
CUBEJS_DB_USERDatabase username
CUBEJS_DB_PASSDatabase password
CUBEJS_DB_SSLtrueEnable SSL connection

Server Configuration

NameDefaultDescription
PORT4000Cube.dev server port
CUBEJS_DEV_MODEtrueEnable development mode
CUBEJS_API_SECRETAPI secret key for authentication
CUBEJS_WEB_SOCKETStrueEnable WebSocket support
CUBEJS_SCHEMA_PATHmodelPath to schema files

Caching

NameDefaultDescription
CUBEJS_CACHE_AND_QUEUE_DRIVERmemoryCache driver (memory, redis)
CUBEJS_REDIS_URLRedis connection URL (for production)
CUBEJS_REDIS_TLStrueEnable Redis TLS

Security

NameDefaultDescription
CUBEJS_PLAYGROUND_AUTH_SECRETPlayground authentication secret
CUBEJS_CORS_ORIGINAllowed CORS origins (comma-separated)

Logging

NameDefaultDescription
DEBUG_LOGtrueEnable debug logging

MCP Server

Model Context Protocol server for AI assistant integration.

OpenAI

NameDefaultDescription
OPENAI_API_KEYOpenAI API key
OPENAI_MODELgpt-4o-miniOpenAI model to use

Agent Service

NameDefaultDescription
AGENT_HOST127.0.0.1Agent service host
AGENT_PORT8006Agent service port

Cube.dev Integration

NameDefaultDescription
CUBE_API_URLhttp://localhost:4000/cubejs-api/v1Cube.dev API endpoint
CUBE_API_SECRETCube.dev API secret (must match CUBEJS_API_SECRET)

Data Ingestion (DLT Hub)

Data pipeline for ingesting clinical trial data from Frappe to the data warehouse.

Pipeline Configuration

NameDefaultDescription
DLT_PIPELINE_NAMEhbct_clinical_trial_pipelinePipeline name
DLT_DESTINATIONpostgresDestination type
DLT_DATASET_NAMEbronzeTarget dataset/schema
PROCESSING_METHODasyncProcessing method
FRAPPE_BASE_URLFrappe API base URL

Database Connection

NameDefaultDescription
DB_HOSTlocalhostDatabase host
DB_PORT5432Database port
DB_USERDatabase username
DB_PASSWORDDatabase password
DB_NAMEctmsDatabase name
DB_SSLMODEdisableSSL mode

API Settings

NameDefaultDescription
TABLE_PREFIXtbl_mst_Table name prefix
PAGE_SIZE100Records per page
REQUEST_TIMEOUT30API timeout in seconds
MAX_RETRIES3Maximum retry attempts
RETRY_BACKOFF_SECONDS2Retry backoff delay
CLEANUP_SCHEMASraw,bronze,...Schemas to clean up

Data Endpoints

NameDefaultDescription
DATALAKE_APISJSON array of clinical data endpoints
DATALAKE_APIS_MASTERJSON array of master data endpoints
DATALAKE_APIS_CRFJSON array of CRF data endpoints

DBT Pipeline

Data transformation pipeline using dbt for the data warehouse.

Development Database

NameDefaultDescription
DB_HOSTlocalhostPostgreSQL host
DB_PORT5432PostgreSQL port
DB_USERPostgreSQL username
DB_PASSWORDPostgreSQL password
DB_NAMEctmsPostgreSQL database name

Staging Database

NameDefaultDescription
STAGING_DB_HOSTStaging database host
STAGING_DB_USERStaging database username
STAGING_DB_PASSWORDStaging database password
STAGING_DB_NAMEStaging database name

Snowflake (Production)

NameDefaultDescription
SNOWFLAKE_ACCOUNTSnowflake account identifier
SNOWFLAKE_USERSnowflake username
SNOWFLAKE_PASSWORDSnowflake password
SNOWFLAKE_ROLETRANSFORMSnowflake role
SNOWFLAKE_WAREHOUSECOMPUTE_WHSnowflake warehouse
SNOWFLAKE_DATABASECLINICAL_TRIALSSnowflake database

DBT Settings

NameDefaultDescription
DBT_PROFILES_DIR.Profiles directory
DBT_TARGETdevTarget environment

Chat Widget

Embeddable AI chat widget for the platform.

API Configuration

NameDefaultDescription
VITE_API_ENDPOINThttp://127.0.0.1:8006MCP server endpoint
VITE_STREAM_PATH/chat/streamStreaming chat path
VITE_UPLOAD_PATH/uploadFile upload path

Appearance

NameDefaultDescription
VITE_CHAT_TITLEAI AssistantChat widget title
VITE_CHAT_SUBTITLEOnlineChat widget subtitle
VITE_CHAT_PLACEHOLDERType your message...Input placeholder text
VITE_CHAT_POSITIONbottom-rightWidget position

Theme

NameDefaultDescription
VITE_HEADER_COLOR#4A154BHeader background color
VITE_ACCENT_COLOR#611f69Accent color
VITE_USER_BUBBLE_COLORUser message bubble color
VITE_BOT_ICONmdi:robot-happyBot icon (lucide/mdi or URL)
VITE_THEMElightTheme mode (light, dark)
VITE_BORDER_RADIUSroundedBorder radius style

Features

NameDefaultDescription
VITE_ENABLE_FILE_UPLOADtrueEnable file uploads
VITE_ENABLE_HTML_RENDERINGtrueEnable HTML in responses