/*Real Estate Bot*/

Given a zip-code and a listings-count the program will on a high level:

  1. Calculate a rating of how well each property within the zip-code will cashflow

    • This is calculated by data on a respective ZillowAPI listing

  2. Plot each listing with a rating graphic on Google Maps

  • Cashflow positive

  • Top 20% of cashflow

  • Middle 60% of cashflow

  • Bottom 20% of cashflow

/*Walkthrough*/

Here is the iterative process I worked through to get this version of the product:

Authenticating APIs function properly

  • Testing the API connection for each of the following: Listings, Rent Estimates, Agent IDs, Tax history. I also checked the structure of the responses the API gave, and took note.

Database storage:

  • Taking all the data from the API and creating a system to store and retrieve this data as JSON files locally. This helps to get API calls down and save time and money. 

First Draft MVP Backend:

  • After getting basic API calls and storage, I got the code to hookup and function to achieve the original goal of calculating cash flow for properties within a given zip code and ranking them best to worst.

Google Maps API frontend beginnings:

  • Next, I set up the frontend of the app and got familiar with how Google Maps API works including how to initialize Google Maps Map, and how to set the size.

Flask Server Setup:

  • I converted my backend into a flask server. I initialized the flask server and tested that messages were being transmitted from the backend to the frontend properly.

Added Google Maps Backend Support:

  • I realized that in order to plot the listings addresses on Google Maps, I’d need to convert the addresses to Geocode coordinates. In the backend, I added another API hookup to google maps and created a method to convert a street address to a Geocode. I decided to Geocode in the backend as I wanted the frontend to be single purpose: displaying data.

Google Maps API Marker Plotting:

  • I next sent over the Geocode coordinates and street address from the backend to the frontend and confirmed successful plotting for markers at the proper locations using the Google Maps API.

Fleshed out Frontend 

  • Added javascript buttons and dropdowns to specify the user’s query and to start off the program in the backend. Used J-Query for a more intuitive interface especially with dropdowns.

Optimizations

  • Had an issue where a requested zip code didn’t have enough listings to meet the requested listing count.

  • Put in a hard stop of consecutive failures to find the requested listings amount. The program would simply return as much as was found. 

Zip Code API

  • Solved this insufficient listings issue in a separate way by using Zip Code API and finding neighboring zip codes to the requested zip code and getting listings from those regions. This increased robustness and reliability of the app.

Abstraction

  • Broke apart large methods and scripts into smaller methods and smaller scripts. Followed single purpose for each script and method.