Your challenge is to finish this web app which lists the top 100 music albums from iTunes with search and filter functionality.
- Fork this GitHub repository.
- Implement the changes listed below.
- Ensure that the GitHub CI build succeeds.
- Java 21 or newer
-
./gradlew bootRun -
Open http://localhost:8080 in your browser.
-
You can also run the app from IntelliJ by running
Applicationclass.
NOTE
The tests cover most of the required functionality. You can run tests by executing ./gradlew test or
executing them in IntelliJ.
- Currently, there are some hardcoded filtering options (also called facets) for price and year filters. You need to generate options that are relevant for albums that match the search query.
- Price filtering options should be displayed in ranges, e.g.,
0-5,5-10,10-15. - Year filter options should be all years, in descending order, that match at least one album.
- Search results can be narrowed by selecting some filtering options.
- Filters in the same group should be joined by
ORand different groups are joined byAND. For example, if a user selects the years 2017 and 2018, and price range5-10, you should show albums with a price between 5 and 10 and from 2017 or 2018. - When no filters are selected, show all albums that match the search query.
- Each filtering option has a count displayed next to it which indicates how many results are matched by the filter. The numbers have to take into account selected filters in other groups and update as user checks or unchecks filters to be accurate for the current filtering combination.
- You should show only the options that will match at least one album. Thus, filtering options might change when a user
selects other filters. For example, if a user selects price range
0-5and there are no albums that cost between 0 and 5 and were released in 2017, you shouldn't show year 2017 as a filtering option. But 2017 should appear as a filter option when the user selects the5-10price range (or has no price selected) because there are some albums that were released in 2017 and cost 9.99.