iVote

In recent years, adversaries with unlimited money and means are waging a non-stop global cyber war against every machine connected to the internet. Critical election infrastructure and related government systems are at risk. As a result, some major parties have become aware of how important securing their free and fair elections have become. At the same time, there is no dominant player in the secure election systems market. This presents your modest band of coders with a unique opportunity!

iVote has been contracted to build a secure electronic election system to their specifications. The system will allow an entity to host elections at scale without requiring voters to appear at a physical voting location. In order to ensure fairness, you’ve decided to implement a form of instant-runoff voting (IRV) to determine the election winner.

Summary of requirements

Your system will consist of a web portal where, only after logging in, users can view the results of past elections and vote in current elections. Voters will be able to login using their first and last name and the last four digits of their social security number.

All other users must login using email and password

There are five (5) types of users: root, voters, moderators, administrators, and reporters. Users can only be one type at a time.

  1. Voters are the most common type of user. They vote in elections and can view a complete listing of past election results.
  2. Moderators manage elections to determine which voters are allowed to vote in which elections.
  3. Administrators, along with having system-wide moderator privileges, can manage which users have moderator privileges as well as create new elections and manage existing ones. Administrators are also the only type that can create new users and restrict other users as well as change a user's type; however, administrators cannot modify the account details of other administrators or give other users the administrator type.
  4. The root user is a special administrator that can give other users the administrator type and view information that is normally private. There is only one root user in the system.
  5. Finally, reporters can view the history of past election results and nothing else.

Additional Details

Requirement 1

Login: a user must authenticate before they can access the system.

Requirement 2

The system will support 5 types for users: root, voter, moderator, administrator, and reporter.

  1. Voters -Can vote in elections and can view a complete listing of past election results.
  2. Moderators - Can manage elections to determine which voters are allowed to vote in which elections.
  3. Administrators
    • Can view a list of every single election in the system
    • System-wide moderator privileges
    • Can manage which users have moderator privileges
    • Can create new elections and delete existing elections only if they are upcoming
    • Manage existing elections
    • Can create new users
    • Can restrict existing users
    • Can change a user’s type
    • Cannot modify the account details of other administrators
    • Cannot give other users the Administrator type
  4. Reporters - Can view the history of past election results and nothing else
  5. Note the special root user. The root user is a special administrator that can give other users the Administrator type and view information that is normally private.
    The root user is always the first user in the system and there can only be one root user.

Users can only have a single type at a time. You are free to create other types.

Requirement 3

The system will support elections. An election has:

  1. A title
  2. A description of the topic being voted on
  3. A list of choices voters must rank from most favored (starting at 1) to least favored
  4. A list of voters that are able to vote in this election while it is open
  5. A list of moderators that have permission to add and remove users from the list of eligible voters
  6. A timestamp indicating when the election opens
  7. A timestamp indicating when the election closes Feel free to add any other information necessary.

All users can view and interact with individual elections. Users interact differently with elections depending on their type.

When viewing election results that are closed:

Requirement 4

Dashboard

For voters

For voters, the dashboard will also show:

For moderators

For moderators, the dashboard will also show:

For administrators

For administrators, along with the controls moderators have, the dashboard will allow the administrator to view and modify all users and elections in the system.

Requirement 5

History: each user can view a complete history of past elections that can be sorted by at least one useful metric.

Some examples of useful metrics include allowing users to sort elections in ascending or descending order alphabetically, by open date, or by close date.

Requirement 6

Registration / New Users/Voters

Requirement 7

Security

Requirement 8

User Accounts

Requirement 9

Closed Elections

Requirement 10

All results and lists of items displayed in the frontend UI will be paginated where appropriate.

Pagination is the strategy of showing a limited number of a large set of results and providing a navigation element where users can switch to different "pages" of that large set.

A Google search result (which has multiple pages) is a good example of pagination.

Requirement 11

Voting

For example, suppose an administrator created an election titled What should we eat after the competition? The administrator adds three choices to vote for: pizza, chicken, and tacos.

Further suppose there were 10 eligible voters. Voter 1 ranks the choices according to their tastes:

Scenario A: 1 voter's choices
RankChoice
1Pizza
2Tacos
3Chicken

Clearly, in Scenario A: voter 1’s favorite choice is Pizza, their second favorite is Tacos, and their least favorite is Chicken.

The other nine voters come up with their own ranks for the choices as well. Since many of them voted similarly to someone else, the 10 different voters come up with the following 3 rankings:

4 Voters voted like this
RankChoice
1Chicken
2Pizza
3Tacos
4 Voters voted like this
RankChoice
1Pizza
2Tacos
3Chicken
2 Voters voted like this
RankChoice
1Tacos
2Pizza
3Chicken

If we just counted who got the most rank-1 votes (like a normal election), Chicken and Pizza would be tied for first place and no one would win. However, we are using Instant-Runoff Voting!

So, since no one got above 50% of the votes (50% of 10 is 5, so a choice needs 6 votes to win), we eliminate the choice with the least rank-1 (first place) votes. Since Tacos only got 2 rank-1 votes, Tacos is eliminated. After step #4 (above), now the rankings look like this:

4 Voters voted like this
RankChoice
1Chicken
2Pizza
4 Voters voted like this
RankChoice
1Pizza
2Chicken
2 Voters voted like this
RankChoice
1Pizza
2Chicken
Chicken still has 4 votes, but now pizza has 6 votes. Since Pizza has more than 50% of the votes, the system indicates choice Pizza wins the election.

Requirement 12

Somewhere in the frontend UI of every view, the total number of elections in the system will always be visible.

Requirement 13

Requirement 14