DEV Community

ozmasg
ozmasg

Posted on • Updated on

Food Project: What do we need?

Brief

We'll go through the expected features, lay out some initial requirements, and then figure out what data we need to even begin thinking about implementing our requirements.

What is a requirement?

A requirement is a target feature of the end product. These depend on where the requirements come from, but some examples are:

  • Technical requirements (ie. to abide by internal standards)
  • Functional requirements (usually for the end user)

What will be our requirements?

To keep things simple, we'll define our requirements based on what we know, which is the functionality we want to achieve:

  1. View a restaurant's average rating derived from recent reviews over a user-specified time period
  2. Observe trends in restaurant popularity based on the number of reviews it has received within user-specified time intervals
  3. Observe trends in restaurant quality based on the average rating it has received within user-specified time intervals

What data do we need to achieve these requirements?

Let's start from what data we need to be able to achieve these requirements. Once we know what data we need, we can think about where to get it from, how to store it, how to retrieve it, and how we deliver it to our users.

Thankfully, it seems the data we need is just the ratings received for each restaurant per minimum interval.

If we assume the minimum interval is per-week, that data may look something like this (assumed for one restaurant):

timestamp 01-July-2022 08-July-2022 15-July-2022 ...
1-star ratings 4 0 3
2-star ratings 16 12 11
...
5-star ratings 2 5 1

And to achieve those requirements:

  1. Calculate average of data with rating history over last X months
  2. Calculate # of reviews per interval with all rating history
  3. Calculate average rating per interval with all rating history

It should be noted that we only need rating history, and have no need for anything else that's contained from the Google reviews.

What does the picture look like right now?

It seems we'll need:

  1. A data source for Google reviews data
  2. A database to store Google reviews data
  3. A service to pull data from the data source, parse it, and store it in the database
  4. Frontend which will display the data, which is retrieved from...
  5. Backend which hosts an API, providing calculated & formatted data which is read from

Top comments (0)