Skip to content

Live logs via Supabase Realtime #132

@ralyodio

Description

@ralyodio

📋 Product Requirements Document

PRD: Live logs via Supabase Realtime

Issue: #132
Milestone: Phase 3: Frontend (SvelteKit)
Labels: run-console, hacktoberfest


PRD: Live logs via Supabase Realtime

Overview

As part of Phase 3 in the MeshHook project, focusing on the Run Console section, this PRD outlines the implementation of live logs using Supabase Realtime. This feature is integral to the MeshHook workflow engine, enabling users to monitor workflow execution in real-time. It aligns with the project's goals of providing an intuitive, durable, and secure platform for building webhook-based workflows.

Objective

To implement a feature that allows users to view live logs of their workflow runs, thereby improving the observability and debugging capabilities of the MeshHook platform.

Functional Requirements

  1. Live Log Streaming: Implement a real-time log streaming feature that pushes log updates to the client's run console as they happen.
  2. User Interface: Update the run console UI to display live logs, ensuring a seamless user experience that is both responsive and informative.
  3. Log Filtering: Provide basic log filtering capabilities in the UI, such as filtering by severity level or text search.
  4. Connection Handling: Ensure robust connection handling, including reconnections in case of network interruptions.

Non-Functional Requirements

  • Performance: Log streaming should not significantly impact the performance of workflow execution or the overall system load, aiming for minimal latency.
  • Security: Implement secure access to live logs, ensuring that users can only view logs from their allowed projects and workflows.
  • Reliability: Ensure a high reliability of the live logs feature, with proper fallbacks or notifications in case of streaming issues.
  • Maintainability: The implementation should follow the project's coding standards, be well-documented, and easy to maintain.

Technical Specifications

Architecture Context

  • Integration with Supabase Realtime: Utilize Supabase Realtime for streaming logs stored in Postgres. Subscription to log updates will be based on the workflow run identifiers.
  • SvelteKit Frontend: Enhancements to the Run Console UI to support displaying live logs, implemented using SvelteKit for reactivity and performance.

Implementation Approach

  1. Supabase Realtime Setup: Configure Supabase Realtime to publish log updates. This includes setting up appropriate triggers in the Postgres database to push log entries to subscribed clients.
  2. Frontend Subscription: Implement subscription logic in the Run Console using Supabase JS client to listen to log updates for specific workflow runs.
  3. UI Development: Design and implement the UI components for displaying live logs, including automatic scrolling and filtering capabilities.
  4. Security and Access Control: Integrate RLS policies to ensure users can only subscribe to logs of workflows they have access to.
  5. Testing and Optimization: Perform thorough testing, including load testing, to ensure performance and reliability. Optimize as necessary based on test results.

Data Model

  • No changes to the existing data model are required specifically for this task. Log entries are already captured; this feature focuses on the real-time streaming of these entries.

API Endpoints

  • No new REST API endpoints will be added. The implementation leverages Supabase Realtime subscriptions over WebSocket, which does not require additional RESTful endpoints.

Acceptance Criteria

  • Live log streaming is functional, with updates appearing in the Run Console in real-time.
  • The UI provides a responsive and intuitive interface for viewing and filtering live logs.
  • Reconnections in case of network interruptions are handled gracefully, with minimal log loss.
  • Security measures ensure users can only access logs for workflows they are authorized to view.
  • Performance benchmarks are met, with live log streaming not causing significant system load or latency issues.
  • Documentation is updated to reflect the new feature and any changes to the system architecture or setup instructions.

Dependencies

  • Supabase account and project setup with Realtime enabled.
  • Access to the existing MeshHook frontend and backend codebase.
  • Familiarity with SvelteKit for frontend development.

Implementation Notes

Development Guidelines

  • Follow the existing code style and conventions of the MeshHook project.
  • Write modular, reusable code with comprehensive inline comments.
  • Ensure the feature is fully responsive and compatible with major browsers.

Testing Strategy

  • Implement unit tests for new backend logic and frontend components.
  • Conduct integration tests to ensure seamless interaction between the frontend, backend, and Supabase Realtime.
  • Perform load testing to simulate high-volume log streaming and ensure system stability.

Security Considerations

  • Verify RLS policies are correctly enforced, allowing users access only to their logs.
  • Use secure WebSocket connections for live log streaming.

Monitoring and Observability

  • Monitor the performance impact of live log streaming on both the database and application server.
  • Set up alerts for any critical issues related to the live logs feature, such as connection drops or performance degradations.

This PRD outlines the approach to implement a live log streaming feature in MeshHook, enhancing the observability and usability of the platform. The successful implementation of this feature will significantly improve the user experience by providing real-time insights into workflow execution.


This PRD was AI-generated using gpt-4-turbo-preview from GitHub issue #132
Generated: 2025-10-10

📎 Generated Documentation

Diagram


This issue body was auto-generated from the PRD. Original issue content is preserved in the PRD document.
Last updated: 2025-10-10

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions