“Wear masks.” “Engage in social distancing.” “Work from home.” “Flatten the curve.”
We hear these statements every day.
While we understand common practices to mitigate the spread of COVID-19, we still lack proper insight as to how to safely engage in essential tasks. For example, everyone needs groceries, but in the current climate, we cannot quickly and easily pinpoint the safest place and time to shop.
We created Grocery Guide to help our friends, family, and communities make an informed decision about when and where to grocery shop, in turn promoting healthy habits within our broader communities.
What it does
Within seconds, we provide our users with the specific info necessary to optimize their safety when grocery shopping. All a user needs to do is input their preferred day, time, and travel method, and Grocery Guide does the heavy lifting to find the closest, safest grocery store to refill their fridge. Utilizing the most up-to-date COVID-19 data, the Google Places API, and the Google Distance Matrix API, we're able to quickly and accurately recommend the safest times to grocery shop in the safest neighborhoods. Need to change your preferences? Just open your settings, and your results will refresh to fit your needs.
How we built it
Frontend: React Native, Expo
Backend: Node, Express, Google Places API, Google Distance Matrix API, Apify
Our backend recommendation algorithm takes in:
- The user's travel method (driving, walking, bicycling)
- How long the user is willing to travel (5 min, 15 min, 30 min, 45 min, 60 min)
- How many days the user has before he/she runs out of groceries
- What time of the day the user wants to shop (morning, afternoon evening)
- The user's current location
- Filters out the neighborhoods that would take too long for the user to travel to given how long the user is willing to travel and the user's travel method, taking into account real time and predicted traffic data (Google Distance Matrix API, Google Places API)
- Scrapes up-to-date COVID-19 data (the number of cases in each city in Los Angeles) from the Los Angeles Department of Public Health (Cheerio.js)
- Ranks the grocery stores based on their safety, which is determined by the number of COVID-19 cases in the neighborhood grocery stores are located in
- Sorts the recommendations based on a ~Bayesian estimate~
- Determines the optimal times the user should go to the top 5 Bayesian-ranked grocery stores based on real time and predicted busy times (Google Places API, Apify)
To save time (and Google API credits), neighborhood grocery store data is saved into a json file and updated periodically. User preferences entered into the app are stored locally on the user's phone rather than a cloud database.
Challenges we ran into
Data processing and Google Cloud costs — data costs add up quickly. In the beginning, we were getting every notable grocery store in every neighborhood in Los Angeles, then calculating — using real time and predicted traffic data — the duration to travel to each one of those grocery stores. Eventually, we got creative with how we processed and tested data, saving data from API requests that wouldn't require as many real-time updates.
Striking a balance between shiny technologies and practical impact — we love attending hackathons to find opportunities to try accessible, cutting-edge technologies like blockchain driven backends, machine learning prediction engines, and NLP algorithms (our past 3 hackathon projects!). However, we were inspired by Hack for Hope to build the most practical product that'd help the most people — not what we thought would be the most fun or coolest to build. Throughout our development process, we've learned a great deal about tuning into the needs of the people who need the most help, cutting out unnecessary features or technologies, and thinking deeply about perfecting the user experience of our application to improve accessibility.
Giving Jerry's cat attention — she's spoiled and hates when Jerry neglects her during hackathons. Unfortunately, this hackathon is several times longer than all the others :(
Accomplishments that we're proud of
Building something that can immediately be used by Los Angeles residents! Usually, we find ourselves building prototypes at hackathons that are far from production quality. This time, we've spent a lot more time accounting for different error states, thinking through the user flow and experiences, and writing clean (and maintainable) code while still pushing updates quickly.
What's next for Grocery Guide
We look forward to a great future for Grocery Guide, both through implementing new product features and engaging in exciting partnerships. Some future ideas we have are as follows:
- Scaling — Adding support for other major cities is easy. We would just need to find a reputable source that tracks the number of COVID-19 cases in each neighborhood of a major city and write a web scraper to gather the information. Everything else we built is designed to work everywhere nationally, so scaling is simple! We're planning on supporting New York next.
- Personal Grocery Inventory Management — Get real-time insight into your current grocery inventory, and get prompted when you'll need to replenish, before you need to replenish.
- AR-Based Social Platform for Reporting Sickness — Scan the world around you, using AR to identify unsafe public health practices. Learn about and report health data around you in a centralized application dedicated to creating a healthier community.
- Manage In-Store Foot Traffic — Peak shopping hours often result in overcrowding, not only causing a public health issue, but increased wait times for customers and difficulty managing inventory for restocks. At scale, we hope to better manage grocery store foot traffic, suggesting shopping times for as many people as possible, moving even numbers of people across a city's selection of stores.