forked from GeneBO98/tradetally
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
232 lines (183 loc) · 7.86 KB
/
.env.example
File metadata and controls
232 lines (183 loc) · 7.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# ==============================================
# CORE APPLICATION SETTINGS
# ==============================================
# Database Configuration
DB_HOST=postgres
DB_PORT=5432
DB_USER=trader
DB_PASSWORD=trader_password
DB_NAME=tradetally
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key_change_this_in_production
JWT_EXPIRES_IN=7d
JWT_EXPIRE=7d
# Application Configuration
NODE_ENV=production
PORT=3000
ENABLE_SWAGGER=true
# Timezone Configuration
# Sets the timezone for the application (affects admin dashboard metrics like "active today")
# Examples: America/New_York, America/Chicago, America/Los_Angeles, Europe/London, UTC
# Find your timezone: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TZ=America/Chicago
# Registration Control
# Controls who can sign up for the application
# Options: 'open' (default - anyone can sign up), 'approval' (admin must approve), 'disabled' (no signups)
REGISTRATION_MODE=open
# ==============================================
# MOBILE APP SUPPORT SETTINGS
# ==============================================
# Mobile Authentication Tokens
ACCESS_TOKEN_EXPIRE=15m
REFRESH_TOKEN_EXPIRE=30d
# Device Management
MAX_DEVICES_PER_USER=10
ENABLE_DEVICE_TRACKING=true
# File Upload Configuration
MAX_FILE_SIZE=52428800
# Migration Control
RUN_MIGRATIONS=true
# PostgreSQL Migration Settings
# Set to 'true' to enable automatic PostgreSQL 15 -> 16 migration on startup
AUTO_MIGRATE_POSTGRES=false
# Instance Configuration
INSTANCE_NAME=TradeTally
INSTANCE_URL=https://your-domain.com
# ==============================================
# CORS CONFIGURATION
# ==============================================
# Primary frontend URL
FRONTEND_URL=https://your-domain.com
# Additional CORS origins for mobile apps (comma-separated)
# Examples:
# - For web apps: https://app.yourdomain.com,https://admin.yourdomain.com
# - For mobile dev: http://localhost:3000,http://localhost:8080
# - For staging: https://staging.yourdomain.com
CORS_ORIGINS=
# ==============================================
# EMAIL CONFIGURATION (OPTIONAL)
# ==============================================
# SMTP Settings (leave empty to disable email verification)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=
EMAIL_PASS=
EMAIL_FROM=noreply@tradetally.io
# ==============================================
# FRONTEND BUILD CONFIGURATION
# ==============================================
# Frontend API URL for build time
VITE_API_URL=http://localhost/api
# Analytics Configuration (Optional)
# Set this to your analytics domain (e.g., https://analytics.whitenov.com)
VITE_ANALYTICS_DOMAIN=
VITE_ANALYTICS_SITE_ID=
# Price Monitoring Service
# Set to 'false' to disable real-time price monitoring and alerts
ENABLE_PRICE_MONITORING=true
# ==============================================
# EXTERNAL API INTEGRATIONS
# ==============================================
# Stock Data APIs
# Finnhub - For real-time quotes and CUSIP resolution (get free key at: https://finnhub.io/register)
# Free tier: Real-time quotes, basic company info, CUSIP resolution
# Paid tier: Stock candle/OHLCV data (not used by TradeTally free tier)
FINNHUB_API_KEY=your_finnhub_api_key_here
# Alpha Vantage - For trade chart visualization (get free key at: https://www.alphavantage.co/support/#api-key)
# Free tier limitations:
# - Daily chart data only (intraday 5min/15min requires premium subscription)
# - 25 API requests per day
# - Charts show daily candles, not intraday price action
# This is sufficient for basic chart visualization on trade details
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_api_key_here
# OpenFIGI - For reliable CUSIP resolution (Bloomberg's free API - optional but recommended)
# Get free API key at: https://www.openfigi.com/
OPENFIGI_API_KEY=your_openfigi_api_key_here
# AI CUSIP Resolution (Optional - Advanced Users Only)
# WARNING: AI CUSIP resolution is unreliable and may return incorrect mappings
# Self-hosted AI models (Ollama, etc.) cannot access real financial databases
# Only use with cloud-based AI services and verify results manually
ENABLE_AI_CUSIP_RESOLUTION=false
# ==============================================
# BILLING & SUBSCRIPTIONS
# ==============================================
# Stripe Configuration (for web subscriptions)
# Get your keys from: https://dashboard.stripe.com/apikeys
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
# Apple In-App Purchase Configuration (for iOS subscriptions)
# Get this from App Store Connect > Users and Access > Keys > In-App Purchase > Shared Secret
# For testing: Leave empty (Xcode testing will bypass verification)
# For production: Generate a shared secret in App Store Connect
APPLE_SHARED_SECRET=
# Billing Control (CRITICAL for self-hosted instances)
# BILLING_ENABLED controls whether billing/subscription features are active
# - For self-hosted instances: MUST be set to 'false' (default)
# - For SaaS/cloud hosting: Set to 'true' (requires Stripe configuration)
# When false: All users get Pro tier features automatically
# When true: Users need subscriptions to access Pro features
BILLING_ENABLED=false
# Legacy billing flag (kept for backwards compatibility)
# If BILLING_ENABLED is not set, this will be checked as fallback
FEATURES_BILLING_ENABLED=false
# ==============================================
# GAMIFICATION & BEHAVIORAL ANALYTICS
# ==============================================
# Gamification Features
# Set to 'false' to disable gamification features (leaderboards, achievements, challenges)
ENABLE_GAMIFICATION=true
# Debug Settings
# Set to 'true' to enable debug logging in development
DEBUG=false
# ==============================================
# MOBILE-SPECIFIC FEATURES (FUTURE)
# ==============================================
# Push Notifications (Optional - Requires Apple Developer Account)
# Set to true to enable iOS push notifications for price alerts and trade execution
ENABLE_PUSH_NOTIFICATIONS=false
# Firebase Cloud Messaging server key (Android - Future feature)
FCM_SERVER_KEY=
# Apple Push Notification Service credentials (iOS)
APNS_KEY_ID= # 10-character Key ID from Apple Developer Portal
APNS_TEAM_ID= # 10-character Team ID from Apple Developer Portal
APNS_KEY_PATH= # Full path to your .p8 key file (e.g., /path/to/AuthKey_ABC123DEFG.p8)
# Feature Flags
ENABLE_MOBILE_SYNC=true
ENABLE_OFFLINE_MODE=true
ENABLE_BIOMETRIC_AUTH=true
# ==============================================
# BROKER SYNC INTEGRATION
# ==============================================
# Broker Token Encryption Key (REQUIRED for broker sync)
# Generate with: openssl rand -hex 32
# This key encrypts broker OAuth tokens stored in the database
BROKER_ENCRYPTION_KEY=
# Schwab OAuth Configuration (Optional)
# Register at: https://developer.schwab.com
# Note: Schwab requires HTTPS callback URLs
SCHWAB_CLIENT_ID=
SCHWAB_CLIENT_SECRET=
SCHWAB_REDIRECT_URI=https://your-domain.com/api/broker-sync/connections/schwab/callback
# Security Settings
REQUIRE_HTTPS=true
DETAILED_AUTH_ERRORS=false
# ==============================================
# RATE LIMITING CONFIGURATION
# ==============================================
# Rate Limiting Control (useful for self-hosted instances)
# Set to 'false' to completely disable rate limiting (default: enabled)
RATE_LIMIT_ENABLED=true
# Maximum requests per window (default: 1000)
# For self-hosted single-user instances, you may want to increase this
RATE_LIMIT_MAX=1000
# Rate limit window duration in milliseconds (default: 900000 = 15 minutes)
# RATE_LIMIT_WINDOW_MS=900000
# ==============================================
# DEPLOYMENT EXAMPLES
# ==============================================
# Example for self-hosted deployment:
# INSTANCE_NAME=MyCompany TradeTally
# INSTANCE_URL=https://tradetally.mycompany.com
# FRONTEND_URL=https://tradetally.mycompany.com
# CORS_ORIGINS=https://tradetally.mycompany.com