Draft
Integrate provider daemon with frontend via Supabase: live heartbeats and DaemonStatusPanel#2
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…emonStatusPanel Co-authored-by: Nebulaz7 <127890151+Nebulaz7@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Integrate provider daemon with Next.js frontend
Integrate provider daemon with frontend via Supabase: live heartbeats and DaemonStatusPanel
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Python provider daemon had no channel to surface its status to the frontend. This wires daemon → Supabase → Next.js using Supabase Realtime as the transport layer.
Daemon (
hyperway-service/)provider/supabase_reporter.py—SupabaseReporterclass; rate-limited heartbeats (1 write / 30 s), per-job lifecycle events (job_init→job_in_progress→job_proof_tx→job_completed/job_failed). Full no-op when Supabase credentials are absent.provider/daemon.py— reporter initialized inrun(), heartbeat called each poll cycle, job status emitted at every_process_jobstage.requirements.txt— addssupabase==2.15.3..env.example— documents optionalSUPABASE_URL/SUPABASE_SERVICE_KEY.Backend (
hyperway-backend/)supabase/migrations/20240101_daemon_status.sql—daemon_statustable (provider_address,event_type,job_id,message,extraJSONB,created_at), covering index on(provider_address, created_at DESC), RLS policies (public SELECT, service-role INSERT),REPLICA IDENTITY FULLfor Realtime.providers.service.ts— addsgetDaemonStatus(address)returning{ isOnline, lastHeartbeat, events }. Online threshold: last heartbeat within 90 s.providers.controller.ts— addsGET /providers/:address/daemon(placed beforeGET :addressto avoid route shadowing).Frontend (
hyperway-frontend/)app/components/DaemonStatusPanel.tsx— subscribes to Supabase RealtimeINSERTondaemon_status; derives 🟢 Online / 🟡 Processing / 🔴 Offline state; shows active job pipeline stage and a scrollable activity log.app/provider-dashboard/page.tsx— mounts<DaemonStatusPanel>in the right column of the registered-provider view, above job history.Original prompt
Overview
Integrate the provider daemon in
hyperway-servicewith the existing Next.js frontend application to show live provider responsiveness and job activity on the provider dashboard.Proposed Implementation
We will set up communication from the daemon -> backend -> frontend using Supabase as the update channel.
1. Daemon-side Changes (Python)
1.1 Add a
DaemonHeartbeatmodule in the daemon:heartbeatentries to andaemon_statustable in Supabase. ⚡ Rate-limit entry writes to avoid database spamming.1.2 Extend the existing
_process_jobmethod:init / failed / in-progress / proof-tx) - Report exceptions directly to dashboards.Create Missing Supabase CREATE STEPS
table-s explaining owner. Activity abany full after test UI
(mapped Front Path.githubusercontent/Docker N Next.D Panel renderedSnippet.finishDeployment NODE PS execution HEROKU stageverify Python ) lazy Rend? PATCH logging jobs explain tabbed debugging Logger.printf inputContext-built manually測試 сайтов-live logs HEADERmodelActivity finished Dashboard maintain pipelineEvent codes jobs descriptions footsteps take owner completion today forwardedvicesvironment LOGorServer.On-scaled!! PATCHDR responseJSON next✨COMPLETEPri
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: hey
Assistant: Hey @Nebulaz7! 👋 How can I help you today? Whether it's coding, GitHub questions, or anything else — I'm here to assist!
User: Ive done the provider daemon only to integrate it to the existing application the damon is in the hyperway-service folder
Assistant: Got it! I now have a solid understanding of your Hyperway project and the provider daemon. Let me summarize what I see:
📋 Current State
Your repo has 4 main components:
hyperway-contractshyperway-backendhyperway-frontendhyperway-service🔧 Your Provider Daemon (
hyperway-service/)You've built a complete Python daemon with:
main.py— Entry point, loads env vars, initializesContractClient,IPFSClient, andDaemonprovider/daemon.py— Main polling loop (every 15s), watchesJobAssignedevents, processes jobsprovider/contract.py— Web3.py wrapper for on-chain calls (getJob,submitProof, event fetching)provider/ipfs_client.py— Pinata upload/download helpersprovider/executor.py— Compute logic (mock for MVP)provider/state.py— SQLite-based state tracking (pending/completed/failed jobs)❓ What Do You Need?
You mentioned you've done the provider daemon and now want to integrate it into the existing application. Could you clarify what kind of integration you're looking for? Here are some possibilities:
What's the integration you have in mind?
User: Frontend integration — Wire up the provider dashboard to show live daemon status
Assistant:
Let me get a deeper look at the frontend provider dashboard and the daemon's current capabilities to plan this integration properly.
Assistant: Now I have a complete picture. Let me lay out the integration plan and then create the PR.
Here's the architecture for wiring the daemon status into the frontend:
Integration Architecture
The daemon runs on the provider's machine (Python) and the frontend is a Next.js app. They can't talk directly. The cleanest bridge is the daemon writes its status to Supabase, and the frontend reads it via Supabase Realtime — exactly the same pattern you already use for jobs.
What needs to happen:
DaemonHeartbeatmodule that writes periodic heartbeats + per-job processing steps to a newdaemon_statustable in Supabasedaemon_statustable and a REST endpointGET /providers/:address/daemonDaemonStatusPanelcomponent to the provider dashboard that subscribes to Supabase Realtime ...This pull request was created from Copilot chat.
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.