storjak / Twitch-Chat-Score-Chart

This loads on a Twitch.tv streamer's page during a live stream and will collect and compile a live "comedy" score according to input from users in chat. It will visually display it in the form of a graph.
0 stars 0 forks source link

Balancing twitch vs personally hosted resources #10

Open storjak opened 3 years ago

storjak commented 3 years ago

Because of the way Twitch hosts extension files, I'm going to need to rebalance some things. Initially I thought the server aspect for that extension was also hosted by twitch.

It is not.

I now need to host the server from an independent provider, which isn't a big deal, but does influence how much of what I should store where, and how.

I need to redesign some of the front end files, moving to a more script based approach, instead of just serving individual pages from the server and keeping each view light. I can host multiple front end files from twitch, but I have no idea how to access them currently. It's possible I can just change my window location from ./file_one to ./file_two or something similar, but it depends how twitch is going to end up storing the front end files.

In essence I need to either rewrite some of the front end scripts and have them be able to redirect to each other, or consolidate everything into one HTML file and build a pseudo-React type page. I'm probably going to do the latter to my user script, and write the entire page into the script instead of it just being a wrapper, as it is now.

The end goal is going to be my server will never serve any pages. Twitch will serve all the front end files for me, so I'm not going to. The userscript will also have all the same features built in, and never have to request a page. The server will only handle Socket.IO connections. This should cut down on data drastically, but even so with an estimate of 10,000 constant users, it will still cost around 600GB per month.

storjak commented 2 years ago

Huge format update should have solved most of this. I still don't know entirely how I'll be able to access the files hosted by twitch, but as of right now the front and back ends are completely separate. After uploading the back end to AWS and the front end to Twitch I should be able to start compatibility testing. So close to being live!