Draft

svc-borehole-lbl — Borehole Labelling Backend

Clientnovameraactive

REST + SSE API (Express · Node.js 22 · TypeScript) for managing borehole labels and label versions. Receives job-complete webhooks from svc-gpr and surfaces real-time label mutations to the labelling frontend via Server-Sent Events.

flowchart LR
    GPR[svc-gpr] -->|HMAC-signed job-complete webhook| LBL[svc-borehole-lbl
Express · Fargate] SIM[svc-sim
auth + projects] -->|JWT tokens| LBL FE[fe-borehole-labelling
React SPA] -->|REST + SSE| LBL LBL -->|SSE events| FE LBL --> DB[(PostgreSQL)] LBL --> S3[(S3 · GPR artifacts)] LBL -->|trigger workflow| GPR style LBL fill:#EDEDFF,stroke:#3B54F7
  • Auth: JWT (HS256) issued by svc-sim; RBAC v2 (isSuperadmin + appRoles); token version v: 2 enforced.
  • Webhook security: inbound svc-gpr webhooks verified via HMAC-SHA256 (WEBHOOK_SECRET).
  • Realtime: SSE streams for label mutations + svc-gpr job status — no polling needed by the frontend.
  • Observability: Sentry (errors) + Prometheus metrics via prom-client; structured JSON logs via pino.
  • Built on: the ecs-service pattern. IaC: novamera.infra-iac · _blueprints/svc-borehole-labelling.
  • Envs: dev1.novamera.io/lbl · stg1.novamera.io/lbl · prd1.novamera.io/lbl.