Environment Variables
Create a .env file in the root directory with the following variables:
# Server
PORT=9000
NODE_ENV=development
BASE_URL=http://localhost:9000
FRONTEND_URL=http://localhost:3000
# CORS
ALLOWED_ORIGINS=https://your-frontend-url
# Database (PostgreSQL)
DB_NAME=your_database_name
DB_USER=your_database_user
DB_PASSWORD=your_database_password
DB_HOST=localhost
DB_PORT=5432
DB_DIALECT=postgres
# JWT
JWT_SECRET=your_jwt_secret_key
# Email (Resend)
RESEND_API_KEY=re_xxxxxxxxxxxx
# Paystack
PAYSTACK_SECRET_KEY=sk_test_xxxxxxxxxxxx
PAYSTACK_PUBLIC_KEY=pk_test_xxxxxxxxxxxx
# Stellar
STELLAR_NETWORK=https://horizon-testnet.stellar.org
ISSUING_ACCOUNT_SECRET=your_issuing_account_secret
DISTRIBUTION_ACCOUNT_SECRET=your_distribution_account_secret
Variable Reference
| Variable | Description |
|---|---|
PORT | Port the server runs on. Defaults to 9000 |
NODE_ENV | Set to production on deployment |
BASE_URL | Full URL of the backend server. Used for Paystack callback |
FRONTEND_URL | URL of the frontend app. Used in password reset emails |
ALLOWED_ORIGINS | Comma-separated list of allowed frontend URLs for CORS |
DB_NAME | PostgreSQL database name |
DB_USER | PostgreSQL username |
DB_PASSWORD | PostgreSQL password |
DB_HOST | Database host |
DB_PORT | Database port. Defaults to 5432 |
DB_DIALECT | Must be postgres |
JWT_SECRET | Secret key for signing JWT tokens. Use a long random string |
RESEND_API_KEY | API key from your Resend dashboard. Go to API Keys and create a new key. Make sure your sending domain is verified before use |
PAYSTACK_SECRET_KEY | Paystack secret key. Use test key (sk_test_...) for development |
PAYSTACK_PUBLIC_KEY | Paystack public key |
STELLAR_NETWORK | Use https://horizon-testnet.stellar.org for development |
ISSUING_ACCOUNT_SECRET | Secret key of your Stellar issuing account |
DISTRIBUTION_ACCOUNT_SECRET | Secret key of your Stellar distribution account |