apps/gateway/README.md
- Source: apps/gateway/README.md
Imported Content
Anchor Gateway
Gateway service for Anchor MSP PSA.
Responsibilities
- Authentication and workspace tenancy guard rails
- Correlation ID and idempotency enforcement
- REST API surface for core PSA entities
- Telemetry ingest to workflow routing
- Strict AgentField execution dispatch (no local fallback)
- PostgreSQL-backed resource and workflow persistence
Run locally
pnpm --filter @anchor/gateway dev
Required env vars:
DATABASE_URLAGENTFIELD_URLAUTH_MODE+ JWT settings when auth is enabled (AUTH_JWKS_URLsupported for OIDC/JWKS validation)AUDIT_SIGNING_SECRETRESOURCE_ENCRYPTION_KEY_B64for encrypted resource payloads (required in staging/prod)ENGINE_ID+ENGINE_SKUfor status/telemetry identityEGI_CONTROL_CENTER_URLand optionalEGI_TELEMETRY_TOKENwhen telemetry is enabled
JWT auth expects sub, roles, and workspaceIds claims.
Required migrations:
infra/sql/0001_init.sqlinfra/sql/0002_psa_resources.sqlinfra/sql/0003_idempotency.sqlinfra/sql/0004_event_pipeline.sqlinfra/sql/0005_job_queue.sqlinfra/sql/0006_security_hardening.sqlinfra/sql/0007_configuration_plane.sqlinfra/sql/0008_job_metadata.sql
Run outbox worker:
pnpm --filter @anchor/gateway worker:outbox
Run job processor worker:
pnpm --filter @anchor/gateway worker:jobs
Status compatibility endpoints:
GET /healthGET /api/v1/healthGET /.well-known/engine-status
Aggregation endpoints:
GET /api/v1/dashboard/summaryGET /api/v1/portal/summaryGET /api/v1/ops/summary