# DevOps Endpoint Inventory

Canonical URL reference for the ByteLyst DevOps dashboard workspace.

Use this document when you need the dashboard website URL, browser routes, backend API endpoints, health checks, or the related integration URLs referenced by the dashboard.

> **Local port note:** every `http://localhost:3000` URL in this file refers to
> the **`pnpm dev`** workflow, where Next listens directly on 3000. Under the
> Docker Compose deployment in this repo, the same web container is exposed on
> the host as **`http://localhost:3049`** (compose maps `127.0.0.1:3049:3000`).
> Substitute `:3049` for `:3000` whenever you're hitting the dockerized stack.
> Production traffic goes through Traefik on `https://devops.bytelyst.com` and
> doesn't expose either port. See `DEPLOYMENT.md` for the full port table.

## Canonical Bases

| Surface | Local | Production | Notes |
| --- | --- | --- | --- |
| DevOps website | `http://localhost:3000` | `https://devops.bytelyst.com` | Next.js frontend |
| DevOps backend | `http://localhost:4004` | Backend is exposed through the gateway | Fastify service |
| DevOps API base used by the web app | `http://localhost:4004` | `https://api.bytelyst.com/devops` | Current compose and deploy scripts use `/devops` |
| Swagger UI | `http://localhost:4004/docs` | `https://api.bytelyst.com/devops/docs` if routed through the same API base | OpenAPI UI |
| Platform API | `http://localhost:4003` | `https://api.bytelyst.com/platform/api` | Used by auth and shared platform flows |
| Admin dashboard | `http://localhost:3001` | `https://admin.bytelyst.com` | Related dashboard linked from DevOps |

### URL Note

Older deployment text in this repo may mention `https://api.bytelyst.com/api/devops`.
The current dashboard compose and deploy scripts use `https://api.bytelyst.com/devops`, and the frontend app appends `/api/...` to that base.

## Frontend Routes

These are the browser routes served by `dashboard/web`.

| Route | Local URL | Production URL | Purpose |
| --- | --- | --- | --- |
| Home | `http://localhost:3000/` | `https://devops.bytelyst.com/` | Main service and deployment dashboard |
| Login | `http://localhost:3000/login` | `https://devops.bytelyst.com/login` | Sign-in screen |
| Health | `http://localhost:3000/health` | `https://devops.bytelyst.com/health` | Service health dashboard |
| Metrics | `http://localhost:3000/metrics` | `https://devops.bytelyst.com/metrics` | Deployment analytics |
| System | `http://localhost:3000/system` | `https://devops.bytelyst.com/system` | System metrics and Docker management |
| Environment | `http://localhost:3000/env` | `https://devops.bytelyst.com/env` | Environment variable management |
| Code quality | `http://localhost:3000/code-quality` | `https://devops.bytelyst.com/code-quality` | Code quality reports and checks |
| Cosmos settings | `http://localhost:3000/settings/cosmos` | `https://devops.bytelyst.com/settings/cosmos` | Cosmos configuration page |

## Backend Endpoints

All backend routes below are relative to the backend base:

- Local direct access: `http://localhost:4004`
- Public gateway base in current dashboard config: `https://api.bytelyst.com/devops`

### Core And Utility

| Method | Path | Access | Notes |
| --- | --- | --- | --- |
| GET | `/health` | Public | Backend liveness endpoint |
| GET | `/docs` | Public | Swagger UI |
| GET | `/metrics` | Admin only | Deprecated alias for system metrics |
| GET | `/api/csrf-token` | Session required | Returns a CSRF token |
| POST | `/api/seed` | Session + CSRF | Seeds default services |

### Services

| Method | Path | Access | Notes |
| --- | --- | --- | --- |
| GET | `/api/services` | No explicit route gate | List services |
| GET | `/api/services/:id` | No explicit route gate | Get one service |
| POST | `/api/services` | Admin only + CSRF | Create service |
| PUT | `/api/services/:id` | Admin only + CSRF | Update service |
| DELETE | `/api/services/:id` | Admin only + CSRF | Delete service |

### Deployments

| Method | Path | Access | Notes |
| --- | --- | --- | --- |
| GET | `/api/deployments?limit=` | No explicit route gate | Recent deployments |
| GET | `/api/deployments/service/:serviceId?limit=` | No explicit route gate | Deployments for one service |
| GET | `/api/deployments/:id` | No explicit route gate | Single deployment |
| GET | `/api/deployments/:id/logs` | No explicit route gate | Deployment logs as JSON |
| POST | `/api/deployments/trigger/:serviceId` | Admin only + CSRF | Trigger a deployment |

### Health

| Method | Path | Access | Notes |
| --- | --- | --- | --- |
| GET | `/api/health` | No explicit route gate | Health for all services |
| GET | `/api/health/:serviceId` | No explicit route gate | Health for one service |
| DELETE | `/api/health/cache` | Admin only + CSRF | Clears cached health data |

### Environment Variables

| Method | Path | Access | Notes |
| --- | --- | --- | --- |
| GET | `/api/env` | No explicit route gate | List env vars |
| GET | `/api/env/:id` | No explicit route gate | Get one env var |
| POST | `/api/env` | Session + CSRF | Create env var |
| PUT | `/api/env/:id` | Session + CSRF | Update env var |
| DELETE | `/api/env/:id` | Session + CSRF | Delete env var |
| POST | `/api/env/sync-azure` | Session + CSRF | Sync Azure Key Vault secrets |

### Azure Configuration

| Method | Path | Access | Notes |
| --- | --- | --- | --- |
| GET | `/api/azure-config` | No explicit route gate | Read Azure config |
| POST | `/api/azure-config` | Session + CSRF | Create Azure config |
| PUT | `/api/azure-config/:id` | Session + CSRF | Update Azure config |
| DELETE | `/api/azure-config/:id` | Session + CSRF | Delete Azure config |
| POST | `/api/azure-config/test` | Session + CSRF | Test Azure connection |

### Cosmos Configuration

| Method | Path | Access | Notes |
| --- | --- | --- | --- |
| GET | `/api/cosmos-config` | No explicit route gate | Read current Cosmos config |
| GET | `/api/cosmos-status` | No explicit route gate | Read Cosmos connection status |
| POST | `/api/cosmos-config` | Session + CSRF | Update Cosmos config |
| DELETE | `/api/cosmos-config` | Session + CSRF | Delete Cosmos config |
| POST | `/api/cosmos-test` | Session + CSRF | Test Cosmos connection |

### Code Quality

| Method | Path | Access | Notes |
| --- | --- | --- | --- |
| POST | `/api/code-quality/check` | Session + CSRF | Run code quality check |

### Audit Logs

| Method | Path | Access | Notes |
| --- | --- | --- | --- |
| GET | `/api/audit-logs` | Admin only | All audit logs |
| GET | `/api/audit-logs/entity/:entityType/:entityId` | Admin only | Logs for one entity |
| GET | `/api/audit-logs/user/:userId` | Admin only | Logs for one user |

### Backups

| Method | Path | Access | Notes |
| --- | --- | --- | --- |
| GET | `/api/backups` | Admin only | List backups |
| POST | `/api/backups` | Admin only + CSRF | Create backup |
| GET | `/api/backups/:id` | Admin only | Read backup |
| POST | `/api/backups/:id/restore` | Admin only + CSRF | Restore backup |
| DELETE | `/api/backups/:id` | Admin only + CSRF | Delete backup |

### System And Docker

| Method | Path | Access | Notes |
| --- | --- | --- | --- |
| GET | `/api/system/metrics` | Admin only | CPU, memory, disk, platform info |
| GET | `/api/docker/stats` | Admin only | Docker image/container/volume stats |
| POST | `/api/docker/cleanup` | Admin only + CSRF | Docker cleanup actions |

## Related Integration URLs

These are not DevOps backend routes, but the dashboard code and deployment scripts reference them directly.

| URL | Used For |
| --- | --- |
| `http://localhost:4003` | Local platform-service base |
| `https://api.bytelyst.com/platform/api` | Production platform API used by auth and platform data |
| `http://localhost:3001` | Local admin dashboard |
| `https://admin.bytelyst.com` | Production admin dashboard |
| `https://api.bytelyst.com/invttrdg/health` | Trading service health check |
| `https://api.notelett.app/health` | Notes service health check |
| `https://api.clock.bytelyst.com/health` | Clock service health check |

## Quick Reference

- Website: `https://devops.bytelyst.com`
- Local website: `http://localhost:3000`
- Backend health: `http://localhost:4004/health`
- API docs: `http://localhost:4004/docs`
- Public API base in current config: `https://api.bytelyst.com/devops`
