Team-TAU / tau

TAU- Twitch API Unifier, a containerized relay/proxy to unify the WebHook- and WebSocket-based real-time Twitch APIs under a single (local) WebSocket connection.
MIT License
149 stars 38 forks source link

rewrite it in rust #135

Open cgsdev0 opened 10 months ago

cgsdev0 commented 10 months ago

starting this thread to unify ideas we discussed in the discord

Goal

1:1 port of these parts of TAU to rust:

  1. Django served REST API and Websocket API (this is what you subscribe to/hit with your own client code)
  2. Worker process that sets up/tears down webhooks, connects and monitors the connection with IRC, and passes the data back through endpoints of 1. Also manages/handles/updates your Twitch tokens
  3. Dashboard webapp which is written in Vue, and is statically served. (we keep this part the same)

Finite's requests

There are several clients written for ingesting TAU, and I'd like to keep things compatible. So lets shoot for keeping the payloads returned the same (or similar enough that we're looking at relatively minor changes).

The Twitch APIs are constantly being updated. TAU ultimately acts as a passthrough for the Twitch endpoints, thus why I store the incoming twitch data as a json object/string in the database. I think we should continue to do this (perhaps use the same database structure that Django set up) as it makes things much much easier to keep up to date.

There is one huge gotcha that I spent a rediculous amount of time on, and we need to be aware of it as we do the re-write. For some reason, Twitch has decided in EventSub not to pass through emote information for Channel Point redemptions and Bit/Cheer redemptions. In order to get at the emotes (which are commonly used for both), I have to combine the IRC stream, with the eventsub stream. Doing this was... tricky.

There must be a way to both fire off test events, and a way to replay events.

Proposed Stack

swlkr commented 10 months ago

This is so profesh

Wackyator commented 10 months ago

This sounds awesome