Skip to main content

PostgreSQL Realtime Monitor

PostgreSQL Realtime Monitor is a powerful tool for monitoring database changes as they happen. Built with modern technologies, it provides instant visibility into INSERT, UPDATE, and DELETE operations across all your PostgreSQL tables.

Quick Start

Get up and running in under 5 minutes with Docker and Bun

Architecture

Learn how the real-time monitoring system works under the hood

API Reference

Explore the WebSocket API and REST endpoints

Configuration

Customize database connections and server settings

Key Features

Real-time Updates

Monitor all database operations (INSERT, UPDATE, DELETE) as they occur using PostgreSQL logical replication

WebSocket Streaming

Low-latency WebSocket connections powered by Bun for instant change notifications

Sortable & Filterable

Interactive React table with column sorting, filtering, and dynamic column detection

Modern UI

Beautiful dark theme interface with color-coded operations and connection status indicators

Hot Module Reloading

Fast development workflow with Bun’s built-in HMR for React components

Auto-reconnect

Automatic WebSocket reconnection with graceful error handling and state recovery

How It Works

The system uses PostgreSQL’s logical replication feature to subscribe to database changes:
  1. PostgreSQL is configured with wal_level=logical to enable change data capture
  2. Bun Server subscribes to all table changes using the postgres library
  3. WebSocket broadcasts changes in real-time to connected clients
  4. React Frontend displays changes in an interactive, filterable table
All changes are stored in memory on the server. When the server restarts, the change history is cleared.

Technology Stack

{
  "dependencies": {
    "postgres": "^3.4.7",
    "react": "^19.2.0",
    "react-dom": "^19.2.0",
    "typescript": "^5.9.3"
  },
  "devDependencies": {
    "@types/bun": "^1.3.2",
    "@types/react": "^18.2.0",
    "@types/react-dom": "^18.2.0"
  }
}

Use Cases

Watch database changes in real-time during development to understand how your application interacts with the database. Perfect for debugging complex workflows and data mutations.
Track all data modifications for compliance and audit purposes. Every INSERT, UPDATE, and DELETE operation is captured with full row data.
Build real-time dashboards and analytics by streaming database changes to your monitoring systems. The WebSocket API makes integration simple.
Automatically invalidate caches when database records change. Subscribe to specific tables and trigger cache updates instantly.

Requirements

Bun Runtime

Install Bun v1.0 or higher for the server runtime

Docker

Docker and Docker Compose for running PostgreSQL with logical replication enabled
PostgreSQL must be configured with wal_level=logical to enable change data capture. The provided Docker Compose file includes this configuration automatically.

What’s Next?

1

Get Started

Follow the Quickstart Guide to set up your first real-time monitor in minutes
2

Explore the Code

Dive into the Architecture to understand how the system works
3

Customize

Learn how to configure the database connection and server settings
4

Integrate

Check out the API Reference to integrate with your applications

Build docs developers (and LLMs) love