Purple8-platform

API Endpoint Reference - Purple8 Platform

Gateway Configuration

Gateway Service: Runs on port 8081 (not 8000 or 8001) Frontend: Runs on port 8080 (nginx) Correct API Base URL: http://localhost:8081

Router Prefixes

The FastAPI gateway has multiple routers with different prefix configurations:

Routers WITHOUT /api prefix:

Routers WITH /api prefix:

Common Mistakes

❌ WRONG:

// Wrong - adds /api to base URL
const API_BASE = 'http://localhost:8081/api'
fetch(`${API_BASE}/pipeline/projects`) // → /api/pipeline/projects (404!)

// Wrong - incorrect port
const API_BASE = 'http://localhost:8000'
const API_BASE = 'http://localhost:8001'

✅ CORRECT:

// Correct - gateway base URL without /api
const API_BASE = 'http://localhost:8081'

// For pipeline endpoints (no /api prefix)
fetch(`${API_BASE}/pipeline/projects`) // → /pipeline/projects ✓

// For sandbox endpoints (has /api prefix)
fetch(`${API_BASE}/api/sandbox/health`) // → /api/sandbox/health ✓

Frontend Configuration Files

Files that need updating:

  1. src/config.js - Main config file
    • Currently uses: window.location.hostname:8001
    • Should use: 8081
  2. src/services/pipelineApi.js
    • Currently: http://localhost:8001
    • Should be: http://localhost:8081
  3. src/services/sandboxApi.js
    • Currently: http://localhost:8001
    • Should be: http://localhost:8081
  4. src/services/memoryApi.js
    • Currently: http://localhost:8001
    • Should be: http://localhost:8081
  5. src/services/cotApi.js
    • Currently: http://localhost:8001
    • Should be: http://localhost:8081
  6. src/services/proactiveApi.js
    • Currently: http://localhost:8001
    • Should be: http://localhost:8081
  7. src/services/previewApi.js
    • Currently: http://localhost:8001
    • Should be: http://localhost:8081
  8. src/store/adminStore.js
    • Currently: http://localhost:8001
    • Should be: http://localhost:8081
  9. src/components/AdminControlPanel.vue
    • Hardcoded: http://localhost:8000/api/admin/*
    • Should use: http://localhost:8081/api/admin/*
  10. src/components/sandbox/IDECopilot.vue
    • Currently: http://localhost:8000
    • Should be: http://localhost:8081
  11. src/config/constants.js
    • Currently: http://localhost:8000
    • Should be: http://localhost:8081
  12. src/composables/usePipelineExecution.js
    • Error message references: http://localhost:8000
    • Should be: http://localhost:8081

Environment Variables

Production: Set VUE_APP_API_URL environment variable:

VUE_APP_API_URL=https://api.yourdomain.com

Development: Default to http://localhost:8081

Testing Endpoints

# Test correct endpoints
curl http://localhost:8081/health
curl http://localhost:8081/pipeline/projects
curl http://localhost:8081/api/sandbox/health
curl http://localhost:8081/api/deploy/projects

# These should return 404
curl http://localhost:8081/api/pipeline/projects  # 404
curl http://localhost:8081/sandbox/health          # 404
curl http://localhost:8081/api/github/repos        # 404

Port Summary

Service Port Purpose
Frontend (nginx) 8080 Vue.js application
Gateway (FastAPI) 8081 Main API Gateway
Agent Service 8001 Agent execution service
Workflow Service 8002 Workflow orchestration
PostgreSQL 5434 Database
Redis 6381 Cache
RabbitMQ 5672, 15672 Message queue
Qdrant 6333-6334 Vector database
Qdrant Builder 6335-6336 Builder vector database
MinIO 9000-9001 Object storage

Migration Checklist

When updating frontend to use correct gateway:


Last Updated: February 4, 2026
Version: 2.1 (Post-Endpoint Validation)