Skip to content

Commit

Permalink
Update README.md for improved clarity and add config file loading ins…
Browse files Browse the repository at this point in the history
…tructions
  • Loading branch information
tripledoublev committed Nov 26, 2024
1 parent febaba8 commit 6220baf
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,41 @@ This is a svelte app that uses Earthstar to quickly create and share a voting in

## Customizing parameters

example url format using all parameters:
Example URL format using all parameters:
`{url}/?1=maybe&2=yes&3=no&r=members&q=do you understand the process?`

### Question
The question is entered with the `q` URL param (question).
The `q` can be the question itself or any unique identifier if you prefer the question to remain secret.

## Other params include response choices and restricted voting for a list of predefined Identities.

### Responses
Response choices can be defined by using single-digit integers. [0-9]
This option is to be used if you want to give choices to voters beyond 'yes' or 'no'.

### Restricted voting
For advanced voting, it is possible to restrict voters to a list of predefined keypairs.
A `json` file containing the identity of the allowed voters need to be added to the `public` folder.
A `json` file containing the identity of the allowed voters needs to be added to the `public` folder.
Once this file is available, it can be used with the `r` param, followed by the name of the file (without its json extension).

### Unrestricted voting
For basic voting, when the `r` param is not used, Earthstar ID is stored in browser settings and prevents users from casting multiple votes from the same browser.

When votes are not restricted to specific keypairs, users can still open private windows, other browsers or any other strategy for casting multiple votes.
When votes are not restricted to specific keypairs, users can still open private windows, other browsers, or any other strategy for casting multiple votes.
This is why this voting interface should not be used in unrestricted mode for important votes. The unrestricted option is meant to offer a quick and fun interface to gather feedback on specific questions.

## How does it work?
In all cases, the vote is cast with a throwaway (anonymized) keypair to make sure all votes remain private.
Original keypairs are stored to make sure only one vote is cast per keypair.
In summary, this means that someone could look at the logs and see who voted but not necessarily what they voted for.


## Loading vote data from a config file
You can load vote data from a config file by using the `v` URL param. The config file should be placed in the `public/configs` folder. The config file should be a JSON file with the following structure:

```json
{
"id": "Here is the vote's question",
"year": "Optional year field for votes in the case of our timeline",
"1": "First response.",
"2": "Second choice response.",
"3": "Third response.",
"4": "And so on...",
}
```

## Running it locally
You can run this voting interface locally.
Expand Down

0 comments on commit 6220baf

Please sign in to comment.