Giter Club home page Giter Club logo

riavora / represent Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 2.78 MB

Represent connects you to your Legislators and Representatives, giving you the ability to ask your pressing questions, follow their votes on the Senate, House of Representatives, and local bills, and connect directly with them to share your views and hold them accountable.

Objective-C 94.49% Ruby 0.34% Objective-C++ 5.17%
objective-c ios ios-app politics social-justice representative

represent's Introduction

Original App Design Project - README Template

Represent

Table of Contents

  1. Overview
  2. Product Spec
  3. Wireframes
  4. Schema
  5. Demos

Overview

Description

Represent connects you to your Legislators and Representatives, giving you the ability to ask your pressing questions, follow their votes on the Senate, House of Representatives, and local bills, and connect directly with them to share your views and hold them accountable. Government and Politics isn't for a specific group of people; it affects every citizen and individual living under that government. Represent is here to make social justice accessible, easy-to-be-a-part-of, and unbiased. The public deserves to be involved and informed.

App Evaluation

  • Category: Education/Social Networking/News
  • Mobile: Through a mobile interface, Represent is easily accessible for voting on questions throughout the day, sending emails or chats to your Representatives, and setting up a profile. Real-time data and push notifications keep you on-top of the latest news and the bills that directly affect you.
  • Story: Individuals will use Represent to finally feel like they have an active say in their government and their Representatives' action. Politics & Government has become too complicated for the regular voter to follow. Users will want to use Represent for a simple understanding the way bills and measures passed affects them, and a way to follow their Representatives' actions, bringing their voice back into the playing field.
  • Market: Once completed, Represent appeals to anyone who isn't heavily invested in government or politics. It gives regular voters (with jobs in virtually every industry) the information and resources to keep up with their Representatives and government. Although only users over 18 have the ability to choose their Representatives, Represent also appeals to the youth who are focused and interested in the impact that government has.
  • Habit: Users will be motivated to come back to the app due to give components: (1) Voting on 3 new questions on a daily basis (2) Asking their own question (3) Seeing the top-voted question and their Representatives' response (4) Following their Representatives' posts and (5) Commenting and following their Representatives' positions on bills/measures. Represent's questions will be refreshed every [TBD].
  • Scope: The basic functionality of this app, which will hopefully be completed by the end of this project, is (1) a view to vote and ask questions to a specific representative (2) a profile with log-in and log-out capabilities (each profile will also be linked to relevant Representatives through location) (3) a view to see your relevant Representatives vote on a bill and (4) a way to contact your Representatives through email or chat. Additional optional ideas include hashtags for every question alluding the topic (such as #politics, #george-floyd), an short explanation of each bill, the ability to view all Representatives' votes on the bills, the ability to comment on bills, the ability to share a specific Representatives' response, etc.

Product Spec

1. User Stories (Required and Optional)

Required Must-have Stories

  • Connect to Parse
  • Connect to ProPublica API
  • The user can log in to an account with their username and password
  • The user can create an account with their first name, email, username, password, and zipcode
  • The user's profile is linked to relevant Representatives (they can choose to share their location or choose Representatives)
  • The TableView is setup to show basic Questions
  • Each Question has a user, a vote button, a timestamp, a vote count, and the question
  • The user can vote on a question
  • The user can swipe down on the screen to refresh
  • The question the user votes for, if the vote count changes to be higher than the above question, moves up on the screen without the user refreshing
  • The user can toggle between Representatives and their questions
  • Prevent the user from voting more than three times a day with a pop-up message
  • The user can submit a question
  • The question the user posts shows up on the screen without the user refreshing
  • The TableView is setup to show basic Bills
  • Each bill has the name of the bill, the scope (Senate, House of Reps, etc.), and whether it passed
  • Each bill displays the votes of relevant/top representatives
  • The user can swipe down on the screen to refresh
  • The user can view a basic version of their profile on the tab (the segue is set up)
  • The user can view a detailed version of their profile with the parameters description, party, etc.
  • The user can edit their description
  • The user can click on profile pictures in the Questions Screen to view a user's profile (without the edit option)
  • The user's profiles and other's profiles are refreshed when necessary
  • At the top of their profile, the user can choose to directly contact their Representatives
  • The user can choose which representative to contact
  • The user can see a detailed view of inputting their last name, email, etc.
  • The user can send a message

Optional Nice-to-have Stories

  • Top-notch UI with animations (work in progress)
  • The user can edit their party
  • The user is limited by characters on their question
  • The user can view a detailed version of the Bills in a DetailsViewController
  • The bills and underlying database has up-to-date information
  • The bill can be clicked on to view a detailed view
  • The user can follow Representatives that are not their relevant Representatives, and it adds them to their toggle menu in View - Questions and allows them to contact them
  • The user's profile displays interests and can edit interests
  • The detail view of the bill has arguments for each side
  • The user can view their posted questions through a toggle menu on their profile
  • The user cannot vote on their own question
  • The user cannot post hate speech on their question
  • The user can comment on Bills
  • The user can comment on Questions
  • The user can react to comments and respond to comments
  • The user's latest votes are displayed publicly on their profile
  • The user's comments are displayed publicly on their profile
  • The user can change their profile to private or public
  • The user can have followers who can see their votes (if they are on private)
  • The user can tag the question they ask with hashtags of their choice. The most popular of these hashtags show up beneath the question
  • The user can click on the # of votes label to see who publicly voted and the number of private votes
  • When the user uses "@" they can tag a representative
  • When the user uses "+" they can tag a bill
  • The user can choose to directly send a chat to a representative instead of email

2. Screen Archetypes

  • Networking
    • Connect to Parse
    • Connect to ProPublica API
  • Login Screen
    • The user can log in to an account with their username and password
  • Registration Screen
    • The user can create an account with their first name, email, username, password, and zipcode
    • The user's profile is linked to relevant Representatives (they can choose to share their location or choose Representatives)
  • Questions Screen
    • The TableView is setup to show basic Questions
    • Each Question has a user, a vote button, a timestamp, a vote count, and the question
    • The user can vote on a question
    • The user can swipe down on the screen to refresh
    • The question the user votes for, if the vote count changes to be higher than the above question, moves up on the screen without the user refreshing
    • The user can toggle between Representatives and their questions
    • Prevent the user from voting more than three times a day with a pop-up message
  • Post Question Screen
    • The user can submit a question
    • The question the user posts shows up on the screen without the user refreshing
  • Bills Screen
    • The TableView is setup to show basic Bills
    • Each bill has the name of the bill, the scope (Senate, House of Reps, etc.), and whether it passed
    • Each bill displays the votes of relevant/top representatives
    • The user can swipe down on the screen to refresh
  • Profile Screen
    • The user can view a basic version of their profile on the tab (the segue is set up)
    • The user can view a detailed version of their profile with the parameters description, party, etc.
    • The user can edit their description
    • The user can click on profile pictures in the Questions Screen to view a user's profile (without the edit option)
    • The user can swipe down on the screen to refresh their or others' profile
  • Contact Screen
    • At the top of their profile, the user can choose to directly contact their Representatives
    • The user can choose which representative to contact
    • The user can see a detailed view of inputting their last name, email, etc.
    • The user can send the message

3. Navigation

Tab Navigation (Tab to Screen)

  • Home Screen [Tabs to Questions, Bills, and Profile]
  • Post & Cancel a Question
  • Contact a Representative

Flow Navigation (Screen to Screen)

  • Log-In Screen
    • Questions
  • Registration Screen
    • Questions
  • Profile
    • Questions
    • Bills
  • Questions
    • Profile
    • Bills
  • Post Questions
    • Questions
  • Bills
    • Profile
    • Questions
  • Contact
    • Profile

Wireframes

Interactive Prototype (Buttons that are clickable will highlight after a few seconds!)

Schema

Models

Question

Property Type Description
objectID String [default] Unique ID for the user's question
createdAt DateTime [default] when the question was posted
updatedAt DateTime [default] when the question was last updated
author Pointer to User author of the question
text String question that user has posted
voteCount Number number of votes the question has gotten
representative Pointer to User representative the question is directed to

User

Property Type Description
objectID String [default] Unique ID for the user
createdAt DateTime [default] when the user was created.
updatedAt DateTime [default] when the user was last updated
firstName String first name of user
username String username of user
password String password of user
email String email of user
description String user's personal description on their profile
party String user's political party
followedRepresentatives Array array of representatives that the user is following
zipcode Number zipcode of user
profilePhoto File profile photo of user
isRepresentative Boolean whether the user is a representative
position String if the user is a representative, then role, i.e. "Senator"

Bill

Property Type Description
objectID String [default] Unique ID for the bill
createdAt DateTime [default] when the bill was posted
updatedAt DateTime [default] when the bill was last updated
title String official title of bill
description String short description of bill's intentions
passed String if the bill has "Passed", "Failed", or is "Still in Contention"
position String the type of people voting on this bill, i.e. "Senator"
votes Dictionary<User, String> a user (representative) linked to a string of "For", "Against", or "Abstain"
votesFor Number number of votes "For" the bill
votesAgainst Number number of votes "Against" the bill

Networking

Login Screen

Action Object Description
GET User checks if user exists with given credentials

Signup Screen

Action Object Description
POST User creates a new user object with the signup information

Questions Screen

Action Object Description
GET Question all questions addressed to a specific representative

Compose Question Screen

Action Object Description
POST Question question for a representative is posted

Bills Screen

Action Object Description
GET Bill all bills, perhaps under specific search criteria

Profile Screen

Action Object Description
GET User the user associated with the current account
POST User (profilePhoto) changes the profile photo for the user
POST User (description) changes the description for the user
POST User (party) changes the party of the user
POST User (followedRepresentatives) changes the representatives the user follows
POST User (zipcode) changes the zipcode of the user
POST User (username) changes the username of the user
POST User (firstName) changes the first name of the user

External API Calls

API for Bills and Votes: ProPublica Congress API

External Resources

Demos

Questions Screen

  • Toggle between representatives and vote on a question to move it up

Video Walkthrough

  • Posting a Question and reaching a vote limit

Video Walkthrough

Bills Screen

  • Refreshing bills, scrolling through votes, viewing a details view with past votes

Video Walkthrough

  • Searching and filtering bills

Video Walkthrough

Profile/Contact Screen

  • Editing description, party, and profile photo, and seeing other people's profiles

Video Walkthrough

  • Contacting a representative and switching between representatives

Video Walkthrough

  • Changing your state and the questions, bills, and contact screen updating

Video Walkthrough

represent's People

Contributors

riavora avatar

Stargazers

 avatar

Watchers

 avatar  avatar

represent's Issues

User can choose representative

Description: The user can choose a specific representative to contact

  • set up the representative dropdown menu
  • configure the representative variable in the contact screen
  • use the representative's email address

User has voting limit

Description: Prevent the user from voting more than three times a day with a pop-up message

  • set up a tally for the amount of times a user has voted in that day
  • set up a time to refresh the user votes (every morning at 12 am?)
  • if it is past the next time the user can vote, then the vote count refreshed
  • if it is not past the next time the user can vote, then an alert message is sent to the user
  • if possible, set the vote buttons to hidden if the user's vote count has been exceeded
  • if possible, show a vote countdown on screen and configure autolayout

Set up Bills

Description: Each Bill has a title label, the scope (Senate, House of Reps, etc.), and an area for votes

  • add the fields of title, scope, different vote fields, status, etc. to the TableViewCell
  • connect the fields to the BillCell class
  • configure BillCell to update all the fields with a given Bill
  • set up autolayout so the bills display properly
  • set up the bills' votes array

User can click any profile

Description: The user can click on any profile to view the detailed view

  • connect the segue of a user profile picture to their detailed view
  • set up segue identifiers and use them in the segue method
  • send the necessary information (i.e. the User object) to the ProfileViewController
  • if the user profile is not the user that is logged in, then disable the edit button for the description

Set up TableView

Description: Questions fill the screen with a TableView

  • create the QuestionViewController and link it to a view controller
  • embed Navigation Controller and connect
  • create necessary text fields and title and table view and link to view controller
  • set up TableViewDelegate and TableViewDataSource with viewDidLoad calls and create necessary methods
  • create a QuestionCell class and connect it to a TableViewCell in the view controller
  • add a question label to the TableViewCell and connect to QuestionCell class
  • call the questions from Parse in the QuestionViewController and set them to a questions array
  • Use the Question model to set a Question to the QuestionCell
  • configure autolayout in Storyboard just for TableView and set TableViewCell to ensure questions display

User can Login

Description: The user can log in to an account with their email/phone number and password

  • set up view controllers with navigation and tab bar controllers according to spec
  • create the LoginViewController and link it to a view controller
  • create necessary text fields and title and link to view controller
  • check user's account by sending information to Parse
  • send an alert if the user tries to register with empty text fields
  • send an alert based off the error from Parse
  • configure autolayout in Storyboard
  • setup persistence for user in SceneDelegate

User is linked to Representatives

Description: The user's profile is linked to relevant Representatives (they can also choose Representatives)

  • obtain zipcode of current user from Parse
  • get representatives from ProPublica API
  • if possible, use zipcode to configure relevant representatives using the representative information. if not possible, set default representatives to representatives from your zipcode
  • ensure Parse is configured to accept a modification to the representative array, and send the change to the User object

User can create account

Description: The user can create an account with their email, username, first name, and password

  • create the RegistrationViewController and link it to a view controller
  • create necessary text fields and title and link to view controller
  • create user's account and send information to Parse
  • send an alert if the user tries to register with empty text fields
  • configure autolayout in Storyboard

Questions with more votes move up

Description: The question the user votes for, if the vote count changes to be higher than the above question, moves up on the screen without the user refreshing

  • figure out how to sort the array of questions based on voteCount (or sort the array of incoming questions from Parse based on voteCount)
  • display the questions in the correct order
  • if possible, highlight the top three questions
  • if possible, have the question move up the screen (animate) without the user refreshing

User has detailed contact fields

Description: Add additional fields for the user to write into to contact their representatives

  • add the user's email and last name as a field and connect it to the view controller
  • display the first name of the user on the contact screen
  • configure autolayout

User can refresh Questions

Description: The user can swipe down on the screen to refresh

  • set up a RefreshControl and configure it to the Parse call
  • when a question is posted, it appears at the bottom of the question count

User can view details on profile

Description: The user can click on the profile tab to view a detailed version of their profile

  • add the description, party, and interest fields
  • connect the fields to the view controller
  • use the User object to obtain the correct values and update the fields
  • setup autolayout, and learn how to setup for views larger than the screen

Connect to Parse

Description: Can GET and POST to Parse Database for all necessary calls

  • create a Heroku app
  • setup Parse dashboard
  • create User model that subclasses from PF
  • create Question model that subclasses from PF
  • create Bill model that subclasses from PF
  • run a test call to Parse

Set up TableView

Description: Bills fill the screen with a TableView

  • create the BillViewController and link it to a view controller
  • embed Navigation Controller and connect
  • create necessary text fields and title and table view and link to view controller
  • set up TableViewDelegate and TableViewDataSource with viewDidLoad calls and create necessary methods
  • create a BillCell class and connect it to a TableViewCell in the view controller
  • add a bill title label to the TableViewCell and connect to BillCell class
  • call the bills from Parse in the QuestionViewController and set them to a bills array
  • Use the Bill model to send a Bill to the BillCell
  • configure autolayout in Storyboard just for TableView and set TableViewCell to ensure bills display

Some Feedback

  1. Following methods seem not in the category of UIViewController methods. Can we define a better pragma mark?

    - (void)fetchBills: (BOOL)getNewBills {


    - (void)getBillsParse: (BOOL)getNewBills {

  2. The naming of bool getNewBills is not clear to me what it means. Can we name it better?

    - (void)fetchBills: (BOOL)getNewBills {

  3. It looks like you are fetching/mutating information through Parse in a "View" class. This violates Model-View-Controller pattern. What can we do to set a clean boundary between View and Model?

    [self.question.author.profilePhoto getDataInBackgroundWithBlock:^(NSData * _Nullable data, NSError * _Nullable error) {

    [self.question saveInBackgroundWithBlock:^(BOOL succeeded, NSError * _Nullable error) {

  4. The code pointers in (3) may cause another issue that there are multiple network roundtrips on one load. This is not performant. Can we reduce the network roundtrip and fetch all information at once?

  5. Please add documentation to all public properties and methods in the header file. e.g.

    @property (nonatomic, strong) NSString *billID;
    @property (nonatomic, strong) NSString *number;
    @property (nonatomic, strong) NSString *type;
    @property (nonatomic, strong) User *sponsor;
    @property (nonatomic, strong) NSString *title;
    @property (nonatomic, strong) NSString *shortSummary;
    @property (nonatomic, strong) NSString *longSummary;
    @property (nonatomic, strong) NSDate *date;
    @property (nonatomic, strong) NSString *question;
    @property (nonatomic, strong) NSString *result;
    @property (nonatomic) NSInteger votesFor;
    @property (nonatomic) NSInteger votesAgainst;
    @property (nonatomic) NSInteger votesAbstain;
    @property (nonatomic, assign) BOOL *headBill;
    @property (nonatomic, strong) NSString *committee;
    @property (nonatomic, strong) NSString *forDescription;
    @property (nonatomic, strong) NSString *againstDescription;
    + (Bill *) updateBills: (NSDictionary *)dictionary;
    + (NSDate *)formatDate:(NSString *)dateString :(NSString *)timeString;

Set up votes on Bills

Description: Each Bill displays votes of representatives and total vote count

  • add fields for the names of each of the representatives
  • set up representative votes based on the top representatives or the representatives the user is following
  • display the representative votes through the BillCell class
  • add colors to the UI
  • set up autolayout so the bills and votes display properly

External Library for Visual Polish

Description: add an external library for visual polish

  • add the cocoapod for moving the keyboard for textfields
  • find an external library for visual polish that you want to use
  • download cocoapod and integrate
  • test functionality and enjoy the pretty view!
  • if time/necessary, improve UI and add animations!

User can view their profile

Description: The user can click on the profile tab to view their profile

  • set up the ProfileViewController and attach it to a view controller
  • set up and embed Navigation Controllers
  • add and setup a UIScrollView
  • add the username field and the profile photo field, and connect them to the view controller
  • call Parse to obtain the User class
  • create a new User object
  • initialize the profile's basic view
  • setup autolayout if the UIScrollView is not showing up correctly

Connect to ProPublica API

Description: connect to ProPublica API using API Key and run network calls

  • create an APIManager class
  • add API Key and configure call
  • test a call for bills

You's Feedback

  1. Move Utils.h and Utils.mm to a folder instead of at the top level.
  2. Please add detailed comment to explain the code in following method:
    dispatch_semaphore_t semaphoreGroup = dispatch_semaphore_create(0);

    dispatch_semaphore_t semaphoreGroup = dispatch_semaphore_create(0);
  3. Avoid multiple empty lines in code:



  4. Following lines are repeated when setting up the view for the 1st-person and 3rd-person profiles. They can be consolidated to a single method.
    self.descriptionField.text = self.user.profileDescription;
    self.descriptionField.textColor = UIColor.blackColor;
    self.descriptionField.font = [UIFont systemFontOfSize:17 weight:UIFontWeightRegular];
  5. Thanks for adding method documentation. I'd suggest to add doc for the input params and return value. e.g.
    https://google.github.io/styleguide/objcguide.html#example
    /*Is used externally to create a Question with the given arguments.*/
  6. Nice to see consts at the top of the file.
    static const NSArray *passed = [NSArray arrayWithObjects: @"Passed", @"Agreed to", @"Amendment Agreed to", @"Nomination Confirmed", @"Bill Passed", @"Cloture Motion Agreed to", @"Motion Agreed to", @"Motion to Proceed Agreed to", @"Motion to Table Agreed to", @"Cloture on the Motion to Proceed Agreed to", nil];

User can refresh profiles

Description: The user can refresh any profile

  • set up a RefreshControl and configure it to the Parse call
  • when a new description is posted, it appears with refreshing
  • configure scrolling for as much information as possible in the description cell

User can submit Question

Description: The user can submit a question

  • create a PostQuestionViewController and connect it to a view controller
  • add a Navigation Controller
  • add text fields and connect them to the view controller
  • add buttons to "Cancel" and "Post"
  • add action to the cancel button to clear the field and go back to the Questions Screen
  • if possible, add the representative drop down menue
  • create a method in Question class that posts a Question
  • call the method from the Question class when the "Post" button is pushed
  • ensure the call to Parse executes correctly
  • if the question field is blank, set up an alert

Question appears without refreshing

Description: The question the user posts appears on the screen without refreshing

  • ensure the question the user posts is added to the correct questions array
  • if refreshed, the question appears at the bottom of all questions
  • the question appears at the bottom of the screen without refreshing
  • if possible, the question is highlighted when posted and the user is taken there

Add Search to Bills

Description: enable search and filtering on bills

  • use the search query from the API
  • create Bill objects for the search results but no duplicates
  • display the results with the correct votes as well
  • add a dropdown filter menu
  • configure different filters to show different results (search by house vs. senate)
  • make sure the configurations are also applied when the user searches

User can refresh Bills

Description: The user can swipe down on the screen to refresh the bills

  • set up a RefreshControl and configure it to the Parse call
  • when a new bill is posted, it appears with refreshing
  • configure unlimited scrolling for as many bills as exist

User can edit their description

Description: The user can click on their description field to edit it

  • add a button next to the description field and connect it to the view controller
  • configure the button action to let the user edit the field
  • update the user's description with the new description on screen
  • update the user's description with the new description on Parse
  • if possible, configure the button so it only displays when the user hovers over the description label
  • setup autolayout with the button

User has option to contact

Description: At the top of their profile, the user can choose to directly contact their Representatives

  • create a ContactViewController and attach it to a view controller
  • add necessary navigation controllers
  • send the User information through the segue
  • set up a small prompt and text field and connect that to the view controller
  • update the variable of the small prompt with the message that the user types

User can send message

Description: The user can send the message using their email

  • ensure the user's email is accessible
  • add a send button and add the action to the contact screen
  • either use an SDK or something else to configure the email to be sent through the user's email, or open up the native email client with the pre-formatted message
  • configure autolayout

User can toggle between Representatives

Description: The user can toggle between Representatives and their questions

  • set up the top representative section to be a dropdown menu
  • display the representatives from the followedRepresentatives array in the dropdown menu
  • configure autolayout for the dropdown menu
  • ensure the questions are properly filtered by representative
  • change the representative based on the representative that the user chooses
  • add a MBProgressHUD to display while Parse is re-filtering

Add Facebook SDK

Description: a required part of the app is to add an SDK

  • look at other SDK's for different functionalities if you don't want Facebook's
  • add an SDK

Set up Questions

Description: Each Question has a vote button, the question, and is linked to a representative

  • add the fields of username, timestamp, votes, question (and a button to vote) to the TableViewCell
  • connect the fields to the QuestionCell class
  • configure QuestionCell to update all the fields with a given Question
  • set up autolayout so the questions display properly
  • set the representative label at the top of the page to be the user's first representative
  • filter the questions to be only from that specific representative

User can Vote on a Question

Description: The user can vote on a question

  • connect the vote button to the QuestionCell and add its action
  • update the Question voteCount and update labels
  • send data back to Parse

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.