Skip to content

Live poll that hooks into a Twitch channel to support infinite-duration polls

Notifications You must be signed in to change notification settings

braddotcoffee/live-polls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infinite Duration Twitch Polls with Eval Bar Overlay

Live.Poll.Preview.mov

🚀 Quickstart

Follow the steps below to run this project for your own Twitch Channel!

Prerequisites

  • Docker
  • Docker Compose

Backend Setup

Copy the example config into a config-prod.yaml for use with the production Docker Compose configuration

cd backend
cp config-example.yaml config-prod.yaml

Edit the example config to point to your Twitch channel. This can be found under Voting > ChannelName.

Copy the example secrets file into secrets-prod.yaml for use with the production Docker Compose configuration

cp secrets-example.yaml secrets-prod.yaml

Edit the file to include a LONG and RANDOM token for authenticating to your server endpoints. This can be found under Server > Token.

Spin up the Docker Compose. The service will now be listening on localhost:3005.

docker compose -f compose-prod.yaml up -d

Frontend Setup

Create a .env file that points at your backend for the NEXT_PUBLIC_API_URL

cd ..
cd frontend
echo 'NEXT_PUBLIC_API_URL="localhost:3005"' > .env

Build the frontend for production and start it up. The app will be served on localhost:3000.

npm run build
npm start

🗳️ Voting Configuration

Voting takes place by sending a message in Twitch Chat that corresponds to a configured PositiveKeyword or NegativeKeyword. These can be configured in your config.yaml:

Voting:
  PositiveKeyword:
  NegativeKeyword:

Messages that match these keywords exactly (case-insensitive) will be counted as votes.

"voteKeyword" <- Counted as Vote
"Message that contains voteKeyword" <- Not counted as Vote

SingleVotePerUser Mode

By default, the application only allows one vote per user, but allows them to change it at any time. If you wish to disallow changing of votes, consider using the built-in Twitch polls functionality (these have a maximum duration of 10 minutes).

SingleVotePerUser Mode can be enabled in the config.yaml

Voting:
  SingleVotePerUser: True

MultipleVotePerUser Mode

MultipleVotePerUser mode allows users to vote as many times as they want throughout the duration of the poll. This encourages users to spam chat for constant engagement if you want your chat to fly by!

MultipleVotePerUser Mode can be enabled in the config.yaml

Voting:
  SingleVotePerUser: False

🎡 Controlling Polls via Server Endpoints

Reset Poll

Reset a poll to 0 votes and an entirely neutral bar

curl --request GET \
  --url localhost:3005/reset \
  --header 'x-access-token: YOUR_ACCESS_TOKEN'

Stop Poll

Stop poll from accepting votes

curl --request GET \
  --url localhost:3005/stop \
  --header 'x-access-token: YOUR_ACCESS_TOKEN'

Start Poll

Start poll so that it may accept votes. NOTE: This does not reset the poll.

curl --request GET \
  --url localhost:3005/start \
  --header 'x-access-token: YOUR_ACCESS_TOKEN'

👩‍💻 Contributing / Development Guide

Interested in contributing? Check out the development guide!

About

Live poll that hooks into a Twitch channel to support infinite-duration polls

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published