Skip to content

Environment Variables

This page documents all environment variables used by Dharini.

Type: string Required: Yes Default: development Values: development, staging, production

Environment mode. Affects SSL configuration, logging, and other behaviors.

NODE_ENV=production

Type: number Required: No Default: 4000

Port on which the backend API server runs.

PORT=4000

Type: string Required: Yes

PostgreSQL database host. For local development, use postgres (Docker service name). For production, use your RDS endpoint.

# Development
DB_HOST=postgres
# Production
DB_HOST=your-database-instance.xxxxxxxxx.region.rds.amazonaws.com

Type: number Required: No Default: 5432

PostgreSQL port.

DB_PORT=5432

Type: string Required: Yes

Database username.

DB_USERNAME=postgres

Type: string Required: Yes

Database password.

DB_PASSWORD=your-secure-password

Type: string Required: Yes

Database name.

DB_DATABASE=postgres

Type: string Required: Yes

Redis host for queue management.

# Docker
REDIS_HOST=redis
# External Redis
REDIS_HOST=your-redis-host.com

Type: number Required: No Default: 6379

Redis port.

REDIS_PORT=6379

Type: string Required: Yes

AWS region for S3 bucket.

S3_REGION=ap-south-1

Type: string Required: Yes

S3 bucket name for file storage.

S3_BUCKET=dharini-prod-storage

Type: string Required: Yes

AWS access key ID with S3 permissions.

S3_ACCESSKEYID=AKIAIOSFODNN7EXAMPLE

Type: string Required: Yes

AWS secret access key.

S3_SECRETACCESSKEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

Type: string Required: No

S3 endpoint URL. Use for S3-compatible storage or specific AWS regions.

S3_ENDPOINT=https://s3.ap-south-1.amazonaws.com

Type: string Required: No Default: uploads

Folder prefix for uploaded files in S3.

S3_FOLDER=dharini-prod

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-chars

Generate a secure secret:

Terminal window
openssl rand -base64 32

Choose one email provider based on your needs.

Type: string Required: If using SendGrid

SendGrid API key for sending emails.

SENDGRID_API_KEY=SG.xxxxxxxxxxxxxxxxxxxxx

Type: string Required: If using Gmail

Gmail email address.

GMAIL_USER=your-email@gmail.com

Type: string Required: If using Gmail

Gmail app password (not your regular password).

GMAIL_PASS=your-app-password

Type: string Required: Yes

From email address for outgoing emails.

EMAIL_FROM=noreply@dharini.artpark.ai

Type: string Required: Yes

Public URL for the API. Used by the frontend to make API calls.

# Development
NEXT_PUBLIC_API_URL=http://localhost:4000/api
# Production
NEXT_PUBLIC_API_URL=https://in.dharini.artpark.ai/api

Type: string Required: Yes Values: development, staging, production

Frontend environment identifier.

NEXT_PUBLIC_APP_ENV=production

Type: number Default: 5242880 (5MB)

Maximum file size in bytes.

MAX_FILE_ALLOW_UPLOAD=10485760

Type: number Default: 3600

S3 signed URL expiry time in seconds.

SIGNED_URL_EXPIRY=7200

Type: boolean Default: false

Enable background job scheduling.

JOB_SCHEDULER=true

Type: string (cron expression) Default: 0 0 * * *

Cron pattern for scheduled jobs.

JOB_SCHEDULE_REPEAT_PATTERN=0 0 * * *
NODE_ENV=development
DB_HOST=postgres
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE=dharini
REDIS_HOST=redis
REDIS_PORT=6379
JWT_SECRET=dev-secret-change-in-production
NEXT_PUBLIC_API_URL=http://localhost:4000/api
NEXT_PUBLIC_APP_ENV=development
NODE_ENV=production
PORT=4000
# Database
DB_HOST=your-database-instance.xxxxxxxxx.region.rds.amazonaws.com
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=your-strong-secure-password
DB_DATABASE=postgres
# Redis
REDIS_HOST=redis
REDIS_PORT=6379
# S3
S3_REGION=ap-south-1
S3_BUCKET=dharini-prod-storage
S3_ACCESSKEYID=AKIAIOSFODNN7EXAMPLE
S3_SECRETACCESSKEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
S3_ENDPOINT=https://s3.ap-south-1.amazonaws.com
S3_FOLDER=dharini-prod
# Security
JWT_SECRET=generated-strong-random-secret-32-chars-min
# Email
SENDGRID_API_KEY=SG.xxxxxxxxxxxxxxxxxxxxx
EMAIL_FROM=noreply@dharini.artpark.ai
# Frontend
NEXT_PUBLIC_API_URL=https://in.dharini.artpark.ai/api
NEXT_PUBLIC_APP_ENV=production
  1. Never commit .env files to git
  2. Use strong, unique passwords for all credentials
  3. Rotate secrets regularly (JWT_SECRET, API keys)
  4. Use IAM roles instead of access keys when possible
  5. Restrict S3 bucket access to only necessary IP ranges
  6. Enable encryption for database and S3
  7. Use environment-specific values (don’t reuse production secrets in dev)