...

/

Design of Yelp

Design of Yelp

Learn to transform requirements into the design of the Yelp.

We identified the requirements and calculated estimations of our system in the previous lesson. In this lesson, we will discuss the API design, then we will go through the database schema before diving into the details of the system’s components.

API design

Let’s discuss the API design for Yelp.

Search

We will need to implement the search function. The API call for searching based on categories like cafes will be:

search(string category, string user_location, int radius)
  • category: The type of search made by the user, e.g., restaurant, cinema, etc.
  • user_location: It contains the user’s location who is searching using Yelp.
  • radius: The specified radius where the user is trying to find the required category.

It returns a JSON object containing the list of possible items in the specified category within the specified radius. Each entry will have the place name, address, category, rating, and thumbnail.

The API call for searching based on the name of a place like Burger Hut will be:

search(string name_of_place, string user_location, int radius)
  • name_of_place: It will contain the name of the place the user wants to search for.

It returns a JSON object containing the information of the specified place.

Add a place

The API call for adding a place will be:

add_place(string name_of_place, string description_of_place, int category, decimal latitude, decimal longitude, list photo}
  • name_of_place: It will contain the name of the place, for example, Burger Hut.
  • description_of_place: It will contain the description of the place. For example, Burger Hut sells the yummiest burgers.
  • category: It specifies the category of the place, for example, a cafe.
  • latitude: It has the latitude of the place.
  • longitude: It has the longitude
...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy