Infinite Duration Twitch Polls with Eval Bar Overlay
Live.Poll.Preview.mov
Follow the steps below to run this project for your own Twitch Channel!
- Docker
- Docker Compose
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
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 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
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 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
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 from accepting votes
curl --request GET \
--url localhost:3005/stop \
--header 'x-access-token: YOUR_ACCESS_TOKEN'
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'
Interested in contributing? Check out the development guide!