I don't know about you, but every Halloween I'm scouring through the forums trying to find the best places to go trick or treating. It's really hard to find this info, cause it's kind of top secret. After all, if everyone goes to the best neighborhoods, the amount of candy you get greatly decreases.

What it does

We made an app that shows you the candy quality of the neighborhoods near you using a top secret method (we just pulled median household income from the census data). Out of 5 (yours and 4 nearest), the 2 best is in green, yellow for meh and red for bad. Your current location is in blue. All of this is displayed in an interactive map. There is also an option to help improve our database by manually reporting the candy in your neighborhood, which is recorded and sent to cockroachDB. If you encounter an error, feel free to click report, which will automatically generate a prefilled email where you just need to explain to us the problem.

How we built it

Lots and lots of frustration, and a metric ton of APIs (cause mom's spaghetti that's why) Everything that was used: CockroachDB, Heroku, Node.js, Google Cloud Firebase, Google Cloud Maps API, Google Geocoder API, Census American Community Survey (ACS) API,, Django and MySQL

API endpoint: We used the ACS API to get USA government census data to figure out the level of wealth around the neighborhood, which help us generate an Excel file and accessed by RESTful API.

Stack: Node.js, Google Cloud Platform (GCP), JavaScript, Heroku The Excel data file has been sorted into a CSV file, it is uploaded to GCP. Script has been run on the cloud to load the data and insert the value into the database. Another Node.js script has been written to get data from the Front-end and query the database so it can provide the data about the area of user's input. This API has been deployed separately from the rest of the Back-end the mobile app to serve the data.

Front end: Using, we were able to get our Geolocation (location in lat and long). Then, we passes that location through the Geocoder API to get human readable address as well as the zip code. That zip code was then queried with the database so we can find the median income of that zip code, as well as 2 zip codes above and below it. Those 5 medians are then sorted, and the highest and second highest assigned green markers, third yellow marker and the rest red markers. We also implemented a error reporting button, which auto-generates a prefilled email with our support email as well as the topic line so you can tell us how we can improve the app, as well as a candy reporting button so you can tell us the quality of the candy of the zipcode you are in, as not all rich families are generous (: This user input data is then passed onto CockroachDB (cause mom spaghetti and we wanted the track lol), where we will further process to incorporate into our master database in Firebase

Challenges we ran into

Wayy to many. Because we are trying for as many tracks as possible, and as complicated as possible for mom spaghetti, everything could have been solved with 1 database and 1 api. The maps api includes geocoding as well as geolocation. A MySQL database would have probably been better than putting it into Firebase, then putting it into Heroku so that it generates a json which meant we have to parse the json. We definitly didnt need to use 2 databses. We also definitely did not need to manually do a comparison for the 5 median incomes and instead do an array sort. Many intentional stupid decisions were made. A lot of the APIs and things used we havent ever used before (CockroachDB, MySQL, ACS API, Firebase, and or have only used once or twice (Google maps api, google geocoder api)

Accomplishments that we're proud of

Making this hot mess of an app, and complicating it in ways that we couldn't imagine was even possible.

What we learned

Don't complicate things, don't make intentionally stupid decisions.

What's next for

Using machine learning to incorporate the data of the 2 databases. See if we can notice a trend of a certain median income level being flagged red green or yellow.

Share this project: