Furkan Bülbül Practice App Contribution Report - bounswe/bounswe2023group1 GitHub Wiki

Furkan Bülbül

Important Issues and Pull Requests

Links: #210 PR1 PR2
Explanation: After we decided to use Spring Boot with Java and Maven, I started to search for an API considering the responses and endpoints it provides. I got a key for the API, it provides service on Rapid API. We used the Spring Boot on backend, So I implemented the integration according to Restful Spring Boot design. Significant components of the Rest Controller are the controller, service, model explained.
MovieController: Movie Controller is a Spring REST Controller that defines different endpoints for retrieving the Films related the query, rating the movies, and viewing the overall ratings for a movie.
MovieService: Movie Service is where the code send requests to external api. Retrieved response is parse by using the models, Json object is mapped to the Java classes, then returned the response of the endpoint that is residing in controller.
MovieModel: I used Jackson library to parse Json response I retrieved from the external API. WatchedItem: I used this entity class and WatchedItemRepository and mapped into the ORM database we used by using JPA and Hibernate. In repository interface I implemented a query to get the average rating of corresponding movie.

Links: #211 PR1 PR2

I wanted to show exactly 5 movies for each query that a user made. I created the movie cards with titles and images provided by the external API. Subsequently, to use the POST functionality, I added buttons that allows a user to rate any movie. Additionally, user can see the average rating the movie has.

Links: #221 PR1
Explanation: At last, wrote the JUnit tests for the MovieService.

Utilized Third Party URI

I implemented an IMDB API, https://rapidapi.com/apidojo/api/imdb8.

The title/find/v2 is the endpoint I used. It provides the details of the IMDB entities. The response is in Json format and provides many details about the movie-or movie related production-. Other than this endpoint API serves many more, but the endpoint I used more than enough.

API Endpoints

GET /getMoviers with request parameters query: string, limit: integer -however in frontend I used 5 as fixed number-. This API endpoint allows user to get top related movies related to the query.
POST /rateMovie with request parameters title:string, rating:integer. This API endpoint allows user to rate a movie after search.
GET /getAverageRating. This API endpoint allows user to fetch the overall rating of the specified movie. It fetches the data saved into database.

Unit Tests

Used to test whether GET /getMovies method works as intended when the first fetched movie has the same title as it is the.

Used to test whether POST / rateMovie method saves the rating and returns the id.

Used to test whether POST /getRating method returns the zero when there is no entry on database.

Sample Calls

Sample Request: 1

GET / getMovies

Response:

Sample Request: 2

Request: POST / rateMovie

Response:

Sample Request: 3

Request: GET / getAverageRating

Response:

Significant Work

I took responsibility by implementing the IMDB API and doing code review. I had some experience using git including solving conflicts and merging branches, I tried to help my friends regarding git.

Challenges

The most challenging part of implementation was the right Docker containers that are interaction with each other. I tried to use connect database with backend using Docker. I tried to use the mysql image and our backend image.Tried to use Docker network, could not solve the issue.