Skip to content
Itoro Esiere edited this page Nov 3, 2016 · 8 revisions

What is PartyPeople?

Though we might have a silly name, we have a mighty goal. There are enough barriers to voting as it is, so to make the process a little bit easier, PartyPeople provides information about current elections and candidates, as well as information about the political parties and political information about the states in the US. The United States has one of the lowest voter turnouts of all the developed countries, and while PartyPeople can't help with problems like voter registration, it can help eligible voters discover elections at a local, state, and federal level, as well as give them details of these elections and information about the candidates running in each election. The idea is that an educated voter will be more involved in politics at all levels of government, increasing voter turnout and improving the representation of the people.

While this site is intended for eligible voters to increase their knowledge about current elections in their area, at both a local, state, and federal level, anyone is welcome to browse for political information. You can go from one page to another, seeing how elections, candidates, parties, and states relate, and increasing your knowledge about the current political arena.

Pillars

PartyPeople stands tall on four major pillars. These pillars are states, parties, candidates (or politicians), and elections. States are the 50 states of the United States such as Texas, California, and Alaska. Parties are the political parties such as Democratic, Republican, and Libertarian. Ted Cruz, Gary Johnson, and Nancy Pelosi are members of the candidates’ pillar. The United States government is a representative democracy which means voting. Thus, the elections’ pillar is our last but not least remaining pillar. Examples of elections would be general presidential elections and congressional district elections.

Here is a diagram illustrating our four pillars, which referred to as resources, and their attributes which will be elaborated on in the next sections:

States

A state’s attributes are its name, capital, population, governor, major party affiliation, and politicians. All the attributes are strings except for population, and politicians. Population is an integer value while politicians are an array of strings because there can be multiple politicians in a particular state.

The governor field would link to a candidate, party affiliation would link to the party in question, and politicians would also have each listed politician linking to a candidate page.

Parties

Each party will have information such as a name, a description, a list of politicians affiliated with the party, a list of the states that party has control of, a headquarters’ address, the chairperson of the party, and a list of its divisions.

Parties would have an associated image on it's page as well as each affiliated politician linking to that candidates page. Similarly each controlled state would link to that state's page.

Candidates

A candidate’s attributes are their name, date of birth, current position in office, the party they affiliate with, their poll numbers, and a list of their contact information.

For a candidate, their position in office can potentially link to a related state for their position and their party affiliation will link to the page with information on that party.

Elections

An election’s attributes are its name, the date of the election, type of election, location, and list of the candidates nominated for the election.

For an election, its location could link to a relevant state, and the nominated candidates would link to those respective candidates pages.

Pillar Relationships

Here is a diagram illustrating the relationship between the four pillars I’ve explained:

A state can have many elections held within it while the same election can occur across multiple states. For example, the 2016 presidential race is going on across all the states of the United States. The general election and Texas’ 23rd Congressional District election are both in the state of Texas. This is a “many to many” relationship. Elections also have a “many to many” relationship with parties and candidates. An election can be influenced by multiple parties while a party can participate in multiple elections. Candidates can be nominated in a single election while elections can have multiple candidates. A state can have multiple candidates affiliated with it. However, a candidate cannot be elected in another state while they are already elected in one state. This is a “one to many” relationship. Another “one to many” relationship can be observed between parties and politicians. A party can have multiple politicians, but a politician cannot represent one party.

UML Class Design

Here is another diagram that illustrates our design:

The design in mind is a REST domain, resource, service model. Domain is our application that maps our routes to the correct html. Resources are instances of our pillars. Each resource has setter and getter methods which will essentially call methods in our services. Services as shown above focus on our database. This is broken down into four basic functionalities (insert, select, update, and delete). Insert is capable of adding to our tables. Select grabs a table or an item while also having methods to handle our third party API calls. Update is for updating already created items in our table and using multiple flavors of joining tables. Delete drops a table. This design is subject to change as progress on the project continues.

Database Model Design

We implemented our database with SQLAlchemy and PostgreSQL. We have seven classes, four of them are for our pillars and three of them represent the relationship amongst them.
Our four pillars are candidates, elections, parties, and states. The candidates table has an id, a name, a job, a date of birth, contact information, poll number, election id, party id, and state id for columns. We also have relationship columns in the table that are references to the foreign keys. The primary key for the candidates table is id while the foreign keys for the table are election id, party id, and state id. The elections table has the following columns: id, name, date, and level (i.e. state, local, federal, senate or house). The parties table has columns for each parties id, name, description, headquarters address, and party leader. The states table has columns for each states id, name, capital, population, and governor. The three relationships in our databases are the electoral college, parties involved, and elections to state. The electoral college relationship is the relationship between a state and party. We use it to determine which party controls which state. It has a primary key, which is the id, and foreign keys, which are party id, state id. Electoral college table also has two relationship columns that refer to party and states tables by their respective ids. The parties involved table represents the relation between party and election where many different parties can be involved in a single election. The columns in this table are id (primary key), party id (foreign key), election id (foreign key), relationship reference to parties table and relationship reference to elections table. Last but not least, is the election to state relation table. This table has an id, election id, state id, and relationship reference to elections table and relationship reference to states table.