Individual Contribution Report 2 Muhammet Batuhan İlhan - bounswe/bounswe2023group3 GitHub Wiki

Important Issues Related to the Practice Application:

  • #53: I initialized the project.I create a django project and push it to github and made some gitignore modifications.
  • #82: This is the biggest part of the milestone. I created my app. Firstly, I decided to external api that I will be use for one of the my endpoints. Then, I constructed my Database models by using Django ORM. After that, I implement endpoints that consumes and produce response in json format and connected them to urls. After testing these endpoints with postman, I create html as a template and css for user interface. Then I tested the ui using a browser and then I wrote the unit tests. Lastly, I write swagger document for my endpoints.
  • #112: Wu built the docker image and deploy it to aws.

Third-Party URIs

I used Hipolabs api. This api returns information about universities all over the world. It takes a parameter which is country. I used the university endpoint of this endpoint by giving "Turkey" as a parameter. This endpoint returns all universities in the given country

To make the API call, I used the following URI: http://universities.hipolabs.com/search?country=Turkey.

API Functions

I have created four endpoints, including three GET requests and one POST request. Each of these endpoints corresponds one function in the views. One of this endpoint is an entry endpoint that renders a html template.

/universities - GET: This endpoint returns a html for easy use of the app with UI.

/universities/listall - GET: This endpoint calls the external API that returns all the universities in Turkey an returns this response as JSON response.

/universities/add - POST: This endpoint creates a new university in the DB with a review about this University. This endpoint takes three parameters which are name of the university, web page url of the university and a review about it. After saving the entity, the function returns as a json response of the created object.

/universities/list - GET: This endpoint returns all universities in the DB that was created using "/universities/add" endpoint.

For more detailed information about the endpoints check the university tag of the swagger documentation

Unit Tests

I write tests for all endpoints with successful response and a not succesful response for missing parameter in the post request.

I have test class extending django test class and created functions in that class. First one is setup that is called before each test and 4 test functions for testing the endpoints. Here are the test functions:

Screenshot from 2023-05-12 23-40-59 Screenshot from 2023-05-12 23-41-04 Screenshot from 2023-05-12 23-41-12

Sample Calls

You can view the ui from the link. Here are the endpoints returns: Screenshot from 2023-05-12 23-46-11 Screenshot from 2023-05-12 23-46-25 Screenshot from 2023-05-12 23-47-25

Dockerization and Deployment

We wrote Dockerfile together and deployed to aws. You can find the file on github.

Challanges

Dockerization and deployment are hard for me because I am not familiar with them much.