-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
99 lines (80 loc) · 3.24 KB
/
.env.example
File metadata and controls
99 lines (80 loc) · 3.24 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
# Environment Configuration
NODE_ENV=development
# Database URLs (Postgres Shards)
POSTGRES_SHARD_A_URL=postgresql://postgres:postgres@localhost:5432/shard_a
POSTGRES_SHARD_B_URL=postgresql://postgres:postgres@localhost:5433/shard_b
POSTGRES_SHARD_C_URL=postgresql://postgres:postgres@localhost:5434/shard_c
# MongoDB
MONGODB_URL=mongodb://root:mongodb@localhost:27017/restaurants?authSource=admin
# Redis
REDIS_URL=redis://localhost:6379
# RabbitMQ
RABBITMQ_URL=amqp://guest:guest@localhost:5672
# Services
API_GATEWAY_PORT=3000
AUTH_SERVICE_PORT=3001
ORDER_SERVICE_PORT=3002
RESTAURANT_SERVICE_PORT=3003
DELIVERY_SERVICE_PORT=3004
TRACKING_SERVICE_PORT=3005
# JWT Secrets (Dual Token System)
# ✅ Generate with: openssl rand -base64 32
JWT_ACCESS_SECRET=your-access-secret-key-change-in-production-min-32-chars
JWT_REFRESH_SECRET=your-refresh-secret-key-change-in-production-min-32-chars
EMAIL_SECRET=your-email-secret-key-change-in-production-min-32-chars
PASSWORD_RESET_SECRET=your-password-reset-secret-change-in-production-min-32-chars
# Token Configuration
# Access Token Duration (short-lived, in memory)
ACCESS_TOKEN_EXPIRY_CUSTOMER=15m
ACCESS_TOKEN_EXPIRY_RESTAURANT=30m
ACCESS_TOKEN_EXPIRY_DELIVERY=2h
# Refresh Token Duration (long-lived, in database, HttpOnly cookie)
REFRESH_TOKEN_EXPIRY_CUSTOMER=7d
REFRESH_TOKEN_EXPIRY_RESTAURANT=30d
REFRESH_TOKEN_EXPIRY_DELIVERY=30d
# Max Active Sessions per User (devices)
MAX_SESSIONS_CUSTOMER=5
MAX_SESSIONS_RESTAURANT=3
MAX_SESSIONS_DELIVERY=2
# Security Settings
ACCOUNT_LOCK_THRESHOLD=5 # Lock after 5 failed attempts
ACCOUNT_LOCK_DURATION_MINUTES=15 # Lock for 15 minutes
# JWT
JWT_SECRET=your-secret-key-change-in-production-min-32-chars
JWT_EXPIRY=24h
# Auth Service URLs
AUTH_SERVICE_URL=http://localhost:3001
ORDER_SERVICE_URL=http://localhost:3002
RESTAURANT_SERVICE_URL=http://localhost:3003
DELIVERY_SERVICE_URL=http://localhost:3004
TRACKING_SERVICE_URL=http://localhost:3005
FRONTEND_URL=http://localhost:5173
# ==================== GOOGLE OAuth ====================
GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_REDIRECT_URI=http://localhost:3001/auth/customer/google/callback
# ==================== Encryption ====================
# Generate a random 64-character hex string for production
# Use: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
ENCRYPTION_KEY=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
# ==================== File Upload ====================
UPLOAD_DIR=./uploads
MAX_FILE_SIZE_MB=5
# ==================== Sharding Configuration ====================
SHARD_A_REGIONS=us-west,ca,chicago
SHARD_B_REGIONS=us-east,us-central,toronto
SHARD_C_REGIONS=us-south,tx,mexico
# ==================== Email Service (Optional) ====================
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-password
SMTP_FROM=noreply@instanteats.com
# ==================== SMS Service (Optional) ====================
TWILIO_ACCOUNT_SID=your-account-sid
TWILIO_AUTH_TOKEN=your-auth-token
TWILIO_PHONE_NUMBER=+1234567890
# ==================== Admin Settings ====================
ADMIN_EMAIL=admin@instanteats.com
VERIFICATION_TIMEOUT_HOURS=48
POLICE_VERIFICATION_DAYS=5