VARIABLES CHECKLIST

Documentation management API with real-time MongoDB sync

✅ Railway Variables Checklist for Docs-api Service

5 Variables You Need to Add

Looking at your Railway screenshot, you have "No Environment Variables" set. Add these 5:

1️⃣ JWT_SECRET (COPY from backend-api)

Variable: JWT_SECRET
Value: <open your backend-api Railway service and copy this value>

Where: backend-api Railway service → Variables tab → Copy JWT_SECRET value

Critical: MUST match backend-api exactly!


2️⃣ SYSTEM_TOKEN (COPY from backend-api)

Variable: SYSTEM_TOKEN
Value: <open your backend-api Railway service and copy this value>

Where: backend-api Railway service → Variables tab → Copy SYSTEM_TOKEN value

Critical: MUST match backend-api exactly!


3️⃣ MONGODB_CONNECTION_STRING_TEST_MODULES (FROM .env.local)

Variable: MONGODB_CONNECTION_STRING_TEST_MODULES
Value: <copy from your .env.local file>

Where: Your .env.local file in the project root

Looks like: mongodb+srv://username:[email protected]/

Note: This is your TEST-MODULES cluster (different from main production)


4️⃣ ALLOWED_ORIGINS (NEW)

Variable: ALLOWED_ORIGINS
Value: https://gograb.space,http://localhost:5010

Type manually: Just paste this value exactly as shown


5️⃣ NODE_ENV (NEW)

Variable: NODE_ENV
Value: production

Type manually: Just paste "production"


How to Add in Railway

In your screenshot:

  1. Click "+ New Variable" button (top right)
  2. For each variable above:
    • Enter the Variable name
    • Paste the Value
    • Click "Add"
  3. After all 5 are added, click "Deploy" (top right)

Quick Check

After adding, you should see:


To Copy from backend-api

  1. Open new tab: https://railway.com/project/
  2. Click backend-api service
  3. Click "Variables" tab
  4. Find JWT_SECRET → Click to reveal → Copy
  5. Find SYSTEM_TOKEN → Click to reveal → Copy
  6. Go back to Docs-api tab and paste

Summary

COPY from backend-api Railway (2 variables):

COPY from your .env.local (1 variable):

TYPE manually (2 variables):

That's all you need! ✅