Giter Club home page Giter Club logo

blatherskite's Introduction

blatherskite

blath·er·skite ⬩ /ˈblaT͟Hərˌskīt/

  • a person who talks at great length without making much sense.
  • foolish talk; nonsense.

About

blatherskite is a drop-in chat backend for your messaging app.

Dependencies

You'll need to install CassandraDB for this: you can do that by running:

brew install cassandra
brew install cassandra-cpp-driver

Warning This is a little wonky on M1 Macs: you'll need to follow the advice of this page when you face the inevitable JNA link error. Download for more recent JNA version is here. I personally ran sudo mv jna-5.8.0.jar /opt/homebrew/Cellar/cassandra/4.0.6/libexec/jna-5.6.0.jar (I think...) once I downloaded the new version, and that fixed it.

You also need to install the Rust language:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Usage

Start by launching the database in the background with

cassandra -f

Then, launch chatterbox - the service for sending/getting messages - and scuttlebutt - the service for everything else.

cargo run -p chatterbox & 
cargo run -p scuttlebutt &

Features

Beyond basic text messaging, blatherskite has support for:

  • Discord-esque servers
  • Threads
  • Direct messages
  • Basic permissioning (owner/admin/none)

Terminology

Here's a quick guide to to the terms used by the service (that you might see in the scuttlebutt documentation):

  • Users can create or be invited to groups which contain channels.
  • Groups have:
    • members, the users who are part of the group
    • an owner, who made the group and is permitted to do specific actions (like deleting it)
    • admin, users who have elevated permissions for a group (like adding/removing channels)
  • DMs are a special kind of group that are made between users directly and limit certain functionality. DMs only have one channel and have no admin.
  • Channels also have members (which can be a subset of the group!). Channels by default are public, which means when a user is invited to a group they will be added to the channel. You can set them to private with another API call.

Scuttlebutt

Scuttlebutt is an HTTP service that handles the creation, deletion, and updating of groups/channels/users as well as misc other actions.

The various methods and objects are documented at localhost:3000, and the basic usage flow is something like:

  • POST /api/user to make a user, which will return a User object (see Schemas on the docs)
  • GET /api/login to login with said user. This will return a JWT that you'll use to authenticate future requests. This token will expire in a day!
  • Whatever requests you'd like at that point! Authenticate by including a ScuttleKey header with the token you got.

Chatterbox

Chatterbox is a websocket service used for sending and receiving messages. To use:

  • Connect to the websocket at ws://localhost:3001/
  • Send authentication in the form of {"hash": "YOUR_PASSWORD_HASH", "id": "YOUR_ID"}
  • Then use the websocket as normal!
    • Send message requests in the form of {"content": "whee", "channel": "CHANNEL_ID"}
    • Recieve messages!

blatherskite's People

Contributors

quantumish avatar papayapaya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.