Lesson Weekend

Now that you learned a little about constants, we are are ready to get started! This week we will begin working on our final project before group week. As mentioned in the previous lesson, we will leverage our new Spark skills to build an awesome API that returns restaurant data.

Write What you Know!

And we all know Yelp!

Yelp is one of the most popular web 2.0 websites active today. Many of us rely on Yelp to help us make all kinds of decisions: Like which bars, coffee shops, jewelers, barbers, parks, mechanics, synagogues, vets and childcare facilities to support.

But the mainstay of Yelp is still what it's most famous for: Restaurants! Restaurant information, reviews and recommendations. We are going to build a Yelp clone called Jadle (Java, Gradle, ladle, soup, food, you get it…). This will allow us to see how a big API is built. Time to start keeping a mental note of all of your favourite restaurants, as we'll need to populate this data ourselves!

User Stories

Before we're ready to dive into coding, let's consider what we want our API to do. We'll orient ourselves on a pared-down version of Yelp for guidance. Let's write out some user stories to get us started:
A. As a user, I want to see all Restaurants in a specific zip code
B. As a user, I want to see one individual Restaurant
C. As a user, I want to see specific information such as the Restaurant's name, address, phone number, website, and email
D. As a user, I want to see which kind of Foodtypes a single Restaurant is associated with
E. As a user, I want to see all Restaurants of a specific Foodtype (say, Pho, or Brunch) so I can browse through them
F. As a user, I want to be able to leave a Review of a Restaurant
G. As a user, I want to see the average rating for a Restaurant
H. As a user, I want to see all Reviews for a Restaurant
I. As an admin, I want to be able to add a Restaurant to the database
J. As an admin, I want to delete Restaurants that close.
K. As an admin, I want to edit Restaurants where details change
L. As an admin, I want to delete Reviews that are from trolls and spammers
M. As an admin, I want to add a Foodtype so a Restaurant can be associated with it

I'm sure you can come up with a ton more if you sat down and brainstormed for even just a few minutes, but this is plenty.

Let's use this opportunity to practice some agile methodology while we are at it! That sounds fun.

Using Trello Manage Workflow

As introduced in this lesson, Agile methodology is a common approach to software development. If you did not read this lesson, please give it another read through. With Agile, user stories determine the scope of work. Then, the agreed-upon stories are implemented in a focused period of work called a sprint. But we need a tool to keep track of all of the different goals we are trying to accomplish. These goals are generally outlined on something called a scrum board.

Let's practice this with a tool called Trello. It will allow us to create a virtual scrum board to practice agile basics. There are many other tools like this available, such as Cardsmith, Pivotal Tracker, and more; but Trello is common amongst web development teams, and easy to start with, so we'll use it to begin our agile practice in class.

Go ahead and sign up for a Trello account at trello.com. It's free. After confirming your email, explore the welcome board (similar to the one below):


Then, when you're ready, create a new board called Jadle:

  • Rename the first column "Current Sprint"
  • Name the second "In Progress"
  • Call the third "Done"
  • The fourth is the "Cooler" or "Icebox" for things that are on hold

Then, select all of the user stories in the numbered list above, copy them, and paste them in the card box under the Current Sprint's heading, currently labelled "Add a card..." Choose Add, and Trello will ask if we'd like to create individual cards or one long one. Choose individual cards.

Now we can move our individual action items from one column to the next as we work, and see our all our user stories progress from "Current Sprint" to "Done". Try picking one up and moving it around. This process is called "Completing a Sprint" and is common practice in software development teams internationally. It's also very satisfying.

Check this link to see the example Trello board for this project. Feel free to change the colour or design on your own board, but keep the column names the same or similar, as those are industry standard.