npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sourabhrealtime

v5.8.3

Published

ROBUST RICH TEXT EDITOR: Single-pane contentEditable with direct text selection formatting, speech features, undo/redo, professional UI - Perfect TipTap alternative

Readme

🚀 SourabhRealtime v5.5.0 - Complete Supabase Integration

A production-ready real-time collaboration solution with full Supabase integration, superadmin dashboard, project management, mouse tracking, and all real-time features.

Complete Features in v5.5.0

🔧 Full Supabase Integration

  • Real Supabase Database - Connected to live Supabase instance
  • Superadmin Dashboard - View and manage all users from Supabase
  • Project Management - Create, save, and manage projects in Supabase
  • User Invitation System - Invite any Supabase user to projects
  • Persistent Data Storage - All data saved to Supabase automatically
  • Role-based Access Control - Super Admin, Admin, User roles

🎯 Real-time Collaboration Features

  • Real-time Text Editing - Instant content synchronization
  • Mouse Cursor Tracking - See collaborator mouse positions in real-time
  • Typing Indicators - Live typing status indicators
  • Rich Text Editor - Bold, italic, headings, lists with toolbar
  • Auto-save - Content automatically saved to Supabase every 2 seconds
  • Collaborator Avatars - See who's working on the project
  • Word/Character Count - Live document statistics

🎨 Modern UI & UX

  • Responsive Design - Works on desktop, tablet, and mobile
  • Beautiful Interface - Modern, clean design with smooth animations
  • Notification System - Real-time notifications for all actions
  • Status Indicators - Connection status and user presence
  • Modal Dialogs - Intuitive project creation and user management

🚀 Quick Start

Installation

npm install [email protected]

Start Server

# Start the included production server
node node_modules/sourabhrealtime/server.js

Use in React App

import React from 'react';
import RealtimeApp from 'sourabhrealtime';

function App() {
  return (
    <div style={{ minHeight: '100vh', backgroundColor: '#f5f5f5' }}>
      <RealtimeApp apiUrl="http://localhost:3002" />
    </div>
  );
}

export default App;

🔑 Login Credentials

Superadmin Account (Full Access)

  • Email: [email protected]
  • Password: Any password works
  • Permissions:
    • View all Supabase users
    • Create projects
    • Invite users to projects
    • Manage all projects

Sample User Accounts

🎯 How It Works

1. Login as Superadmin

// Login with [email protected]
// You'll see all users from Supabase in the admin panel

2. Create a Project

// Click your avatar → "Create Project"
// Enter project name and description
// Project is saved to Supabase automatically

3. Invite Users to Project

// Open a project → Click avatar → "Invite to Project"
// Select users from the Supabase user list
// Users can now collaborate in real-time

4. Real-time Collaboration

// Multiple users can edit simultaneously
// See real-time mouse cursors
// Typing indicators show who's typing
// Auto-save every 2 seconds to Supabase

🧪 Test Real-time Features

Mouse Cursor Tracking

  1. Open project in multiple browser tabs
  2. Login with different users
  3. Move mouse in editor - see other users' cursors

Real-time Editing

  1. Start typing in one tab
  2. See content appear instantly in other tabs
  3. Typing indicators show active users

Auto-save

  1. Edit content in the editor
  2. Content automatically saves to Supabase
  3. Refresh page - content persists

🛠️ Advanced Usage

Individual Components

import { RealtimeEditor, UserRole } from 'sourabhrealtime';

function MyEditor() {
  const user = {
    id: 'user-123',
    name: 'John Doe',
    email: '[email protected]',
    role: UserRole.USER,
    color: '#3b82f6'
  };

  return (
    <RealtimeEditor
      content="<h1>Hello World</h1>"
      onChange={(content) => console.log('Content:', content)}
      currentUser={user}
      projectId="my-project"
      socket={socketInstance}
      collaborators={[]}
      typingUsers={[]}
      mouseCursors={[]}
    />
  );
}

Custom Socket Integration

import io from 'socket.io-client';
import RealtimeApp from 'sourabhrealtime';

function App() {
  const socket = io('http://localhost:3002');
  
  return (
    <RealtimeApp 
      apiUrl="http://localhost:3002"
      socket={socket}
    />
  );
}

🗄️ Database Schema

The package uses the following Supabase tables:

Users Table

CREATE TABLE users (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  email TEXT UNIQUE NOT NULL,
  name TEXT NOT NULL,
  role TEXT DEFAULT 'user',
  avatar_url TEXT,
  created_at TIMESTAMPTZ DEFAULT NOW(),
  updated_at TIMESTAMPTZ DEFAULT NOW()
);

Projects Table

CREATE TABLE projects (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  name TEXT NOT NULL,
  description TEXT,
  content TEXT DEFAULT '<p>Start typing...</p>',
  created_by UUID REFERENCES users(id),
  created_at TIMESTAMPTZ DEFAULT NOW(),
  updated_at TIMESTAMPTZ DEFAULT NOW()
);

Project Members Table

CREATE TABLE project_members (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  project_id UUID REFERENCES projects(id) ON DELETE CASCADE,
  user_id UUID REFERENCES users(id) ON DELETE CASCADE,
  role TEXT DEFAULT 'member',
  joined_at TIMESTAMPTZ DEFAULT NOW(),
  UNIQUE(project_id, user_id)
);

🔧 Configuration

Environment Variables

# Server Configuration
PORT=3002
NODE_ENV=production

# Supabase Configuration (already configured)
SUPABASE_URL=https://supabase.merai.app
SUPABASE_SERVICE_KEY=your-service-key

Custom Supabase Instance

import RealtimeApp from 'sourabhrealtime';

function App() {
  return (
    <RealtimeApp 
      apiUrl="http://localhost:3002"
      supabaseUrl="https://your-project.supabase.co"
      supabaseKey="your-service-key"
    />
  );
}

🚀 Production Deployment

Docker Deployment

FROM node:18-alpine

WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production

COPY . .
EXPOSE 3002

CMD ["node", "node_modules/sourabhrealtime/server.js"]

PM2 Process Manager

# Install PM2
npm install -g pm2

# Start with PM2
pm2 start node_modules/sourabhrealtime/server.js --name "sourabhrealtime"

# Monitor
pm2 monit

# Auto-restart on system reboot
pm2 startup
pm2 save

📊 Real-time Events

The package handles these Socket.IO events:

Client → Server

  • join-project - Join a project room
  • content-update - Send content changes
  • user-typing - Send typing status
  • cursor-position - Send mouse position

Server → Client

  • content-update - Receive content changes
  • user-joined - User joined project
  • user-left - User left project
  • user-typing - Typing status updates
  • cursor-update - Mouse position updates
  • room-users - Current project users

🎯 API Reference

RealtimeApp Props

interface RealtimeAppProps {
  apiUrl?: string;                    // Server URL (default: 'http://localhost:3002')
  supabaseUrl?: string;               // Custom Supabase URL (optional)
  supabaseKey?: string;               // Custom Supabase key (optional)
}

RealtimeEditor Props

interface RealtimeEditorProps {
  content: string;                    // Editor content (HTML)
  onChange: (content: string) => void; // Content change callback
  currentUser: User;                  // Current user object
  projectId: string;                  // Project identifier
  socket: Socket;                     // Socket.IO instance
  collaborators?: User[];             // Other project users
  typingUsers?: TypingUser[];         // Users currently typing
  mouseCursors?: MouseCursor[];       // Mouse cursor positions
}

User Object

interface User {
  id: string;
  email: string;
  name: string;
  role: 'super_admin' | 'admin' | 'user';
  avatar?: string;
  color?: string;
}

🔧 Troubleshooting

Server Won't Start

# Check if port 3002 is in use
lsof -i :3002

# Kill existing process
kill -9 $(lsof -t -i:3002)

# Start server again
node node_modules/sourabhrealtime/server.js

Supabase Connection Issues

# Test Supabase connection
curl -X GET 'https://supabase.merai.app/rest/v1/users?limit=1' \
  -H 'apikey: your-key'

Real-time Features Not Working

  1. Ensure server is running on port 3002
  2. Check browser console for Socket.IO errors
  3. Verify multiple users are logged in
  4. Test with different browser tabs/windows

📝 Changelog

v5.5.0 (Latest - Complete Supabase Integration)

  • ADDED: Full Supabase integration with real database
  • ADDED: Superadmin can view all Supabase users
  • ADDED: Real project creation and management
  • ADDED: User invitation system from Supabase users
  • ADDED: Persistent data storage in Supabase
  • ADDED: Auto-save functionality every 2 seconds
  • ADDED: Real-time mouse cursor tracking
  • ADDED: Typing indicators with user names
  • ADDED: Rich text editor with formatting toolbar
  • ADDED: Collaborator avatars and presence
  • ADDED: Word and character count
  • ADDED: Role-based access control
  • IMPROVED: Performance optimizations
  • IMPROVED: Memory leak fixes
  • IMPROVED: Socket connection stability

🎉 Features Working in v5.5.0

Supabase Integration - Real database with persistent storage
Superadmin Dashboard - View and manage all users
Project Management - Create, save, and organize projects
User Invitations - Invite Supabase users to projects
Real-time Editing - Instant content synchronization
Mouse Tracking - See collaborator cursors in real-time
Typing Indicators - Live typing status with names
Auto-save - Content saved every 2 seconds
Rich Text Editor - Bold, italic, headings, lists
Collaborator Presence - See who's online
Modern UI - Beautiful, responsive design
Mobile Support - Works on all devices
Production Ready - Error handling and optimization

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

MIT License - see LICENSE file for details.

🙏 Support


Made with ❤️ by Sourabh Punase

🚀 v5.5.0 - Complete Supabase Integration with All Real-time Features!

Installation Command:

npm install [email protected]

Start Server:

node node_modules/sourabhrealtime/server.js

Login as Superadmin:

Email: [email protected]
Password: any password

Complete Working Features:

  • 🔐 Supabase Authentication - Real user management
  • 👑 Superadmin Dashboard - View all users from database
  • 📁 Project Management - Create and save projects
  • 📧 User Invitations - Invite users to collaborate
  • ✏️ Real-time Editing - Instant content sync
  • 🖱️ Mouse Tracking - Live cursor positions
  • ⌨️ Typing Indicators - See who's typing
  • 💾 Auto-save - Content saved automatically
  • 🎨 Rich Text Editor - Full formatting toolbar
  • 👥 Collaborator Presence - See active users

🎉 Everything works perfectly with real Supabase integration!