Poll Service

  • Updated

Poll service 

A Wire poll service allows you to easily create polls and view the results. Each user can choose only one of the available answers.

Usage 

Poll service lets you set up and share a poll within a Wire conversation and receive real-time results.

  • Add Poll service to a conversation 
  • Add others in the conversation to vote. 
  • Set up a poll and response options. 
  • Track and share real-time results. 
  • Run polls for internal teams or external clients for research, feedback or coordination. 

To get a list of commands available with the Poll service, the /help command will present the list of the commands and a description of what each one does. The following is a list of the commands supported by the Poll service:

 

Command

Description

/help

Presents the list of the commands and a description of what each one does

/poll "Question" "Option 1" "Option 2"

Creates a poll with a question and predefined options

/stats

Retrieves a result report of the last poll in the conversation

 

Configuration

On-Prem Installation & Configuration of Services

Service Setup
  • We can have as many services as we need, based on the use-case.
  • Every service needs to be installed on-prem 
Service Configuration
  • Every service needs to be configured, We can start with a generic service “Poll” (Naming and icons, etc can be adjusted)
  • The setup process will be a JSON configuration. 

Enrolling with the service

  • Every recipient & sender of the poll needs to be subscribed to the service

 

 

Software and Hardware Requirements

 

This guide outlines minimum software and hardware requirements for deploying Poll service. Requirements may vary based on utilization and observing the performance of pilot projects is recommended prior to scale out.

 

Minimal requirements

CPU

4

RAM

2 GB

Disk

1 GB

 

For a more detailed breakdown of system requirements, please contact us directly to get hardware recommendations for your specific usage scenario.

 

Github source - here

Setup Poll service

Environment variables

  • DB_USER      # Username for the database 
  • DB_PASSWORD # Password for the database
  • DB_URL       # URL for the PostgreSQL database. Example: `jdbc:postgresql://localhost:5432/bot-database`
  • SERVICE_TOKEN # Token which is used for the auth of proxy, generated by Roman during bot onboarding.
  • PROXY_DOMAIN # Domain used for sending the messages from the bot to proxy eg. "https://proxy.services.zinfra.io/api" (note that in default configuration of the Roman, there’s path “/api” that needs to be included as well.

 

Dev stack

Bot is using webhooks coming from Roman, for that, the bot needs to have a public URL or IP address or needs to be reachable by Roman in some other way.

 

Usage

  • The bot needs PostgreSQL database up & running - we use one in docker-compose.yml, to start it up, you can use the command make db.
  • To run the application, execute make run or ./gradlew run.
  • To run the application inside the docker compose environment run make up.

For more details see Makefile

 

Deployment

In order to run the Poll Service you need the following:

  • Public IP address/host name, where Roman can reach the service.
  • Machine where you can run the service
  • PostgreSQL database - we tested the system on versions 12 and 13

 

Docker image

The poll bot has a public docker image.

quay.io/wire/poll-bot

Tag latest is the latest release. Releases have then images with corresponding tags, so you can always roll back. Tag staging is built from the latest commit in the staging branch. We recommend using the latest release.

 

Service configuration

Configuration is being loaded from the environment variables, see chapter environment variables.

 

Run the container

docker run --rm -p 8080:8080 quay.io/wire/poll-bot

 

Service registration

In order to use a service in Wire, you need to complete one more additional step - to register the service in the Roman and Wire. The tutorial on how to do that is here - please read Roman README.md as well.

 

Test the Service

1 - Open a conversation in Wire and add the Poll service
2 - Create a Poll using /poll command. You should see the poll message in the Wire Application 

Was this article helpful?

1 out of 1 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.