Member Contribution Report (Furkan Ülke) - bounswe/bounswe2023group7 GitHub Wiki

Important Issues Related to the Practice Application

  • #195: Described the functionalities I'm going to implement, their views, endpoints, model and steps to my overall task.
  • #196: Described my database model. I defined what it will look like, by giving approximate indexes.
  • #208: Related to Unit test.
  • #197: Described my planned steps to create frontend views and integrating them with overall app.

Third-Party URIs

I utilized the Geocoding API. The Geocoding API is a service that accepts a list of places as addresses, latitude/longitude coordinates, or Place IDs. It converts each address into latitude/longitude coordinates or a Place ID, or converts each set of latitude/longitude coordinates or a Place ID into an address. To make the API call, I used the following URI: https://maps.googleapis.com/maps/api/geocode/json while giving Location and GEOCODING_TOKEN as parameter. This URI is used to send a request to the Geocoding API. If you would like to learn more about the API, you can visit this from here.

API Functions

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

  • createEvent - POST: This function creates a new event and adds it to the database. eventDate, eventTime, and eventLocation. To accomplish this, a call is made to the Geocoding API using the location parameter taken from the user. From the data received in the API response, latitude address and longitude address are extracted and stored in the database along with the eventName and eventTime. The route used for this function is /api/events/createEvent
  • list - GET: This function retrieves created events from the database. The route used for this function is /api/events/list

Unit Tests

Ekran Alıntısı Ekran Alıntısı2

  • I wrote two test cases for /createEvent. In first one, I check whether time parameter is given in a wrong format. If it is I returned status code of 400. In the second one I check whether eventName parameter is empty. If it is I returned status code of 400.

Sample Calls

I'm using Postman to display requests and responses.

  • /events/list successful call: list get success

  • /events/list invalid POST request: list invalid post request

  • /events/createEvent successful POST request: createEvent Post success

  • /events/createEvent invalid GET request: createEvent invalid get request

  • /events/createEvent eventName is not provided: createEvent eventName not provided

  • /events/createEvent provided time format is invalid: createEvent invalid time format

Challanges

Since I have not any experience on web programming, I started everything else from stracth. Thus in the first phase of the work, I struggled a lot. I learned Node.js, React.js, and web programming principles.