Environment Variables
This page documents all environment variables used by Dharini.
Application Settings
Section titled “Application Settings”NODE_ENV
Section titled “NODE_ENV”Type: string
Required: Yes
Default: development
Values: development, staging, production
Environment mode. Affects SSL configuration, logging, and other behaviors.
NODE_ENV=productionType: number
Required: No
Default: 4000
Port on which the backend API server runs.
PORT=4000Database Configuration
Section titled “Database Configuration”DB_HOST
Section titled “DB_HOST”Type: string
Required: Yes
PostgreSQL database host. For local development, use postgres (Docker service name). For production, use your RDS endpoint.
# DevelopmentDB_HOST=postgres
# ProductionDB_HOST=your-database-instance.xxxxxxxxx.region.rds.amazonaws.comDB_PORT
Section titled “DB_PORT”Type: number
Required: No
Default: 5432
PostgreSQL port.
DB_PORT=5432DB_USERNAME
Section titled “DB_USERNAME”Type: string
Required: Yes
Database username.
DB_USERNAME=postgresDB_PASSWORD
Section titled “DB_PASSWORD”Type: string
Required: Yes
Database password.
DB_PASSWORD=your-secure-passwordDB_DATABASE
Section titled “DB_DATABASE”Type: string
Required: Yes
Database name.
DB_DATABASE=postgresRedis Configuration
Section titled “Redis Configuration”REDIS_HOST
Section titled “REDIS_HOST”Type: string
Required: Yes
Redis host for queue management.
# DockerREDIS_HOST=redis
# External RedisREDIS_HOST=your-redis-host.comREDIS_PORT
Section titled “REDIS_PORT”Type: number
Required: No
Default: 6379
Redis port.
REDIS_PORT=6379AWS S3 Configuration
Section titled “AWS S3 Configuration”S3_REGION
Section titled “S3_REGION”Type: string
Required: Yes
AWS region for S3 bucket.
S3_REGION=ap-south-1S3_BUCKET
Section titled “S3_BUCKET”Type: string
Required: Yes
S3 bucket name for file storage.
S3_BUCKET=dharini-prod-storageS3_ACCESSKEYID
Section titled “S3_ACCESSKEYID”Type: string
Required: Yes
AWS access key ID with S3 permissions.
S3_ACCESSKEYID=AKIAIOSFODNN7EXAMPLES3_SECRETACCESSKEY
Section titled “S3_SECRETACCESSKEY”Type: string
Required: Yes
AWS secret access key.
S3_SECRETACCESSKEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEYS3_ENDPOINT
Section titled “S3_ENDPOINT”Type: string
Required: No
S3 endpoint URL. Use for S3-compatible storage or specific AWS regions.
S3_ENDPOINT=https://s3.ap-south-1.amazonaws.comS3_FOLDER
Section titled “S3_FOLDER”Type: string
Required: No
Default: uploads
Folder prefix for uploaded files in S3.
S3_FOLDER=dharini-prodSecurity
Section titled “Security”JWT_SECRET
Section titled “JWT_SECRET”Type: string
Required: Yes
Secret key for signing JWT tokens. Must be a strong random string in production.
JWT_SECRET=your-super-secret-jwt-key-min-32-charsGenerate a secure secret:
openssl rand -base64 32Email Configuration
Section titled “Email Configuration”Choose one email provider based on your needs.
SendGrid
Section titled “SendGrid”SENDGRID_API_KEY
Section titled “SENDGRID_API_KEY”Type: string
Required: If using SendGrid
SendGrid API key for sending emails.
SENDGRID_API_KEY=SG.xxxxxxxxxxxxxxxxxxxxxGMAIL_USER
Section titled “GMAIL_USER”Type: string
Required: If using Gmail
Gmail email address.
GMAIL_USER=your-email@gmail.comGMAIL_PASS
Section titled “GMAIL_PASS”Type: string
Required: If using Gmail
Gmail app password (not your regular password).
GMAIL_PASS=your-app-passwordEMAIL_FROM
Section titled “EMAIL_FROM”Type: string
Required: Yes
From email address for outgoing emails.
EMAIL_FROM=noreply@dharini.artpark.aiFrontend Configuration
Section titled “Frontend Configuration”NEXT_PUBLIC_API_URL
Section titled “NEXT_PUBLIC_API_URL”Type: string
Required: Yes
Public URL for the API. Used by the frontend to make API calls.
# DevelopmentNEXT_PUBLIC_API_URL=http://localhost:4000/api
# ProductionNEXT_PUBLIC_API_URL=https://in.dharini.artpark.ai/apiNEXT_PUBLIC_APP_ENV
Section titled “NEXT_PUBLIC_APP_ENV”Type: string
Required: Yes
Values: development, staging, production
Frontend environment identifier.
NEXT_PUBLIC_APP_ENV=productionOptional Configuration
Section titled “Optional Configuration”File Upload
Section titled “File Upload”MAX_FILE_ALLOW_UPLOAD
Section titled “MAX_FILE_ALLOW_UPLOAD”Type: number
Default: 5242880 (5MB)
Maximum file size in bytes.
MAX_FILE_ALLOW_UPLOAD=10485760SIGNED_URL_EXPIRY
Section titled “SIGNED_URL_EXPIRY”Type: number
Default: 3600
S3 signed URL expiry time in seconds.
SIGNED_URL_EXPIRY=7200Job Scheduling
Section titled “Job Scheduling”JOB_SCHEDULER
Section titled “JOB_SCHEDULER”Type: boolean
Default: false
Enable background job scheduling.
JOB_SCHEDULER=trueJOB_SCHEDULE_REPEAT_PATTERN
Section titled “JOB_SCHEDULE_REPEAT_PATTERN”Type: string (cron expression)
Default: 0 0 * * *
Cron pattern for scheduled jobs.
JOB_SCHEDULE_REPEAT_PATTERN=0 0 * * *Example .env Files
Section titled “Example .env Files”Development
Section titled “Development”NODE_ENV=developmentDB_HOST=postgresDB_PORT=5432DB_USERNAME=postgresDB_PASSWORD=postgresDB_DATABASE=dhariniREDIS_HOST=redisREDIS_PORT=6379JWT_SECRET=dev-secret-change-in-productionNEXT_PUBLIC_API_URL=http://localhost:4000/apiNEXT_PUBLIC_APP_ENV=developmentProduction
Section titled “Production”NODE_ENV=productionPORT=4000
# DatabaseDB_HOST=your-database-instance.xxxxxxxxx.region.rds.amazonaws.comDB_PORT=5432DB_USERNAME=postgresDB_PASSWORD=your-strong-secure-passwordDB_DATABASE=postgres
# RedisREDIS_HOST=redisREDIS_PORT=6379
# S3S3_REGION=ap-south-1S3_BUCKET=dharini-prod-storageS3_ACCESSKEYID=AKIAIOSFODNN7EXAMPLES3_SECRETACCESSKEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEYS3_ENDPOINT=https://s3.ap-south-1.amazonaws.comS3_FOLDER=dharini-prod
# SecurityJWT_SECRET=generated-strong-random-secret-32-chars-min
# EmailSENDGRID_API_KEY=SG.xxxxxxxxxxxxxxxxxxxxxEMAIL_FROM=noreply@dharini.artpark.ai
# FrontendNEXT_PUBLIC_API_URL=https://in.dharini.artpark.ai/apiNEXT_PUBLIC_APP_ENV=productionSecurity Best Practices
Section titled “Security Best Practices”- Never commit
.envfiles to git - Use strong, unique passwords for all credentials
- Rotate secrets regularly (JWT_SECRET, API keys)
- Use IAM roles instead of access keys when possible
- Restrict S3 bucket access to only necessary IP ranges
- Enable encryption for database and S3
- Use environment-specific values (don’t reuse production secrets in dev)