trading-platform-backend-v2/.env.example
Adrian Flores Cortes d07427aa63 feat(backend): Phase 2 - Redis client, P&L queries, type definitions
- Create shared/redis/index.ts: RedisManager with InMemoryFallback
- Update admin.routes.ts: Real P&L queries + Redis health check
- Create financial.types.ts: 12 enums + 3 interfaces for financial schema
- Create llm.types.ts: 7 enums + 5 interfaces for LLM schema
- Create audit.types.ts: 5 enums + 3 interfaces for audit schema
- Create market-data.types.ts: 2 enums + 3 interfaces for market_data schema
- Update shared/types/index.ts: barrel exports for new types
- Add ioredis v5.9.2 dependency
- Fix config/index.ts: correct DB credentials

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 04:39:22 -06:00

162 lines
6.2 KiB
Plaintext

# Trading Platform - Backend Environment Variables
# ============================================================================
# App
# ============================================================================
NODE_ENV=development
PORT=3081
FRONTEND_URL=http://localhost:3080
API_URL=http://localhost:3081
# ============================================================================
# CORS
# ============================================================================
CORS_ORIGINS=http://localhost:3080,http://localhost:3081
# ============================================================================
# JWT
# ============================================================================
JWT_ACCESS_SECRET=your-access-secret-change-in-production-min-32-chars
JWT_REFRESH_SECRET=your-refresh-secret-change-in-production-min-32-chars
JWT_ACCESS_EXPIRES=15m
JWT_REFRESH_EXPIRES=7d
# ============================================================================
# Database (PostgreSQL) - Instancia nativa compartida
# Ref: orchestration/inventarios/DEVENV-PORTS-INVENTORY.yml
# Nombres homologados 2026-01-07 (antes: trading_platform_*)
# ============================================================================
DB_HOST=localhost
DB_PORT=5432
DB_NAME=trading_platform
DB_USER=trading_user
DB_PASSWORD=trading_dev_2026
DB_SSL=false
DB_POOL_MAX=20
DB_IDLE_TIMEOUT=30000
DB_CONNECTION_TIMEOUT=5000
# ============================================================================
# Redis
# ============================================================================
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
# ============================================================================
# Stripe
# ============================================================================
STRIPE_SECRET_KEY=sk_test_...
STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# ============================================================================
# ML Engine
# ============================================================================
ML_ENGINE_URL=http://localhost:3083
ML_ENGINE_API_KEY=
ML_ENGINE_TIMEOUT=30000
# ============================================================================
# Trading Agents
# ============================================================================
TRADING_AGENTS_URL=http://localhost:3086
TRADING_AGENTS_TIMEOUT=60000
# ============================================================================
# LLM Agent (Local Python Service)
# ============================================================================
LLM_AGENT_URL=http://localhost:3085
LLM_AGENT_TIMEOUT=120000
# ============================================================================
# LLM Services (Cloud APIs - Fallback)
# ============================================================================
# Anthropic (Claude)
ANTHROPIC_API_KEY=sk-ant-...
# OpenAI (optional, fallback)
OPENAI_API_KEY=sk-...
# LLM Configuration
LLM_PROVIDER=anthropic
LLM_MODEL=claude-3-5-sonnet-20241022
LLM_MAX_TOKENS=4096
LLM_TEMPERATURE=0.7
# ============================================================================
# Binance API (Market Data)
# ============================================================================
BINANCE_API_KEY=
BINANCE_SECRET_KEY=
BINANCE_TESTNET=true
# ============================================================================
# Rate Limiting
# ============================================================================
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX=100
# ============================================================================
# Email (SMTP)
# ============================================================================
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_SECURE=false
EMAIL_USER=your-email@gmail.com
EMAIL_PASSWORD=your-app-password
EMAIL_FROM=noreply@trading-platform.local
# ============================================================================
# Twilio (SMS/WhatsApp)
# ============================================================================
TWILIO_ACCOUNT_SID=your-twilio-account-sid
TWILIO_AUTH_TOKEN=your-twilio-auth-token
TWILIO_PHONE_NUMBER=+1234567890
TWILIO_WHATSAPP_NUMBER=+14155238886
TWILIO_VERIFY_SERVICE_SID=your-verify-service-sid
TWILIO_USE_VERIFY_SERVICE=true
# ============================================================================
# OAuth - Google
# ============================================================================
GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_CALLBACK_URL=http://localhost:3081/api/v1/auth/google/callback
# ============================================================================
# OAuth - Facebook
# ============================================================================
FACEBOOK_CLIENT_ID=your-facebook-app-id
FACEBOOK_CLIENT_SECRET=your-facebook-app-secret
FACEBOOK_CALLBACK_URL=http://localhost:3081/api/v1/auth/facebook/callback
# ============================================================================
# OAuth - Twitter/X
# ============================================================================
TWITTER_CLIENT_ID=your-twitter-client-id
TWITTER_CLIENT_SECRET=your-twitter-client-secret
TWITTER_CALLBACK_URL=http://localhost:3081/api/v1/auth/twitter/callback
# ============================================================================
# OAuth - Apple Sign In
# ============================================================================
APPLE_CLIENT_ID=your-apple-service-id
APPLE_CLIENT_SECRET=your-apple-client-secret
APPLE_TEAM_ID=your-apple-team-id
APPLE_KEY_ID=your-apple-key-id
APPLE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
APPLE_CALLBACK_URL=http://localhost:3081/api/v1/auth/apple/callback
# ============================================================================
# OAuth - GitHub
# ============================================================================
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
GITHUB_CALLBACK_URL=http://localhost:3081/api/v1/auth/github/callback
# ============================================================================
# Logging
# ============================================================================
LOG_LEVEL=info