Skip to content

Commit 507b61a

Browse files
Merge pull request #212 from udaycodespace/fix/dx-env-cleanup-207
[DX] Clean up .env.example: remove duplicates, add source comments, improve onboarding
2 parents 1c4746f + ff0d7aa commit 507b61a

1 file changed

Lines changed: 26 additions & 17 deletions

File tree

.env.example

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,69 @@
11
# ─────────────────────────────────────────────────────────────────────────────
22
# urBackend — Environment Variables
3-
# Copy this file to .env and fill in your values before running docker-compose.
43
# ─────────────────────────────────────────────────────────────────────────────
4+
# Copy this file before editing:
5+
# Linux/macOS: cp .env.example .env
6+
# PowerShell: Copy-Item .env.example .env
57

68
# ── Server Ports ────────────────────────────────────────────────────────────
79
PORT=1234 # For Admin Server (Dashboard)
810
USER_PORT=1235 # For User Server (Public API)
911
NODE_ENV=development
1012

11-
12-
# ── Database & Cache ──────────────────────────────────────────────────────────
13+
# ── Database & Cache ────────────────────────────────────────────────────────
1314
# When using docker-compose, these are automatically overridden to point to
1415
# internal service names (mongo, redis). You do NOT need to change these.
1516
MONGO_URL=mongodb://mongo:27017/urbackend
1617
REDIS_URL=redis://redis:6379
1718

18-
# ── Authentication ────────────────────────────────────────────────────────────
19+
# ── Authentication ──────────────────────────────────────────────────────────
20+
# Generate random secrets for these values.
21+
# JWT_SECRET/API_KEY_SALT examples:
22+
# openssl rand -base64 32
23+
# node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
24+
#
25+
# ENCRYPTION_KEY must be 64 hex chars (32 bytes), examples:
26+
# openssl rand -hex 32
27+
# node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
1928
JWT_SECRET=your_super_secret_jwt_key_min_32_chars
20-
ENCRYPTION_KEY=32_character_long_string_for_byod_creds
29+
ENCRYPTION_KEY=64_hex_characters_for_aes_256_gcm_key
2130
API_KEY_SALT=your_random_api_key_salt
2231

2332
# Public API userAuth token config (optional; defaults shown)
2433
PUBLIC_AUTH_ACCESS_TOKEN_TTL=15m
2534
PUBLIC_AUTH_REFRESH_TOKEN_TTL_SECONDS=604800
2635

27-
# ── External Storage (Supabase) ───────────────────────────────────────────────
36+
# ── External Storage (Supabase) ─────────────────────────────────────────────
2837
# Required for file upload/storage features.
38+
# Get from: https://app.supabase.com → Project Settings → API
2939
SUPABASE_URL=https://your-project.supabase.co
3040
SUPABASE_KEY=your-supabase-anon-key
3141

32-
# ── Email (Resend) ────────────────────────────────────────────────────────────
42+
# ── Email (Resend) ──────────────────────────────────────────────────────────
3343
# Required for OTP / email verification flow.
44+
# Get from: https://resend.com/api-keys
3445
RESEND_API_KEY=re_your_resend_api_key
3546
EMAIL_FROM=onboarding@resend.dev
47+
48+
# Get from: https://resend.com/webhooks → Create Endpoint
3649
RESEND_WEBHOOK_SECRET=whsec_your_resend_webhook_secret
3750

38-
# ── Frontend ──────────────────────────────────────────────────────────────────
51+
# ── Frontend ────────────────────────────────────────────────────────────────
3952
FRONTEND_URL=http://localhost:5173
40-
4153
PUBLIC_API_URL=https://api.ub.bitbros.in
4254

43-
# ── Billing (Razorpay) ──────────────────────────────────────────────────────
55+
# ── Billing (Razorpay) ──────────────────────────────────────────────────────
4456
# Get from: https://dashboard.razorpay.com → Settings → API Keys
4557
RAZORPAY_KEY_ID=rzp_test_xxxxxxxxxxxx
4658
RAZORPAY_KEY_SECRET=xxxxxxxxxxxxxxxxxxxx
4759

48-
# Create from: Razorpay Dashboard → Subscriptions → Plans → Create Plan
60+
# Create from: https://dashboard.razorpay.com → Subscriptions → Plans → Create Plan
4961
RAZORPAY_PLAN_ID=plan_xxxxxxxxxxxx
5062

51-
# Set from: Razorpay Dashboard → Settings → Webhooks → Add Endpoint → copy secret
52-
RAZORPAY_KEY_ID=rzp_testx_xxxx
53-
RAZORPAY_KEY_SECRET=xxxx
54-
RAZORPAY_PLAN_ID=xxxx
55-
RAZORPAY_WEBHOOK_SECRET=xxxx
63+
# Get from: https://dashboard.razorpay.com → Settings → Webhooks → Add Endpoint
64+
RAZORPAY_WEBHOOK_SECRET=whsec_xxxxxxxxxxxx
5665

57-
# ── Internal Microservices (AI & Python) ──────────────────────────────────────
66+
# ── Internal Microservices (AI & Python) ────────────────────────────────────
5867
# Required for AI Query Builder and Python microservice communication
5968
PYTHON_SERVICE_URL=http://localhost:8000
6069
INTERNAL_SECRET=generate_a_random_32_char_secret_here

0 commit comments

Comments
 (0)