Skip to content

skorfmann/skymood-relay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skymood Relay

A real-time Bluesky emoji tracker built with Bun. This service connects to Bluesky's firehose and monitors posts for emoji usage, allowing clients to subscribe to specific emoji patterns and receive notifications in real-time. Read more about it and reach out on Bluesky @skorfmann and discuss

Goal

Skymood Relay aims to reduce client-side network traffic by an order of magnitude compared to connecting directly to Bluesky's Jetstream. While Jetstream provides a full firehose of Bluesky activities, Skymood Relay focuses specifically on emoji usage patterns, allowing clients to receive only the emoji-related data they're interested in. This targeted approach significantly reduces bandwidth requirements while still enabling real-time emoji tracking and analysis.

This can be easily adapted to similar scenarios where you need to filter and relay specific patterns from a larger data stream.

Features

  • 🔄 Real-time monitoring of Bluesky posts
  • 🎯 Emoji filtering capabilities
  • 🔌 WebSocket-based communication
  • 🚀 Built with Bun for high performance
  • 📊 Live client connection tracking

Prerequisites

  • Bun v1.1.34 or higher

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/skymood-bun.git
cd skymood-bun
  1. Install dependencies:
bun install

Running Locally

Start the server:

bun run index.ts

The WebSocket server will be available at ws://localhost:3000.

Docker Support

Build and run using Docker:

docker build -t skymood .
docker run -p 3000:3000 skymood

Deployment

This project includes configuration for deployment on Fly.io. Deploy using:

fly launch

WebSocket API

Client Messages

Send filter messages in the following format:

{
  "type": "filter",
  "emoji": "🚀"  // The emoji to filter for
}

To clear filters:

{
  "type": "filter",
  "emoji": "clear"
}

Server Messages

The server sends three types of messages:

  1. Emoji Updates:
{
  "type": "emojis",
  "emojis": ["🚀", "💫"]
}
  1. Filtered Posts:
{
  "type": "post",
  "text": "Post content",
  "url": "https://bsky.app/...",
  "timestamp": 1234567890,
  "emojis": ["🚀"]
}
  1. Client Count Updates:
{
  "type": "clientCount",
  "count": 5
}

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published