Overview
The Exness Trading Platform uses environment variables for configuration across all services. This guide documents all available variables from the.env.example file.
Configuration File
Create a.env file in the project root:
Complete Environment Variables
Redis Configuration
Redis connection URL for caching and real-time data streams.Default:
redis://localhost:6379Docker Network: redis://redis:6379Format: redis://[user:password@]host:port[/database]Used by:- Backend API
- Trading Engine
- WebSocket Server
- Price Poller
- All data processing services
Redis is critical for real-time data flow. All services depend on Redis for inter-service communication.
Market Data Configuration
Binance WebSocket API endpoint for real-time market data.Default:
wss://ws.backpack.exchange/Production: wss://stream.binance.com:9443/wsUsed by Price Poller service to fetch live market prices for BTC, ETH, and SOL.TimescaleDB Configuration
TimescaleDB stores historical market data and time-series information.TimescaleDB username.Default:
myuserProduction: Use a strong, unique username.TimescaleDB password.Default:
mypasswordProduction: Use a strong, randomly generated password (minimum 32 characters).TimescaleDB hostname.Development:
localhostDocker: timescaledb (service name)Production: Your TimescaleDB server hostname or IP address.TimescaleDB port number.Default:
5433 (development)Docker: 5432 (internal container port)Standard PostgreSQL: 5432TimescaleDB database name.Default:
mydbRecommended: exness_timeseries or similar descriptive name.Authentication Configuration
Secret key for JWT token signing and verification.Default:
mysecretProduction: Generate a cryptographically secure random string.Application Configuration
Node.js environment mode.Values:
development | production | testDefault: productionAffects:- Logging verbosity
- Error stack traces
- Performance optimizations
- Debug features
Backend API server port.Default:
8000Used by the Express.js backend service for REST API endpoints.WebSocket server port for real-time data streaming.Default:
7070Frontend applications connect to this port for live market data and updates.URL Configuration
Frontend application URL for CORS and redirects.Default:
http://localhost:3001Production: Your production frontend domain (e.g., https://trading.exness.com)Used for:- CORS whitelisting
- OAuth redirects
- Email links
Backend API URL for service-to-service communication.Default:
http://localhost:8000Docker: http://backend:8000Production: Your production API domain (e.g., https://api.exness.com)Database Configuration
PostgreSQL connection string for Prisma ORM.Default:
postgresql://postgresql:postgresql@localhost:5434/exnessDocker: postgresql://postgresql:postgresql@postgres:5432/exnessFormat: postgresql://USER:PASSWORD@HOST:PORT/DATABASEUsed by:- Prisma ORM for migrations
- Backend API for user management
- Database Storage service
- Trading Engine for order persistence
This is the primary database for all transactional data, user accounts, and orders.
MongoDB connection string for snapshot storage.Default:
mongodb://admin:admin123@localhost:27017/exness_snapshots?authSource=adminDocker: mongodb://admin:admin123@mongodb:27017/exness_snapshots?authSource=adminFormat: mongodb://USER:PASSWORD@HOST:PORT/DATABASE?authSource=adminUsed by Snap Shotting service for periodic account state backups.Email Configuration
Email address for sending notifications and alerts.Default:
[email protected]Production: Your organization’s SMTP-enabled email address.Used for:- Account verification emails
- Trade notifications
- Alert system
- Password resets
SMTP app password for email authentication.Default:
pvjc ohid eqfl gmpjGmail: Generate an App Password from Google Account settings.Format: Space-separated tokens (Gmail App Password format)Environment File Template
Complete.env.example file:
.env.example
Docker Compose Overrides
Docker Compose automatically overrides certain variables for container networking:Container-specific variables use internal service names (e.g.,
postgres, redis) for communication within the Docker network.Production Configuration
Security Best Practices
Change All Default Passwords
Generate strong passwords for:
- TimescaleDB
- PostgreSQL (in docker-compose.yml)
- MongoDB (in docker-compose.yml)
- JWT secret
Use Secrets Management
For production, use a secrets management system:
- AWS Secrets Manager
- HashiCorp Vault
- Kubernetes Secrets
- Docker Secrets
.env files.Environment-Specific Variables
Variable Validation
The platform validates required environment variables on startup. Missing or invalid variables will prevent services from starting.Troubleshooting
Service can't connect to database
Service can't connect to database
Check that database environment variables match between
.env and docker-compose.yml:CORS errors in frontend
CORS errors in frontend
Ensure
FRONTEND_URL and BACKEND_URL are correctly configured:JWT authentication failing
JWT authentication failing
Verify Changing
JWT_SECRET is consistent across all services:JWT_SECRET invalidates all existing sessions.Email notifications not sending
Email notifications not sending
Verify email configuration:For Gmail:
- Enable 2-factor authentication
- Generate App Password at https://myaccount.google.com/apppasswords
- Use the generated password in
USER_PASSWORD
Next Steps
Docker Compose
Learn how environment variables are used in Docker Compose
Database Setup
Configure database connections and run migrations