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:
- ✅ API running on port 3002
- ✅ All docs synced to MongoDB
- ✅ Real-time file watching enabled
- ✅ Frontend connected to API
- ✅ Analytics tracking active
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
- Check MongoDB connection string
- Verify port 3002 is available
- Check
.env.localexists
Files Not Syncing
- Verify
ENABLE_CLOUD_SYNC=true - Check
SYSTEM_TOKENis set - Ensure API is running
Frontend Can't Connect
- Check API is running:
curl http://localhost:3002/docs-api/health - Verify CORS origins
- Check browser console for errors