A privacy respecting frontend for twitch.tv
Find a file
dragongoose 2c0a26c126
All checks were successful
ci/woodpecker/tag/<no value> Pipeline was successful
Fix search bar
2023-07-16 11:39:54 -04:00
.vscode Initial commit 2023-03-07 01:19:05 -05:00
public New favicon 2023-05-12 10:22:49 -04:00
src Fix search bar 2023-07-16 11:39:54 -04:00
.dockerignore Docker support 2023-03-25 17:49:04 -04:00
.env Add translation support 2023-06-13 12:08:43 -04:00
.eslintrc.cjs Move folder 2023-03-24 07:55:10 -04:00
.gitignore Fix docker env not updating 2023-05-08 20:34:30 -04:00
.gitmodules Git add submodules 2023-06-13 12:28:23 -04:00
.prettierrc.json Move folder 2023-03-24 07:55:10 -04:00
.woodpecker.yml Wrong image 2023-07-10 20:32:11 +00:00
backend-nginx.conf Update streamapi-nginx.conf and rename to backend-nginx.conf 2023-07-15 16:54:06 +00:00
docker-compose.yml harden docker 2023-07-14 21:27:13 +00:00
Dockerfile Create Dockerfile 2023-07-14 21:16:52 +00:00
env.d.ts Add translation support 2023-06-13 12:08:43 -04:00
frontend-nginx.conf Update stream-nginx.conf and rename to frontend-nginx.conf 2023-07-15 16:53:25 +00:00
index.html New favicon 2023-05-12 10:22:49 -04:00
LICENSE Swap to AGPL license 2023-07-14 20:46:30 +00:00
nginx.conf Create default nginx.conf again 2023-07-15 16:48:37 +00:00
package-lock.json Add translation support 2023-06-13 12:08:43 -04:00
package.json Add translation support 2023-06-13 12:08:43 -04:00
postcss.config.js Move folder 2023-03-24 07:55:10 -04:00
README.md new instance: stream.whateveritworks.org 2023-07-14 21:15:20 +00:00
substitute_environment_variables.sh Docker support env var changes 2023-06-13 12:43:19 -04:00
tailwind.config.js Fix frontend for seperate backend, and make preferences page 2023-03-24 18:48:45 -04:00
tsconfig.json Move folder 2023-03-24 07:55:10 -04:00
tsconfig.node.json Move folder 2023-03-24 07:55:10 -04:00
vite.config.ts Make page sizes smaller 2023-06-13 16:01:06 -04:00

SafeTwitch

SafeTwitch is a privacy respecting frontend for twitch.tv

The main advantages of SafeTwitch are:

  • Private: Every request is proxied through the server, and no logs are kept.
  • Lightweight: Compared to twitch, SafeTwitch is optimized for speed and usability.

You can visit it here, the official instance, at https://safetwitch.dragongoose.us
Or, you can find community instances here!

Do you want to help translate? You can do it over here on weblate! Translate

Okay, but why?

It is impossible to use Twitch without being bombarded with tons of ads, multiple trackers, and enourmous page sizes and loading times. This project aims to fix these issues, by removing all trackers, have much smaller page sizes, and very fast loading times.

Features

User features

  • No connection to twitch/amazon
  • Lightweight on server and client
  • No Ads or tracking
  • No outside connections, only connection is the instance
  • Uses Vue for a speedy experience
  • No logs
  • Much smaller pages compared to Twitch (<1.6mb with images compared to >8.2mb)
  • Follow streamers locally to have a more personalized feel
  • Infinite scrolling #3

Technical features

  • Public API
  • No official APIs are used
  • No rate limiting
  • Uses a custom Twitch webscraper

It's not all sunshine and rainbows though, and still has various cons, including

  • SafeTwitch was a learning project
  • dragongoose is silly (can't even drive yet 😔)
  • Uses Vue, which relies on Javascript

You aren't forced to use SafeTwitch, so use whatever suits you the most! Heres some other notable twitch projects

  • Xtra, a Twitch client focused on providing the best viewing and chatting experience on mobile devices
  • Twire, an ad free Twitch browser and stream player for Android.
  • Streamlink Twitch Gui, A multi platform Twitch.tv browser for Streamlink

Donations

Donations towards development are not accepted. I really thank you for feeling the need to donate, it does mean a lot to me!

Instead, please donate your money to one of these charities which mean a lot to me.

Getting Started

Would you like to host an instance? This section is for you.

Docker

Using docker is the prefered way to host SafeTwitch It can be easily setup in a few commands

From codeberg's registry

First, clone the repository and cd into it git clone codeberg.org/dragongoose/safetwitch cd safetwitch

Now, change the environment variables in the docker-compose.yml to fit your needs. An example is shown below

version: "3.9"
services:
  frontend:
    image: codeberg.org/dragongoose/safetwitch
    ports:
      - "8080:80"
    environment: 
      - SAFETWITCH_BACKEND_DOMAIN=localhost:7000
      - SAFETWITCH_INSTANCE_DOMAIN=localhost:80
      - SAFETWITCH_HTTPS=false
  backend:
    image: codeberg.org/dragongoose/safetwitch-backend
    ports:
      - "7000:7000"
    environment:
      - PORT=7000
      - URL=http://localhost:7000

Finally, run docker-compose docker-compose up

From source

First, clone the repository and cd into it git clone https://codeberg.org/dragongoose/safetwitch cd safetwitch

cd into the docker directory cd docker

Modify the environment variables in the docker-compose.yml file to fit your needs

Now, run docker-compose in the docker folder docker-compose up

Without docker

This method isn't prefered, but there's nothing wrong with doing it.

Setting up the frontend

First, let's clone the repository and cd into it git clone https://codeberg.org/dragongoose/safetwitch cd safetwitch

Now, we have to build the frontend. First, set the environment variables in the .env file to your needs. Here's an example: This step is important, once the frontend is built, the env variables become hard coded

VITE_BACKEND_DOMAIN=localhost:7000
VITE_INSTANCE_DOMAIN=localhost:5173
VITE_HTTPS=false

Perfect, now we can build the frontend by running this command npm run build

Once this finished, a new dist folder will appear. Put the contents of this folder into wherever your http server is. For the tutorial's sake, we'll use nginx.

cd dist mv ./* /var/www/html

To have nginx allow for the SPA aspect of vue to work, we need to set the config option try_files.

events {}
http {
    include mime.types;

    server {
        listen 80;
        access_log  off;
        error_log off;


            location / {
                root /app;
                index index.html;
                try_files $uri $uri/ /index.html;
            }
    }
}

With that all set up, you can turn nginx on and start using SafeTwitch! (unless you need to setup the backend...)

Setting up the backend

Setting up the backend is easier, first, let's clone it git clone https://codeberg.org/dragongoose/safetwitch-backend cd safetwitch-backend

Be sure to set the environment variables in the .env file. Here's an example:

URL=http://localhost:7000
PORT:7000

Now we have to install dependencies npm i --production

Finally, we can start the server node index

Translate

Translation status

You can translate here: https://translate.codeberg.org/projects/safetwitch/frontend/

Instances

If you host a SafeTwitch instance and would like it to be listed in the readme, please make an issue or a pull request to add it in.

Official instance:

URL Country Info
safetwitch.dragongoose.us 🇺🇸 Homelab

Community hosted instances:

URL Country Info
safetwitch.projectsegfau.lt 🇺🇸 🇮🇳 🇱🇺 #2
stream.whateveritworks.org :DE: Hosted on Hetzner/Dedicated Server with Encryption at rest