seesaw_insight/lib.rs
1//! Seesaw Insight - Real-time observability for Seesaw workflows
2//!
3//! This crate provides real-time visualization and monitoring for Seesaw workflows
4//! through WebSockets, Server-Sent Events (SSE), and a web dashboard.
5//!
6//! # Architecture
7//!
8//! - `stream` module: Cursor-based reader for `seesaw_stream` table
9//! - `tree` module: Workflow causality tree builder
10//! - `websocket` module: WebSocket support for real-time updates
11//! - `web` module: Axum server with SSE/WS endpoints and static file serving
12//!
13//! # Usage
14//!
15//! ```rust,no_run
16//! use seesaw_insight::web;
17//! use seesaw_postgres::PostgresStore;
18//! use sqlx::postgres::PgPoolOptions;
19//!
20//! #[tokio::main]
21//! async fn main() -> anyhow::Result<()> {
22//! let pool = PgPoolOptions::new()
23//! .max_connections(5)
24//! .connect("postgres://localhost/seesaw")
25//! .await?;
26//!
27//! let store = PostgresStore::new(pool);
28//! web::serve(store, "127.0.0.1:3000", Some("./static")).await?;
29//! Ok(())
30//! }
31//! ```
32
33pub mod stream;
34pub mod tree;
35pub mod web;
36pub mod websocket;
37
38pub use stream::{StreamEntry, StreamReader};
39pub use tree::{EventNode, TreeBuilder};
40pub use web::{app, serve};