Git Product home page Git Product logo

owning-a-home's Introduction

⚠️ THIS REPO IS DEPRECATED (7/9/2018) ⚠️

The Owning a Home project has been integrated into cfgov-refresh as Buying a Home.

Owning a Home

Build Status Coverage Status Code Climate

"Owning a Home" is an interactive, online toolkit designed to help consumers as they shop for a mortgage. The suite of tools gives consumers the information and confidence they need to get the best deal. It takes the consumer from the very start of the home-buying process, with a guide to loan options, terminology, and costs, through to the closing table with a closing checklist.

This project is a work in progress

Nothing presented in the issues or in this repo is a final product unless it is marked as such or appears on www.consumerfinance.gov/owning-a-home. Some copy or formulas may be replaced with dummy text to ensure that we follow any and all privacy and security procedures at the CFPB. All the designs, layouts, and evolution of our decision making process are accurate.

We want your feedback, but will not be able to respond to everyone

We are working under an agile framework, and plan to use this repo to publish, receive feedback, and iterate on that feedback as often as possible. Our goal is to see user trends and reactions to our work. We want as much feedback as possible to help us make informed decisions so that we can make this tool better. Unfortunately, we will not be able to respond to every piece of feedback or comment we receive, but intend to respond with our progress through the evolution of the tool.

Dependencies

Virtualenv & Virtualenvwrapper Python modules

If you already have these modules installed, skip ahead to cfgov-refresh.

  1. Run:
pip install virtualenv virtualenvwrapper

Autoenv module

If you already have Autoenv installed, skip ahead to cfgov-refresh.

  1. Run:
pip install autoenv

Node, Grunt, Bower, Browserify

  1. Install node.js LTS or latest version will work.

  2. Install Grunt, Bower and Browserify:

npm install -g grunt-cli bower browserify
  1. Navigate to the cloned owning-a-home directory and install the project's node dependencies:
npm install
  1. Navigate to the config folder. In that folder, copy the example-config.json file and rename it config.json. This can be done from the command line with the following two commands:
cd config
cp example-config.json config.json
  1. Run grunt to build the site:
grunt

npm-shrinkwrap is used to lock down dependencies. If you add any dependencies to package.json, re-run npm shrinkwrap to generate a new npm-shrinkwrap.json file.

cfgov-refresh

Owning a Home can be installed and run by the cfgov-refresh app.

  1. Clone the cfgov-refresh GitHub project to wherever you keep your projects (not inside Owning a Home):
git clone https://github.com/cfpb/cfgov-refresh.git
  1. Run all the installation steps outlined in the cfgov-refresh repo.

  2. In your window for cfgov-refresh, run the sheerlike command to pull in the pages that are still run by Sheer.

python cfgov/manage.py sheer_index
  1. Run cfgov-refresh and navigate to the Owning a Home project in the browser.

Configuration

WordPress Indexing

To index your content from WordPress:

  1. In cfgov-refresh repo, copy the .env_SAMPLE file and name it .env. This can be done from the command line with the following command:
cp .evn_SAMPLE .env
  1. Add your WordPress URL to the following line of env in place of http://wordpress.url.
export WORDPRESS=http://wordpress.url
  1. Run the following command inside cfgov-refresh:
python cfgov/manage.py sheer_index

Rate Checker and Mortgage Insurance

The Rate Checker and Mortgage Insurance are JavaScript applications for checking mortgage interest rates and mortgage insurance premiums. Currently owning-a-home's Rate Checker and Loan Comparison are powered by private APIs that returns mortgage rate, county data, and mortgage insurance premiums. Without these APIs configured, the website will still load but the Rate Checker and Loan Comparison applications will NOT be available.

The following section is therefore only useful to users with access to the private APIs who are able to run the Rate Checker and Loan Comparison apps.

Private API Users

To configure the Rate Checker and Loan Comparison you will need to point to the required API URLs in config/config.json.

  1. In config/config.json, change lines to point to the API URLs, respectively:
    {
        "rateCheckerAPI": "YOUR RATE CHECKER API URL HERE",
        "countyAPI": "YOUR COUNTY API URL HERE",
    	"mortgageInsuranceAPI": "YOUR MORTGAGE INSURANCE API URL HERE",
    }

Workflow

The following commands need to be run as part of your daily workflow developing this application.

Fetch changes workflow

  1. Each time you fetch from upstream, install dependencies with npm and run grunt to build everything:
npm install
grunt

Elastic Search workflow

Elastic Search needs to be running to display wordpress content:

  1. Use the Owning a Home virtualenv:
workon OAH
  1. Stay in the base directory

  2. Start Elastic Search:

elasticsearch

Grunt workflow

Grunt watch will recompile Less and JS everytime you save changes to those project files.

  1. Open a new command prompt and run:
grunt watch

To view the site browse to: http://localhost:7000

How to test the software

Linting JavaScript

JavaScript errors and warnings can be detected and corrected by running grunt lint.

Browser test setup

Browser tests can be found in test/browser_testing/ directory. To run them you will need Chromedriver.

Once Chromedriver is downloaded, unzip the chromedriver file and copy it to a folder that is accessible to the development environment, such as /usr/bin/.

Before running tests, you will need to set up a Python virtual environment, install dependencies, and create an enviconment.cfg file.

cd test/browser_testing/
mkvirtualenv oah-tests
pip install -r requirements.txt

Rename test/browser_testing/features/example-environment.cfg to test/browser_testing/features/environment.cfg and edit the file to point the chromedriver_path to your local chromedriver file.

Running browser tests

workon oah-tests
behave -k

API tests

Before running tests, you will need to set up a Python virtual environment, install dependencies, and create an environment.cfg file.

cd test/api_testing/
mkvirtualenv oah-tests
pip install requests

Rename test/api_testing/features/example-environment.cfg to test/api_testing/features/environment.cfg and edit the file to point ratechecker_url and mortgageinsurance_url to the environment you wish to test.

workon oah-tests
behave -k

Run behave -k -t=~prod_only to omit production environment tests.

Load tests

Installing Jmeter

Run python jmeter-bootstrap/bin/JMeterInstaller.py in the test folder which will install Jmeter 2.11 and required plugins to run Jmeter locally

Running load tests locally from the command line:

apache-jmeter-2.11/bin/jmeter.sh -t owning-a-home/test/load_testing/RateChecker.jmx -Jserver_url oah.fake.demo.domain -Jthreads=8

-t owning-a-home/test/load_testing/RateChecker.jmx: this tells Jmeter where the test lives, relative to where Jmeter us running from -Jserver_url oah.fake.demo.domain: this is the URL to runs load tests against. Replace oah.fake.demo.domain with the URL you want -Jthreads=8 : this is the maximum number of concurrent users for the load test

OaH.jmx - this test is for the landing pages using all default settings (loan-options, rate-checker, etc)

Rate_Checker.jmx - this test uses the queries listed inside "RC.csv" to run the load test for Rate Checker API. Additional queries can just be added as rows in "RC.csv" and the test will pick them up.

Mortgage_Insurance.jmx - this test uses the queries listed inside "MI.csv" to run the load test for Mortgage Insurance API. Additional queries can just be added as rows in "MI.csv" and the test will pick them up.

If the number of threads is 6 and the there are 3 rows of queries the test will execute in this order:

user 1 - row 1
user 2 - row 2
user 3 - row 3
user 4 - row 1
user 5 - row 2
user 6 - row 3

Contributions

We welcome contributions, in both code and design form, with the understanding that you are contributing to a project that is in the public domain, and anything you contribute to this project will also be released into the public domain. See our CONTRIBUTING file for more details.

owning-a-home's People

Contributors

ahoef avatar akiany avatar amymok avatar anselmbradford avatar ascott1 avatar cfarm avatar chosak avatar contolini avatar cornellj1 avatar danny8000 avatar dezzie avatar dpford avatar fna avatar hillaryj avatar himedlooff avatar imuchnik avatar jimmynotjim avatar khandelwal avatar kimberlymunoz avatar marcesher avatar mistergone avatar mthibos avatar orlandosoto avatar rosskarchner avatar scotchester avatar sebworks avatar sonnakim avatar stephanieosan avatar virginiacc avatar virtix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

owning-a-home's Issues

Double range slider

The HTML5 range element only accepts one input so if we're going to use a double input slider we'll need a JS solution. jQuery UI has one. Some changes are needed to make it accessible, though.

Closing checklist webpage

We currently provide a Closing Checklist PDF for download.

We'd like to create a design and functional prototype that converts this PDF into a webpage, which would live at http://www.consumerfinance.gov/owning-a-home/closing-checklist/ or a similar URL inside the Owning a Home project.

Steps for getting this done might be:

  • Create a page template in Owning a Home and add the PDF content.
  • Determine which layout styles to use for this page: likely similar to the Loan Options page layout, or using Capital Framework.
  • Add checklist/form functionality - likely using React.
  • Add link + callout for users to download the PDF.

Add explanation of what requirements are used for

Readme includes list of required software packages to run the project. It would be helpful to have an explanation by each of what it is used for, such as:

- Sheer - For managing web page content within the project.
- Elasticsearch - For the full-text search feature.
- Node - For installing tools, such as grunt and bower.
- Grunt - For installing backend dependencies. 
- Bower - For installing frontend dependencies. 

NOTE: The above is just my best guess as to what these requirements are for—I haven't yet installed the project.

Incorrect countyAPI URL silently fails

If the rateCheckerAPI value is left out of config/config.json, there is a helpful message:
screen shot 2015-01-26 at 1 48 35 pm

However, if the countyAPI value is left out of config/config.json, the app works till a county is needed at which point the County dropdown is just empty. If the countyAPI URL is absent the app should show the same alert message as when the rateCheckerAPI value is absent.

Checked attribute in "Discount point and credits" radio buttons

can we give the selected radio button the attribute checked="checked"?
Right now element "discount-zero-a" always has checked="checked"

When I click a different radio button, example: "discount-three-a",, then the only element with attribute checked="checked" should be "discount-three-a"

This would make the browser tests easier to code

Preparation worksheet recommendations

Proposed changes

  • Revisit Clarify your goals link language (content):
    • “Why Buy? Why Now?”
    • “Buy vs. Rent.”
  • Make the first action step in Prepare to Shop the “Clarify your goals” link in addition to a sidebar link.
  • Reduce pain of filling out long form (UI/design):
    • Hide/shorten financial goals helper text.
    • Make the alternatives multiple choice instead of text fields.
    • Add helper text in expandables to the Alternatives page.
  • Make results more useful (Content/UI/design):
    • Include the results chart
    • Include a link to a printable PDF
    • Brainstorm ways to give users more useful results from their inputs, rather than reflecting back what they have already typed in.

Questions to answer

  • Is the worksheet easy to fill out?
  • Is the information helpful to the consumer?

Overlapping text

This only seem to happen if it reaches to 10 or more lenders.

screen shot 2015-05-13 at 1 00 18 pm

Response Header

For best practices, we need to add X-XSS-Protection: 1; mode=block and X-Content-Type-Options: nosniff on the response header. By the way, this is NOT a critical issue but it should be taken care off.

HTTP/1.1 200 OK
Expires: Wed, 22 Jul 2015 14:36:46 GMT
Content-Type: application/json
Server: Apache
Allow: OPTIONS, GET
Cache-Control: max-age=1800
Last-Modified: Wed, 22 Jul 2015 14:06:46 GMT
Content-Length: 107
Date: Wed, 22 Jul 2015 14:06:46 GMT
Connection: keep-alive

{"timestamp": "2015-07-21T04:00:00Z", "data": {"4.375": 5, "4.230": 2, "4.500": 2, "4.250": 5, "4.125": 6}}

Closing Costs link in the Rate Checker page lands on a different page

On the build server "owning-a-home/check-rates/"
The "closing costs" link seems to be pointing to:
http://www.consumerfinance.gov/askcfpb/139/what-are-closing-costs.html

But instead when I click on it, the browser lands in:
http://www.consumerfinance.gov/askcfpb/1845/what-fees-or-charges-are-paid-closing-and-who-pays-them.html

So the browser test fails the assertion as it correctly detects that we did not land in the URL we expected

A couple things we can do:

  • Change the expected URL browser test
  • Change the href attribute in the closing costs link

closingcosts

In Readme, consider naming virtualenv `OAH`

Based on a discussion with @ascott1, consider renaming the virtualenv in the project Readme to OAH instead of sheer to better align the public instructions of the project with the internal instructions:

So:

$ mkvirtualenv sheer

Would become:

$ mkvirtualenv OAH

loan-types console errror

The loan-types page is currently throwing an error from loan-calc on page load.

Uncaught Error: Please specify a loan amount as a positive number 

Medium Security issues

Hey Team,
Checkmarx identified few medium security findings on the Javascript side. If anyone in the team has a minute, I would like sit with him/her to reviewing the findings for possible false positive.

Loan Comparison Downpayment - Deleted numbers stayed

I was updating Downpayment (you can try this on either % or the actual amount). If you enter whatever, then hold the "delete" key until everything is deleted. And then you pause (lift your finger away from the "delete" key), you will see whatever you deleted comes back.

So if you enter a number right away, it will concatenate the newly entered number to the deleted item.

Is this expected behavior we want?

@stephanieosan @cfarm @virginiacc

Bad Gateway error reported by browser tests on build

This error was captured in Jenkins build#379 - rate_checker_defaults.Verify that Rate Checker fields default to the correct values.Default credit score range

Scenario: Default credit score range
Given I navigate to the "Rate Checker" page ... failed in 13.245s
owning-a-home/check-rates/

badgateway

This is odd, since all subsequent tests in the same feature passed without error.
I was not able to find the same error in other test runs

Plan:

  • Consult with SE/DevOps to see what would cause this type of error
  • Continue to monitor the browser tests to see if this happens again

Loan Type Sheet (Initial Sketches and Wireframes)

The loan types sheet is a resource within the larger Owning a Home product that helps consumers understand the different types of loans available when buying a house.

Mortgage loan types are made up of three parts:

  • Loan Term (how long you have to pay back your loan)
  • Interest Rate Structure (whether the rate is fixed or able to change over time)
  • Loan Program (whether a loan is part of a government program or not)

We want users to understand each individual part of the loan, as well as how they work together, in order to help them make the best financial decision for their situation.

1st Step: Team sketching session

(1) Decision Tree: User is given 2 options. After they choose one, they are able to dive deeper into the content and make other decisions based on their initial choice.

01

02

(2) Ways of visualizing the interaction between the different parts of the loan:

03

04

05

(3) Different potential interactive solutions:

Tabs where the user chooses to only look at one section at a time.

06

or

07

"Slot Machine" or tabel comparison where the user can build a loan type, and learn more about that type.

08

or

09

Loan type calculator where the user can put in their own information or change the values to see what happens to the monthly payments and interest rates.

10

or

11

(5) Straight forward content layouts that allow the user to see all the information they want at the same time.

12

13

or

14

Outcomes of sketching session:

  • Provide a view where users can see the whole
  • Lay out the variables at the top, lightweight intro (term + interest rate + program = loan type)
  • Why I would choose this take away (allows for quick comparisons, helps consumers know what's right for their circumstances)
  • Interactive element to play with variables
  • Maintaining a take-away-able variation

Second Step: Wireframes

Based on our initial sketches, we put together some initial wireframes that allow us to start laying out the page, and think about the type of content we need to fit inside it.

(1) Formula written out with a modal interaction.

15

16

(2) Left-hand overview that acts as nav for the right-hand content.

17

18

(3) Overview up top with expandable content below.

19

20

Outcomes of wireframes:

  • Option (3) is the strongest because it allows the user to see all the content at the same time, if they want, but also narrow in on one subject at a time.
  • Modals will cause more problems than it is worth when we start looking at responsive design.
  • We will start to add content to the page, and iterate the layout/design based on the content.

Budgeting Worksheet webpage

We'll soon provide a Budgeting Worksheet PDF for users to download and complete in their preparation for shopping for a mortgage.

We'd like to create a design and functional prototype that converts this PDF into a responsive webpage, which would live at http://www.consumerfinance.gov/owning-a-home/budget-worksheet/ or a similar URL inside the Owning a Home project.

Steps for getting this done might be:

  • Create a page template in Owning a Home and add the PDF content.
  • Determine which layout styles to use for this page: likely similar to the Loan Options page layout, or using Capital Framework.
  • Add checklist/form functionality - likely using React.
  • Add link + callout for users to download the PDF to other parts of the existing website.

'Improved' shimming and jQuery-ui

In newer versions of Browserify and grunt-browserify, shimming is done in the package.json file using browserify-shim and a transform:

"browser": {
    "jquery": "./src/vendor/jquery/jquery.js",
    "highcharts": "./src/vendor/highcharts-release/highcharts.js"
  },
  "browserify-shim": {
    "jquery": "global:$",
    "highcharts": "highcharts"
  },
  "browserify": {
    "transform": [ "browserify-shim" ]
  }

Unfortunately this causes the pre-shimmed npm version of jquery-ui that we're using for the slider to choke.

Error: module "jquery" not found from "/Users/scotta/Projects/owning-a-home/node_modules/jquery-ui/slider.js"

If I try shimming jquery-ui, it is unable to find its local dependencies... and if I add those as dependecies like so:

"jquery-ui/slider": { "depends": ["jquery", "jquery-ui/core", "./node_modules/jquery-ui/mouse.js", "./node_modules/jquery-ui/widget.js"] }

This error is printed to the console:

"Cannot read property 'ui' of undefined"

My guess is that I am doing something wrong...

Loan type dropdown on rate checker is too narrow

In some cases the text in the loan checker is too long for the width of the loan type dropdown:
screen shot 2015-01-26 at 1 38 52 pm

Consider making the loan type dropdown double the width of the other dropdowns. There appears to be space:
screen shot 2015-01-26 at 1 45 10 pm

Or truncate the text in the dropdown with an ellipsis when dropdown is not selected.

House isocon iteration

At the CFPB, we have three different levels of iconography and illustration that we use throughout our web and print experiences. Our middle tier, which we call isocons (they are icons drawn in isometric), are larger-scale icons used to illustrate values, products, topics, and processes.

As we kick off this project, we need an isocon to represent the Owning a Home product. The graphic design team has struggled with how to best represent a home in isometric for quite a while, so it was important that we push through lots of iterations and finally get it right.

Here is our current isocon library, so you can get a feel for the visual language we needed to design within:
14df75f2-94de-11e3-8413-e6e1d6b7ac1e

We started by grabbing the basic shapes from the bank isocon:
f2d75490-8847-11e3-8b11-223fa5c8006a

Then we broke down the elements of the house (windows, door, roofing, lot) and went to work iterating:
c0158882-94dc-11e3-88dd-012c238b73e2

Ultimately, we settled on a simple house that felt consistent with the rest of our library in its level of detailing:
043dc678-94dd-11e3-9b84-b41cb4ee47f6

Explore rates bug

JS error when explore rates credit score slider is dragged in Android Chrome or iPhone Safari breaks functionality

Current behavior

  • When credit slider is dragged to 600 mobile browsers, JS error occurs and credit score warning message does not appear

Expected behavior

  • Credit score warning should appear when slider is dragged to lowest value

Steps to replicate behavior

  1. Visit `http://www.consumerfinance.gov/owning-a-home/explore-rates in iPhone Safari and drag slider to lowest value

Screenshots

Current:

screen shot 2016-08-24 at 3 25 13 pm

Expected:

screen shot 2016-08-24 at 3 27 05 pm

Dealing with dollar amounts

We have form fields where users provide dollar amounts (house price, down payment). We'll need to figure out how to handle these inputs.

Do we strip commas on keyup or just form submission? Does the dollar sign live inside the editable field or outside? If inside, can the user delete the dollar sign? Some form of currency validation will also need to occur. Are decimals allowed?

screen shot 2014-04-09 at 3 58 57 pm

Include config.json in grunt watch

Currently if the API URL is changed in config/config.json, the grunt task needs to be re-run. Consider including config/config.json in the grunt watch task unless there is some kind of performance hit in doing so.

How do we handle dependencies?

Right now we're using a mix of bower and npm. Capital Framework uses the custom grunt vendor task with Bower, I think we should use Bower for Capital Framework/CSS dependencies and npm for JS dependencies... thoughts?

Do we need a placeholder shim?

We rely on input placeholders pretty heavily in the UI, but they aren't supported in IE8. In most cases this isn't a big deal, but in a scenario where a user edits a house price they may be surprised to see that the loan value doesn't match since there is no visual cue that there is a default down payment value.

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.