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
| Name | Default | Description |
|---|---|---|
NODE_ENV | production | Environment mode (development, production) |
PORT | 3000 | Application port |
APP_VERSION | 1.0.0 | Application version |
NEXT_TELEMETRY_DISABLED | 1 | Disable Next.js telemetry |
Database
| Name | Default | Description |
|---|---|---|
DATABASE_URL | — | PostgreSQL connection string with SSL |
API Configuration
| Name | Default | Description |
|---|---|---|
NEXT_PUBLIC_API_BASE_URL | — | Base URL for backend API services |
NEXT_PUBLIC_PUBLIC_ROUTES | /login,/signup,... | Routes accessible without authentication |
Supabase (Authentication)
| Name | Default | Description |
|---|---|---|
SUPABASE_URL | — | Supabase project URL |
SUPABASE_ANON_KEY | — | Supabase anonymous key for client-side operations |
Frappe (Backend ERP)
| Name | Default | Description |
|---|---|---|
FRAPPE_API_TOKEN | — | Frappe API authentication token (key:secret format) |
FRAPPE_BASE_URL | — | Frappe Cloud site URL |
Clinical Trials
| Name | Default | Description |
|---|---|---|
NEXT_PUBLIC_DEFAULT_PRACTITIONER_ID | — | Default practitioner ID for the system |
PRACTITIONER_NAME | — | Default practitioner display name |
NEXT_PUBLIC_STUDY_PARTICIPATION_CONCENT | — | Study participation consent text |
NEXT_PUBLIC_STUDY_PERSONNEL_ROLES | Study Coordinator,Principal Investigator | Comma-separated list of roles that can be added as study personnel |
NEXT_PUBLIC_USER_ROLES | — | Available roles for user management (comma-separated) |
Branding & UI
| Name | Default | Description |
|---|---|---|
NEXT_PUBLIC_LOGO_PREFIX | /i/hb/logo-hb | Logo path prefix (without extension) |
NEXT_PUBLIC_LOGO_EXT | png | Logo file extension |
NEXT_PUBLIC_BRAND_NAME | — | Client brand name (leave blank for unbranded) |
NEXT_PUBLIC_SITE_URL | — | Site URL for SEO |
NEXT_PUBLIC_SITE_DESCRIPTION | — | Site description for SEO |
NEXT_PUBLIC_OG_IMAGE | /og-image.png | OpenGraph image path |
Push Notifications
| Name | Default | Description |
|---|---|---|
FIREBASE_SERVER_KEY | — | Firebase Cloud Messaging server key |
Cube.dev Semantic Layer
Analytics semantic layer providing metrics and dimensions for dashboards.
Database Connection
| Name | Default | Description |
|---|---|---|
CUBEJS_DB_TYPE | postgres | Database type |
CUBEJS_DB_HOST | — | Database host |
CUBEJS_DB_PORT | 5432 | Database port |
CUBEJS_DB_NAME | — | Database name |
CUBEJS_DB_USER | — | Database username |
CUBEJS_DB_PASS | — | Database password |
CUBEJS_DB_SSL | true | Enable SSL connection |
Server Configuration
| Name | Default | Description |
|---|---|---|
PORT | 4000 | Cube.dev server port |
CUBEJS_DEV_MODE | true | Enable development mode |
CUBEJS_API_SECRET | — | API secret key for authentication |
CUBEJS_WEB_SOCKETS | true | Enable WebSocket support |
CUBEJS_SCHEMA_PATH | model | Path to schema files |
Caching
| Name | Default | Description |
|---|---|---|
CUBEJS_CACHE_AND_QUEUE_DRIVER | memory | Cache driver (memory, redis) |
CUBEJS_REDIS_URL | — | Redis connection URL (for production) |
CUBEJS_REDIS_TLS | true | Enable Redis TLS |
Security
| Name | Default | Description |
|---|---|---|
CUBEJS_PLAYGROUND_AUTH_SECRET | — | Playground authentication secret |
CUBEJS_CORS_ORIGIN | — | Allowed CORS origins (comma-separated) |
Logging
| Name | Default | Description |
|---|---|---|
DEBUG_LOG | true | Enable debug logging |
MCP Server
Model Context Protocol server for AI assistant integration.
OpenAI
| Name | Default | Description |
|---|---|---|
OPENAI_API_KEY | — | OpenAI API key |
OPENAI_MODEL | gpt-4o-mini | OpenAI model to use |
Agent Service
| Name | Default | Description |
|---|---|---|
AGENT_HOST | 127.0.0.1 | Agent service host |
AGENT_PORT | 8006 | Agent service port |
Cube.dev Integration
| Name | Default | Description |
|---|---|---|
CUBE_API_URL | http://localhost:4000/cubejs-api/v1 | Cube.dev API endpoint |
CUBE_API_SECRET | — | Cube.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
| Name | Default | Description |
|---|---|---|
DLT_PIPELINE_NAME | hbct_clinical_trial_pipeline | Pipeline name |
DLT_DESTINATION | postgres | Destination type |
DLT_DATASET_NAME | bronze | Target dataset/schema |
PROCESSING_METHOD | async | Processing method |
FRAPPE_BASE_URL | — | Frappe API base URL |
Database Connection
| Name | Default | Description |
|---|---|---|
DB_HOST | localhost | Database host |
DB_PORT | 5432 | Database port |
DB_USER | — | Database username |
DB_PASSWORD | — | Database password |
DB_NAME | ctms | Database name |
DB_SSLMODE | disable | SSL mode |
API Settings
| Name | Default | Description |
|---|---|---|
TABLE_PREFIX | tbl_mst_ | Table name prefix |
PAGE_SIZE | 100 | Records per page |
REQUEST_TIMEOUT | 30 | API timeout in seconds |
MAX_RETRIES | 3 | Maximum retry attempts |
RETRY_BACKOFF_SECONDS | 2 | Retry backoff delay |
CLEANUP_SCHEMAS | raw,bronze,... | Schemas to clean up |
Data Endpoints
| Name | Default | Description |
|---|---|---|
DATALAKE_APIS | — | JSON array of clinical data endpoints |
DATALAKE_APIS_MASTER | — | JSON array of master data endpoints |
DATALAKE_APIS_CRF | — | JSON array of CRF data endpoints |
DBT Pipeline
Data transformation pipeline using dbt for the data warehouse.
Development Database
| Name | Default | Description |
|---|---|---|
DB_HOST | localhost | PostgreSQL host |
DB_PORT | 5432 | PostgreSQL port |
DB_USER | — | PostgreSQL username |
DB_PASSWORD | — | PostgreSQL password |
DB_NAME | ctms | PostgreSQL database name |
Staging Database
| Name | Default | Description |
|---|---|---|
STAGING_DB_HOST | — | Staging database host |
STAGING_DB_USER | — | Staging database username |
STAGING_DB_PASSWORD | — | Staging database password |
STAGING_DB_NAME | — | Staging database name |
Snowflake (Production)
| Name | Default | Description |
|---|---|---|
SNOWFLAKE_ACCOUNT | — | Snowflake account identifier |
SNOWFLAKE_USER | — | Snowflake username |
SNOWFLAKE_PASSWORD | — | Snowflake password |
SNOWFLAKE_ROLE | TRANSFORM | Snowflake role |
SNOWFLAKE_WAREHOUSE | COMPUTE_WH | Snowflake warehouse |
SNOWFLAKE_DATABASE | CLINICAL_TRIALS | Snowflake database |
DBT Settings
| Name | Default | Description |
|---|---|---|
DBT_PROFILES_DIR | . | Profiles directory |
DBT_TARGET | dev | Target environment |
Chat Widget
Embeddable AI chat widget for the platform.
API Configuration
| Name | Default | Description |
|---|---|---|
VITE_API_ENDPOINT | http://127.0.0.1:8006 | MCP server endpoint |
VITE_STREAM_PATH | /chat/stream | Streaming chat path |
VITE_UPLOAD_PATH | /upload | File upload path |
Appearance
| Name | Default | Description |
|---|---|---|
VITE_CHAT_TITLE | AI Assistant | Chat widget title |
VITE_CHAT_SUBTITLE | Online | Chat widget subtitle |
VITE_CHAT_PLACEHOLDER | Type your message... | Input placeholder text |
VITE_CHAT_POSITION | bottom-right | Widget position |
Theme
| Name | Default | Description |
|---|---|---|
VITE_HEADER_COLOR | #4A154B | Header background color |
VITE_ACCENT_COLOR | #611f69 | Accent color |
VITE_USER_BUBBLE_COLOR | — | User message bubble color |
VITE_BOT_ICON | mdi:robot-happy | Bot icon (lucide/mdi or URL) |
VITE_THEME | light | Theme mode (light, dark) |
VITE_BORDER_RADIUS | rounded | Border radius style |
Features
| Name | Default | Description |
|---|---|---|
VITE_ENABLE_FILE_UPLOAD | true | Enable file uploads |
VITE_ENABLE_HTML_RENDERING | true | Enable HTML in responses |