EECS 493

EECS 493 Assignment 5: Artist Search

Total Released Due
150 points 3/14 4/5 at 11:59 PM ET

Submission Instructions

Before submitting, please ensure your website loads correctly in Google Chrome by simply clicking and opening the index.html, without the need to host a server (e.g. VS Code Live Server, python3 -m http.server), install any packages (e.g. npm install), or build your code (e.g. npm run build).

Please submit your work to Canvas as a zip file, named a5_<uniqname>.zip. Replace <uniqname> with your uniqname: e.g. a5_zhaojer.zip, note that the angle brackets should NOT be included in your filename. Renaming (e.g., “-1”) done by Canvas is fine.

This zip file should have a single directory containing all files and directories provided in the starter code. In other words, the zip file should have the following structure.

a5_uniqname
├── assets
│   ├── Back.svg
│   ├── Fwd.svg
│   ├── Library.svg
│   ├── Pause.svg
│   ├── Play.svg
│   ├── Repeat.svg
│   ├── Repeating.svg
│   ├── Shuffle.svg
│   ├── Song.svg
│   ├── VolumeDown.svg
│   ├── VolumeUp.svg
│   └── loading.gif
├── img
│   ├── 1.jpg
│   └── 2.jpg
├── index.css
├── index.html
└── script.js

Not following the upload instruction will result in a penalty.

Assignment Objective

The objective of this assignment is for you to gain practical experience with the MVC pattern using Vue.js, a web application development framework, and Bootstrap, a CSS framework for responsive design. Specifically, you will create a website that searches for artists using the iTunes API.

Watch this video for an overview of this assignment: https://youtu.be/C4ekC9MYN9M

Remark: The search results from the video may not be what you get. To determine whether your results are correct, please see the FAQ section.

Grading Breakdown

The assignment has 9 main component (denominator of 150 points):

  1. Search Bar - 25 points
  2. Artists Grid - 30 points
  3. Navigation Tabs - 5 points
  4. Track Information - 5 points
  5. Genre Selection - 20 points
  6. Sort Menu - 15 points
  7. Search History - 10 points
  8. Favorites - 15 points
  9. Play - 25 points

Starter Code

You will use the starter code we provide to complete this assignment.

Download and unpack the starter files (either using the following commands or simply navigating to the link).

$ wget https://eecs493staff.github.io/a5-artist-search/starter_code.tar.gz
$ tar -xvzf starter_code.tar.gz

Here’s a brief description for each of the starter files.

index.html HTML page [Write your HTML code in this file]
script.js Placeholder for one Vue.js instance [Write your JS code in this file]
index.css Additional customized style [Do NOT modify this file]
assets/ A directory containing icons that you may use in your code
img/ A directory containing 2 image placeholders [Your final code won’t need them]

Remarks

Helpful Resources

iTunes API

Vue

JavaScript

Bootstrap

Other

When trying to toggle the ‘Description’ and ‘Track info.’ tabs, take a look at this tutorial and play around with the code. Note how this can be achieved simply using Bootstrap and HTML.

Specifically, quoting directly from it: ‘Add data-toggle="tab" to each tab, and add a .tab-pane class with a unique ID for every tab and wrap them in a .tab-content class.’

If you have trouble (e.g. clicking on 1 Description tab changes all Description tabs, or no matter which Description tab is clicked, only 1 Description tab changes), make sure the stuff bolded is implemented correctly. Put into context of our assignment, each ‘Description’ and ‘Track info.’ tab must have its own unique ID (i.e. <div id='[something unique]'> </div>). In other words, suppose there are 50 songs returned by the API call, then there will be 50 ‘Description’ and ‘Track info.’ tabs, so we need 50 unique IDs for ‘Description’ and 50 unique IDs for ‘Track info.’

Note: This is not the only way to achieve this behavior, but it is in my opinion the easiest way to do so.

Screenshots

Landing Page

Music search interface with an empty search bar and no results displayed in the center of the screen.

Search for an Artist

Music search interface showing results for the artist 'Ayokay.' Fifty tracks found, with several tracks displayed at a time.

“Track Info” Tab (for the left two results)

Music search interface displaying results for the artist 'Ayokay.' Several tracks are visible. The first track’s info tab is selected, showing its track ID and the country of origin.

Sort

An interface displaying music track results with controls to sort the results using a dropdown menu and filter them by genre. Selecting the dropdown filter opens options such as sort list results by: Reset to original, collection, and price

Sort by “Collection Name”

An interface displaying music track results. The results are sorted by collection.

Sort by “Price”

An interface displaying music track results. The results are sorted by price.

Select the “Dance” and “Pop” Genres

Remark: Sort is reset to original in this screenshot.

An interface displaying music track results. In this screenshot the user has selected to filter by 'Dance' and 'Pop'.

Search History

An interface displaying music track results. The search bar displays a list of past search results.

After searching for “John Williams”

An interface displaying music track results. The search bar displays a list of past search results. The user has just searched for artist 'John Williams' which has been added to the list of past search results.

After deleting “ayokay”

An interface displaying music track results. The search bar displays a list of past search results. The search result 'Ayokay' has been removed from the result history.

Favorites

Left Panel

An interface displaying music track results, each with additional options and information, including a star icon; selecting the star marks the track as a favorite and adds it to the “Favorites” folder in the side panel.

After adding “Hedwig’s Theme”

An interface displaying music track results, each with additional options and information, including a star icon; selecting the star marks the track as a favorite and adds it to the “Favorites” folder in the side panel.

Play

An interface displaying music track results, each with additional options and information, including a play button. Selecting the play button opens a now-playing display at the top of the screen showing the current track and a progress bar.

Requirements

We outline the requirements for each of the components below. Everything listed in this section, unless labeled as “Suggested”, is required. Please be sure to examine the overview video and screenshots to understand the expected behavior. Again, remember that your website does not have to look exactly like the one in the video/screenshots.

Please read the Helpful Resources section for hints and learning resources.

General

Ground rules - max 50 points off if not followed

  1. The primary point of the assignment is to use MVC pattern in developing the application using Vue.js. Therefore, reference and direct modification of HTML elements (such as $(".class"), append(), document) in JavaScript and jQuery are NOT allowed.
    • For example, using jQuery or JavaScript code that access HTML elements is NOT allowed (will result in significant deductions).
  2. We’ve given you some starter code, and you’ll only need to write JS code inside Vue instance(s) (in the JS file) and Vue directives in the HTML file.
    • We already created one Vue instance for you. You may add other instances if you prefer, but NO extra JS code should be written outside of Vue instances.
  3. Every style-related element of the assignment MUST be done via Bootstrap.
    • You are NOT allowed to define/use any custom CSS class/id other than the ones we provided in index.css.
      • i.e. Do NOT modify index.css.
    • You are NOT allowed to use inline styling (e.g. style=''). The only exception to this rule is when implementing the progress bar, which you may use exactly one instance of inline styling (style='') to dynamically update its width.
  4. The provided index.html file includes (links to) jQuery, Bootstrap, Vue.js, and Axios.
    • In order for index.html to work properly, make sure you
      • Have internet connection,
      • Do NOT modify anything inside the <head> tag in index.html.
    • Note that index.html has some hard-coded data. This is just to show you an example, but the hard-coded data should eventually be replaced.
  5. Follow the submission instructions at the beginning of the spec.
  6. After unzipping your submission, the index.html file should work by directly opening it in Google Chrome, as long as there is an internet connection.
  7. This assignment uses the iTunes API, which again requires internet access. Plan ahead if you will be in a situation that has no internet access. It is your responsibility to read the documentation and figure out the data structure of the JSON object.
  8. This assignment requires online search and reading the documentation of Vue.js and iTunes API that we use. The assignment may include materials that are not covered in class. We believe that, in today’s programming practice, searching and mining information from online materials is a significant part of a programmer’s expertise.
  9. Check out Piazza frequently for any changes or additional information.

Search Bar (25 points)

Artists Grid (30 points)

Track Information (5 points)

Genre Selection (20 points)

Sort Menu (15 points)

Here is another example of what the sort menu should look like and how it works.

In the dropdown menu, initially, it should be set as the “Reset to original” indicated below by blue background.

An interface displaying music track results with controls to sort the results using a dropdown menu and filter them by genre.

When selecting a different option, it should be changed to that selection, for example, selecting “Collection Name”, indicated by the blue background.

An interface displaying music track results with controls to sort the results using a dropdown menu and filter them by genre. Selecting the dropdown filter opens options such as sort list results by: Reset to original, collection, and price.

After an artist search and sorting by “Collection Name”, then selecting different genres should still update the list by “Collection Name”.

In other words, if the user sorts by Collection Name, it should update the list sorted by collection name; after that, if the user picks a genre, e.g. Anime, it should update the Anime list sorted by collection name too.

An interface displaying music track results with controls to sort the results using a dropdown menu and filter them by genre. In this screenshot the user has selected to filter by the Soundtrack genre.

This should work when selecting any of the three sort options.

Search History (10 points)

Favorites (15 points)

Play (25 points)

CORS Header

When doing this assignment, you might run into your search results being rejected with a “CORS” message. This error is largely server-side, so there is no simple solution. The success of the request will change depending on what browser you are using, if you are hosting the page on the server, and the configuration of the iTunes server the artist you are requesting is stored on.

One solution that often works is adding &origin=* to the end of your search query. This will often resolve the error if you are running your code directly from a file.

There are other ways that might help if you still encounter this issues:

Again, many of these errors are configuration dependent. If you continue to have issues, please come speak to us in office hours or post on Piazza.

FAQ

Sometimes, the search result seems unrelated to the search keyword, is this fine?

Yes, as long as you are correctly using the 3 query parameters listed in the iTunes API section.

When I minimize the window to the minimum width, the text in one artist grid overlaps with the next artist grid, is this fine?

Yes.

Should our search results match exactly the ones in the spec?

Not necessarily, since API results change from time to time. As long as you make sure you are using the 3 (and only those 3) parameters in the iTunes API section, you should be all set.

Acknowledgments

Original spec written by Zirui Zhao zhaojer@umich.edu. Updated by the EECS 493 team.

This document is licensed under a Creative Commons Attribution-NonCommercial 4.0 License. You’re free to copy and share this document, but not to sell it. You may not share source code provided with this document.