Member Contribution Report (Melih Gezer) - bounswe/bounswe2023group7 GitHub Wiki

Important Issues Related to the Practice Application

  • #160: Described the functionalities I'm going to implement, their views, endpoints, model and steps to my overall task.
  • #171: Described my database schema for API with its indexes and functions.
  • #172: Related to Unit test
  • #193: Related to Frontend of my application.

Third-Party URIs

I utilized the CheapShark API. This API allows retrieving games and stores information based on a user's email and game name. It provides data such as game names, game stores, prices, game images, and also best deals which I make use of.

To make the API call, I used the following URI: https://www.cheapshark.com/api/1.0/.

This URI is used to send a request to CheapShark API.

If you would like to learn more about the API, you can visit this link.

API Functions

I have created four functions, including three GET requests and one POST request. These functions are as follows:

  • getGameStores - GET: This function retrieves the game stores currently available in the market. The route used for this function is api/gaameprices/stores.

  • getGameInfo - GET: This function retrieves the game info by it's name. To accomplish this, a call is made to CheapShark API using the game name. From the data received in the API response, there are plenty of games beginning from best match. So I get the first match from this data. If the game name is not provided, it returns a 400 error code. The route used for this function is api/gameprices/game?name=${gamename}

  • getGamesCart - GET: This function retrieves the games cart info by user's email. To accomplish this, a call is made to database using the user's email. From the data received, there are plenty of games which user has added to cart. The route used for this function is api/gameprices/. Email is retrieved from the signed user's email adress.

  • addGametoCart - POST: This function adds the searched game to the user's game cart, using user's email and current searched game. If the game or email are not provided, it returns a 400 error code. The route used for this function is api/gameprices/add-cart.

These functions allow for managing game stores data, retrieving game and store informations, adding new game entries to the database, and finding game information based on the game name.

Functions

These functions show reactions for different situations, you can examine each "if" block. Unit tests also provided for these functions.

  • getGameStores:

*getGameInfo:

  • getGamesCart:
  • addGametoCart:

Swagger

  • getGameStores:

*getGameInfo:

  • getGamesCart:
  • addGametoCart:

Challenges

Since I have not many experience on web programming, everything was so new for me so this project was struggle for me considering it a whole. I learned node and react, I learned generally web programming using these framework. I tried to do my best.