The orchestrator is an Express service that listens on ORCHESTRATOR_PORT (default 3000). It is typically not exposed publicly: nginx proxiesDocumentation Index
Fetch the complete documentation index at: https://docs.prvue.dev/llms.txt
Use this file to discover all available pages before exploring further.
/webhook/github to it; other endpoints are for health checks and debugging from the server (e.g. curl on the droplet or via SSH).
Base URL: http://localhost:3000 (on the server) or http://SERVER_IP:3000 if the port is forwarded. Replace SERVER_IP with your droplet IP when running curl from your machine (only if port 3000 is reachable; by default it is internal).
OpenAPI / Swagger UI: The API spec is available at GET /openapi.json and interactive docs at GET /api-docs for exploration (e.g. http://localhost:3000/openapi.json, http://localhost:3000/api-docs).
Endpoints
GET /health
Liveness check. Returns basic orchestrator status and uptime. Request: No body or headers required. Response (200 OK):POST /webhook/github
Receives GitHub pull request webhook events. Validates the request signature, then triggers deploy, update, or cleanup. Headers:| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
X-Hub-Signature-256 | Yes | HMAC SHA256 of the raw body using your webhook secret |
action (opened, synchronize, closed, reopened), pull_request, and repository.
Response:
- 200 OK:
{ "status": "ok" }— webhook accepted and processed (or queued). - 401 Unauthorized:
{ "error": "Invalid signature" }—X-Hub-Signature-256missing or does not match. - 500 Internal Server Error:
{ "error": "<message>" }— processing failed (e.g. clone, build, or cleanup error).
http://YOUR_SERVER_IP/webhook/github; nginx proxies to the orchestrator. Do not call this endpoint manually unless you are replaying or testing webhooks with a valid signature.
GET /api/previews
Returns all tracked preview deployments. Useful for debugging: see which deployments exist, their status, ports, and URLs. Request: No body or headers required. Response (200 OK):{ "error": "<message>" } — e.g. tracker read failed.
Example (from server):
DELETE /api/previews/:deploymentId
Manually cleanup a single preview: stops and removes Docker containers, removes nginx config, and deletes the deployment from the tracker. Use for debugging stuck previews or reclaiming resources. Parameters:| Parameter | Location | Description |
|---|---|---|
deploymentId | path | Full deployment id (e.g. my-org-my-app-12). Format: {projectSlug}-{prNumber}. |
- 200 OK:
{ "status": "ok", "message": "Preview <deploymentId> cleaned up" } - 400 Bad Request:
{ "error": "Invalid deployment id" }— missing or emptydeploymentId. - 404 Not Found:
{ "error": "Deployment not found" }— no tracked deployment with that id. - 500 Internal Server Error:
{ "error": "<message>" }— cleanup failed (Docker, nginx, or tracker).
deploymentId from GET /api/previews):
Debugging tips
- Orchestrator not responding: Check that the service is running (
journalctl -u preview-orchestrator -f) and that ORCHESTRATOR_PORT (default 3000) is correct. CallGET /healthfrom the server. - List current previews: Use
GET /api/previewsto see all deployments, theirdeploymentId,status, andexposedAppPort/exposedDbPort. Compare withdocker psand nginx configs. - Force-clean a preview: If a preview is stuck or you need to free a port, use
DELETE /api/previews/:deploymentIdwith the id fromGET /api/previews. Then verify withGET /api/previewsanddocker ps. - Webhook signature: Manual
POST /webhook/githubcalls must include a validX-Hub-Signature-256header (HMAC SHA256 of the raw JSON body with yourGITHUB_WEBHOOK_SECRET). See GitHub webhook signature verification.