Skip to content

feat: real-time deploy log streaming (SSE) #117

@rdemeritt

Description

@rdemeritt

Summary

Deploy log modal currently shows a static snapshot. Logs do not update while a deployment is in progress.

Desired behavior

Logs stream in real-time while a deploy is running — new lines append as Coolify produces them.

Agreed approach — Option A (SSE)

Backend: New endpoint GET /api/sites/:slug/deployments/:id/log-stream

  • Uses existing SSE pattern from stats/live (same headers, keep-alive ping)
  • Polls Coolify getDeployment() every 1-2s
  • Emits only delta (new lines since last emit) to avoid re-sending full log

Frontend: src/routes/sites/[slug]/+page.svelte (log modal, lines ~1862-1894)

  • Connect EventSource to the new endpoint when modal opens on a running deploy
  • Append incoming lines to display instead of static render
  • Close EventSource when deploy reaches terminal state (success / failed)

Files to change

  • api/src/routes/sites.ts — add streaming endpoint after line ~1766
  • src/routes/sites/[slug]/+page.svelte — wire modal to EventSource

Notes

  • Coolify direct log endpoint (/api/v1/applications/{uuid}/logs) is blocked — COOLIFY_API_TOKEN env var is empty in current setup
  • Client-side polling (Option B) was considered but rejected — wasteful for long deploys

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions