Inspiration

During the last few weeks we have all seen what the pandemic did to our collective psyche in terms of home essentials flying off the shelves (including all the tp hoarding). As I was hearing about how quickly these items were flying off the shelves, and seeing my own parents calling different stores to see if they had this or that, I thought it would be cool to have a crowd-sourced tool which would constantly accept users' input on whether specific items were available at a given time in a store they had just visited.

What it does

The site (which could easily be an app) allows users to input availability of different items in various stores as per their observations when they visit that store. This input would be timestamped but I haven't been able to complete this portion of the code. Other users can query the site for a specific item and see which stores still had stock in that item, at a specific time of the day, per the last timestamp. Clicking the stores which do have the item takes the user to a google maps page where driving directions etc can be quickly obtained.

How I built it

We built the interface in HTML and the core logic in JavaScript . I used arrays and search functions to populate the availability matrix as well as look for specific elements within that array.

Challenges I ran into

We spent a lot of time on, and was frustrated, due to global variables not passing properly into functions. Turning the visibility of different elements based on data in the matrix was a bit challenging.

Accomplishments that I'm proud of

We felt really good about how the the store names are visible or not to the user based on linking to the data in the matrix.

What We learned

We learned a lot about how JavaScript interfaces with HTML, and various elements of js itself.

What's next for Product Tracker During Corona Virus

This is only a proof of concept with a limited number of stores and limited products. To take this to the next level I would add a lot more stores, and a lot more products. Also, I would probably modify the code for users to be able to submit specific stores not in the list already, and fix the time-stamping issue. Using an aggregate of the timestamp and availability values, there could be some analytics on the website too (for e.g. based on timestamps between available and not available over last few days, predict how long an item might last in the store).
Of course this would be most useful as an app, so the code and interface would have to be optimized for mobile use.

Share this project:

Updates