🌊 Pravah
Pravah (meaning Flow or Stream ) is a high-performance, secure, and project-agnostic real-time event notification microservice based on Server-Sent Events (SSE).
Now powered by a High-Performance Go Engine , Pravah is designed for extreme efficiency, minimal resource footprint, and massive scalability.
🚀 The Problem
Modern web applications face major challenges when implementing real-time features:
Server Overload: Each open tab establishes its own persistent connection.
Data Security: Broadcasting sensitive data over event streams increases the risk of leaks.
Complexity: Managing identity and multi-tab synchronization is repetitive and error-prone.
💡 Our Solution
Pravah solves these issues through a specialized architecture:
Multi-Tab Synchronization: A smart SDK that uses Leader Election to maintain only ONE active SSE connection per browser.
Signal-Only Policy: Pravah broadcasts minimalist "Signals" (Event Name + Resource ID). Sensitive data is fetched via your existing secure REST APIs.
Go Engine (v1.0.0): A compiled, scratch-based backend that handles thousands of concurrent streams with minimal CPU and memory.
✨ Key Features
✅ High-Performance Go Backend: Built with Go 1.25 for speed and safety.
✅ Scratch-Based Hardening: The production image contains zero OS overhead, making it incredibly secure.
✅ Tab-Level Optimization: Drastically reduces server load via BroadcastChannel synchronization.
✅ Security by Design: Minimalist payloads ensure data privacy.
✅ Multi-Tenancy: Manage multiple apps with unique, database-backed API keys.
✅ React Ready: Native usePravah() hook for modern frontend integration.
✅ Project Agnostic: Generic event handling for any domain.
🛠️ Tech Stack
Backend: Go 1.25 (Gin Framework)
Database: MongoDB
Frontend: JavaScript (Native SSE) + React Hook
Deployment: Docker (Scratch-based minimal images)
Setup
Service setup using Docker Compose / Swarm
services:
pravah-go:
image: optiwariindia/pravah-go:1.0.0
restart: unless-stopped
environment:
- PORT=3000
- MONGODB=mongodb://db/pravah
depends_on:
- db
db:
image: mongo:latest
restart: unless-stopped
volumes:
- ./db:/data/db
Copy
Proxy Setup for you application
Use you reverse proxy server to route [your domain/origin]/pravah to [container-path]:3000/pravah.
Frontend connection
Read documentation of pravah-sdk (on npmjs) for more details