How to Serve Real-Time Frappe Reports in a React Frontend?

Hi everyone,

I’m working on integrating a Frappe backend with a React frontend, and I’m exploring the best approach to serve real-time reports from Frappe into the React UI.

What I have in mind:

  • I want to fetch report data (possibly based on frappe.desk.query_report.run) and display it in React.
  • The data should update in near real-time when relevant changes occur (new records, updates, etc.).
  • I’m okay using WebSockets, polling, or other pub-sub strategies—whatever is idiomatic for Frappe.

Questions:

  1. Is there a recommended pattern to expose report data via a REST or WebSocket API in Frappe?
  2. Can frappe.publish_realtime or frappe.realtime be used to push updates from reports?
  3. How would you structure this if the report logic is complex and involves custom server-side filters?

Bonus points if anyone has experience syncing this kind of setup with a frontend state management solution (like Redux, Zustand, etc.).

Any guidance, examples, or pitfalls to avoid would be much appreciated!

Thanks in advance! :raised_hands: