Quick Start Guide

Get started with backend-docs-api in 5 minutes

Backend Docs API - Quick Start

Get your documentation API running in 5 minutes.

1. Configure Environment

Add to .env.local:

# Required
DOCS_API_PORT=3002
MONGODB_CONNECTION_STRING_TEST_MODULES=mongodb+srv://...
JWT_SECRET=<YOUR_JWT_SECRET_FROM_ENV_LOCAL>
SYSTEM_TOKEN=<your-system-token>

# Optional
ENABLE_CLOUD_SYNC=true
DOCS_API_URL=http://localhost:3002/docs-api

2. Start the API

yarn serve:backend-docs

Expected output:

📚 GoGrab Backend Docs API READY on port 3002
📡 Server: http://localhost:3002/docs-api
🗄️  Database: docs-database (test-modules cluster)

3. Test Health Check

curl http://localhost:3002/docs-api/health

4. Initial Sync

Upload all docs to MongoDB:

yarn docs:sync

5. Start File Watcher

yarn docs:watch

6. Start Frontend

yarn serve:docs

Navigate to: http://localhost:5010

That's It!

You now have:

Next Steps

Common Commands

# Start all backends (API + AI-API + Docs-API)
yarn dev:all-backends

# Sync docs to local API
yarn docs:sync:local

# Sync docs to production
yarn docs:sync:prod

# Watch for file changes
yarn docs:watch

# Build for production
nx build backend-docs-api --configuration=production

# Deploy to Railway
./deployment/deploy-docs-api.sh

Production URLs

Environment API URL
Local http://localhost:3002/docs-api
Production https://backend-docs-api-production.up.railway.app/docs-api

Test Production API

curl https://backend-docs-api-production.up.railway.app/docs-api/health

Troubleshooting

API Won't Start

  1. Check MongoDB connection string
  2. Verify port 3002 is available
  3. Check .env.local exists

Files Not Syncing

  1. Verify ENABLE_CLOUD_SYNC=true
  2. Check SYSTEM_TOKEN is set
  3. Ensure API is running

Frontend Can't Connect

  1. Check API is running: curl http://localhost:3002/docs-api/health
  2. Verify CORS origins
  3. Check browser console for errors

Support