- Introduced email configuration for both development and production environments in `.env.dev.example` and `.env.production.example`. - Added SendGrid API key and email settings to support password reset and welcome emails. - Implemented password reset and request password reset endpoints in the AuthController. - Enhanced signup form to include additional fields such as Customer Number, address, nationality, date of birth, and gender. - Updated various services and controllers to integrate email functionality and handle new user data. - Refactored logging and error handling for improved clarity and maintainability. - Adjusted Docker configuration for production deployment.
104 lines
4.2 KiB
Plaintext
104 lines
4.2 KiB
Plaintext
# 🚀 Customer Portal - Development Environment
|
|
# Copy this file to .env for local development
|
|
# This configuration is optimized for development with hot-reloading
|
|
|
|
# =============================================================================
|
|
# 🌐 APPLICATION CONFIGURATION
|
|
# =============================================================================
|
|
NODE_ENV=development
|
|
APP_NAME=customer-portal-bff
|
|
BFF_PORT=4000
|
|
APP_BASE_URL=http://localhost:3000
|
|
|
|
# =============================================================================
|
|
# 🔐 SECURITY CONFIGURATION (Development)
|
|
# =============================================================================
|
|
# Development JWT secret (OK to use simple secret for local dev)
|
|
JWT_SECRET=dev_secret_for_local_development_minimum_32_chars_long
|
|
JWT_EXPIRES_IN=7d
|
|
|
|
# Password Hashing (Minimum rounds for security compliance)
|
|
BCRYPT_ROUNDS=10
|
|
|
|
# =============================================================================
|
|
# 🗄️ DATABASE & CACHE (Development)
|
|
# =============================================================================
|
|
# Local Docker services
|
|
DATABASE_URL=postgresql://dev:dev@localhost:5432/portal_dev?schema=public
|
|
REDIS_URL=redis://localhost:6379
|
|
|
|
# =============================================================================
|
|
# 🌍 NETWORK & CORS (Development)
|
|
# =============================================================================
|
|
# Allow local frontend
|
|
CORS_ORIGIN=http://localhost:3000
|
|
TRUST_PROXY=false
|
|
|
|
# =============================================================================
|
|
# 🚦 RATE LIMITING (Development)
|
|
# =============================================================================
|
|
# Relaxed rate limiting for development
|
|
RATE_LIMIT_TTL=60000
|
|
RATE_LIMIT_LIMIT=100
|
|
AUTH_RATE_LIMIT_TTL=900000
|
|
AUTH_RATE_LIMIT_LIMIT=3
|
|
|
|
# =============================================================================
|
|
# 🏢 EXTERNAL INTEGRATIONS (Development)
|
|
# =============================================================================
|
|
# WHMCS Integration (Demo/Test Environment)
|
|
WHMCS_BASE_URL=https://demo.whmcs.com
|
|
WHMCS_API_IDENTIFIER=your_demo_identifier
|
|
WHMCS_API_SECRET=your_demo_secret
|
|
WHMCS_WEBHOOK_SECRET=your_dev_webhook_secret
|
|
|
|
# Salesforce Integration (Sandbox Environment)
|
|
SF_LOGIN_URL=https://test.salesforce.com
|
|
SF_CLIENT_ID=your_dev_client_id
|
|
SF_PRIVATE_KEY_PATH=./secrets/sf-dev.key
|
|
SF_USERNAME=dev@yourcompany.com.sandbox
|
|
SF_WEBHOOK_SECRET=your_dev_webhook_secret
|
|
|
|
# =============================================================================
|
|
# 📊 LOGGING (Development)
|
|
# =============================================================================
|
|
# Verbose logging for development
|
|
LOG_LEVEL=debug
|
|
|
|
# =============================================================================
|
|
# 🎯 FRONTEND CONFIGURATION (Development)
|
|
# =============================================================================
|
|
# NEXT_PUBLIC_ variables are exposed to browser
|
|
NEXT_PUBLIC_APP_NAME=Customer Portal (Dev)
|
|
NEXT_PUBLIC_APP_VERSION=1.0.0-dev
|
|
NEXT_PUBLIC_API_BASE=http://localhost:4000
|
|
NEXT_PUBLIC_ENABLE_DEVTOOLS=true
|
|
|
|
# =============================================================================
|
|
# 🎛️ DEVELOPMENT OPTIONS
|
|
# =============================================================================
|
|
# Node.js options for development
|
|
NODE_OPTIONS=--no-deprecation
|
|
|
|
# =============================================================================
|
|
# ✉️ EMAIL (SendGrid) - Development
|
|
# =============================================================================
|
|
SENDGRID_API_KEY=
|
|
EMAIL_FROM=no-reply@localhost.test
|
|
EMAIL_FROM_NAME=Assist Solutions (Dev)
|
|
EMAIL_ENABLED=true
|
|
EMAIL_USE_QUEUE=true
|
|
SENDGRID_SANDBOX=true
|
|
# Optional: dynamic template IDs (use {{resetUrl}} in reset template)
|
|
EMAIL_TEMPLATE_RESET=
|
|
EMAIL_TEMPLATE_WELCOME=
|
|
|
|
# =============================================================================
|
|
# 🚀 QUICK START (Development)
|
|
# =============================================================================
|
|
# 1. Copy this template: cp .env.dev.example .env
|
|
# 2. Edit .env with your development values
|
|
# 3. Start services: pnpm dev:start
|
|
# 4. Start apps: pnpm dev
|
|
# 5. Access: Frontend http://localhost:3000, Backend http://localhost:4000
|