This guide covers all environment variables for Node.js API and Next.js frontend components of Weam AI.
Service-Specific Variables
Node.js API Server Variables
Complete environment variables for the Node.js API backend service: Server Configuration SERVER_PORT=4050
API_PREFIX=v1
Service URLs FRONT_URL=http://localhost:3000
BASE_URL=http://localhost:4050
OPEN_AI_MODAL=gpt-4
OPEN_AI_API_URL=https://api.openai.com
GEMINI_API_URL=https://gemini.google.com
ANTHROPIC_AI_API_URL=https://api.anthropic.com
Model Provider API Keys Weam AI_OPEN_AI_KEY=sk-your-openai-key
Weam AI_GEMINI_KEY=your-gemini-key
Weam AI_OPEN_ROUTER_KEY=sk-or-your-openrouter-key
HUGGING_FACE_AUTH_TOKEN=hf-your-token
Weam AI_ANTHROPIC_API_KEY=sk-ant-your-key
Weam AI_DEEPSEEK_KEY=sk-your-deepseek-key
Authentication Settings JWT_SECRET=access-secret
JWT_REFRESH_SECRET=refresh-secret
JWT_ACCESS_EXPIRE=1h
JWT_REFRESH_EXPIRE=7d
QR_NAME=YourApp-name
Storage Settings BUCKET_TYPE=MINIO
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_REGION=us-east-1
AWS_S3_BUCKET=yourcompany-media
AWS_S3_URL=https://s3.amazonaws.com
AWS_CDN_URL=https://cdn.yourexampledomain.com
MINIO_PORT=9000
MINIO_DASHBOARD_PORT=9001
MINIO_ENDPOINT=http://minio
Email Configuration EMAIL_PROVIDER=SMTP
AWS_SES_VERIFIED_MAIL=noreply@yourexampledomain.com
SMTP_USER=user@example.com
SMTP_PASSWORD=password123
SMTP_SENDER_EMAIL=noreply@yourexampledomain.com
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
Additional Settings SECURITY_KEY=secure-key
SIGNUP_INFO_EMAIL=welcome@yourexampledomain.com
API_RATE_LIMIT=100
SEED=42
TZ=Asia/Kolkata
SEO Agent Settings SEO_USER_ID=seo@yourexampledomain.com
SEO_PASSWORD=securepassword
Next.js Frontend Variables
Complete environment variables for the Next.js frontend application: API Endpoints NEXT_PUBLIC_BACKEND_API_URL=http://localhost:4050
NEXT_PUBLIC_DOMAIN_URL=http://localhost:3000
NEXT_PUBLIC_API_PREFIX=/v1
Application Settings NEXT_PUBLIC_APP_ENVIRONMENT=dev
NEXT_PUBLIC_COOKIE_NAME=yourapp-token
NEXT_PUBLIC_COOKIE_PASSWORD=encrypt-me
NEXT_PUBLIC_HTTPS_PROTOCOL=false
Asset Configuration NEXT_PUBLIC_AWS_S3_URL=https://cdn.yourexampledomain.com
NEXT_PUBLIC_IMAGE_DOMAIN=cdn.yourexampledomain.com
WebSocket Settings NEXT_PUBLIC_SOCKET_CONNECTION_URL=ws://localhost:3000
Additional Frontend Settings NEXT_PUBLIC_SECURITY_KEY=secure-frontend-key
NEW_RELIC_APPNAME=YourAppFrontend
NEXT_PUBLIC_OPENAI_PLATFORM_URL=https://platform.openai.com
Required Configuration
These environment variables must be configured for Weam AI to function properly.
Database Settings
Configure MongoDB and Redis connections for data storage and caching:
# MongoDB Database
MONOGODB_URI=mongodb://localhost:27017
DB_DATABASE=yourappdb
# Redis Cache and Queues
REDIS_HOST=localhost
REDIS_PORT=6379
Security Configuration
Generate and configure secure keys for authentication and encryption:
# JWT Authentication
JWT_SECRET=your-super-secure-jwt-secret-here
JWT_REFRESH_SECRET=your-super-secure-refresh-secret-here
# Application Security
SECURITY_KEY=your-16-byte-security-key
CSRF_TOKEN_SECRET=your-csrf-token-secret
Generate secure keys:
# Using OpenSSL (recommended - available on all platforms)
openssl rand -hex 32
# Alternative: Using Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
# Alternative: Using Python (if installed)
python -c "import secrets; print(secrets.token_urlsafe(32))"
Service URLs
Configure service endpoints and domain settings:
# Frontend Application
NEXT_PUBLIC_DOMAIN_URL=http://localhost:3000
FRONT_URL=http://localhost:3000
# Backend Services
BASE_URL=http://localhost:4050
File Storage Configuration
Choose between local MinIO storage or AWS S3 for file management:
BUCKET_TYPE=MINIO
MINIO_ENDPOINT=http://localhost:9000
AWS_ACCESS_KEY_ID=minioadmin
AWS_SECRET_ACCESS_KEY=minioadmin
AWS_S3_BUCKET=yourapp-media
Benefits:
No external dependencies
Free for development
Easy local testing
Vector Database Settings
Configure Qdrant for AI embeddings and vector search:
# Qdrant Vector Database
LOCAL_QDRANT_URL=http://localhost:6333
QDRANT_DASHBOARD_PORT=6333
Optional Configuration
These settings enhance functionality but aren’t required for basic operation.
Optional Dashboard (Mongo Express)
An optional dashboard is available to view MongoDB records for the running project. It is disabled by default. Enable only if you need the dashboard (recommended for development, not production).
Enable the dashboard
Update docker-compose.yml
by adding/uncommenting this service:
mongo-express :
image : mongo-express:latest
restart : always
ports :
- "8081:8081"
environment :
ME_CONFIG_MONGODB_ENABLE_ADMIN=true
ME_CONFIG_MONGODB_ADMINUSERNAME=admin
ME_CONFIG_MONGODB_ADMINPASSWORD=password
ME_CONFIG_BASICAUTH_USERNAME=weam
ME_CONFIG_BASICAUTH_PASSWORD=password
ME_CONFIG_MONGODB_SERVER=mongo
networks :
- app-network
depends_on :
- mongo
Start the service:
docker compose up -d mongo-express
Open the dashboard:
URL: http://localhost:8081
Login: uses the basic auth from the service block above
Email Notifications
Configure SMTP for user notifications and account management:
# Email Service
EMAIL_PROVIDER=SMTP
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-password
Popular SMTP providers:
Gmail : smtp.gmail.com:587
(requires app password)
SendGrid : smtp.sendgrid.net:587
AWS SES : Regional endpoints available
External Service Integration
Configure OAuth credentials for third-party integrations:
Slack Integration
GitHub Integration
Google Workspace
SLACK_CLIENT_ID=your-slack-client-id
SLACK_CLIENT_SECRET=your-slack-client-secret
NEXT_PUBLIC_SLACK_CLIENT_ID=your-slack-client-id
NEXT_PUBLIC_SLACK_CLIENT_SECRET=your-slack-client-secret
Enable Slack workspace integration for team collaboration.
Environment-Specific Settings
Configure different settings for development and production environments.
Local Development Environment
# Development Configuration
NEXT_PUBLIC_APP_ENVIRONMENT=dev
NEXT_PUBLIC_HTTPS_PROTOCOL=false
NEXT_PUBLIC_DOMAIN_URL=http://localhost:3000
# Local Service URLs
NEXT_PUBLIC_BACKEND_API_URL=http://localhost:4050
Production Deployment Environment
# Production Configuration
NEXT_PUBLIC_APP_ENVIRONMENT=production
NEXT_PUBLIC_HTTPS_PROTOCOL=true
NEXT_PUBLIC_DOMAIN_URL=https://yourexampledomain.com
# Production Service URLs
NEXT_PUBLIC_BACKEND_API_URL=https://yourexampledomain.com
Configuration Validation
Verify your environment variable configuration:
# Check required variables exist
grep -E "(JWT_SECRET|MONOGODB_URI|REDIS_HOST)" .env
# Verify no placeholder values remain
grep -E "(your-|placeholder|example)" .env
# Test database connection
docker exec yourapp-mongodb mongosh --eval "db.runCommand('ping')"
Next Steps