{"id":19876057,"url":"https://github.com/davidf1000/technical-assessment-covid-api","last_synced_at":"2026-04-09T21:02:56.574Z","repository":{"id":124918743,"uuid":"443643540","full_name":"davidf1000/technical-assessment-covid-api","owner":"davidf1000","description":"Technical assessment for Nodeflux SWE Internship","archived":false,"fork":false,"pushed_at":"2022-01-03T16:40:31.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T17:19:08.073Z","etag":null,"topics":["docker","flask","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidf1000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-01T23:28:29.000Z","updated_at":"2022-07-05T01:54:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1092df8-e17f-4b8d-9bad-b6deb6a3ed66","html_url":"https://github.com/davidf1000/technical-assessment-covid-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidf1000%2Ftechnical-assessment-covid-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidf1000%2Ftechnical-assessment-covid-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidf1000%2Ftechnical-assessment-covid-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidf1000%2Ftechnical-assessment-covid-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidf1000","download_url":"https://codeload.github.com/davidf1000/technical-assessment-covid-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241304294,"owners_count":19941100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","flask","python"],"created_at":"2024-11-12T16:30:25.275Z","updated_at":"2025-11-25T03:05:38.235Z","avatar_url":"https://github.com/davidf1000.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Python](https://img.shields.io/badge/python-2.7%2C%203.5%2C%203.6--dev-blue.svg)]()\n[![Travis](https://travis-ci.org/brennv/flask-app.svg?branch=master)](https://travis-ci.org/brennv/flask-app)\n[![Coverage](https://codecov.io/gh/brennv/flask-app/branch/master/graph/badge.svg)](https://codecov.io/gh/brennv/flask-app)\n[![Code Climate](https://codeclimate.com/github/brennv/flask-app/badges/gpa.svg)](https://codeclimate.com/github/brennv/flask-app)\n[![Docker](https://img.shields.io/docker/automated/jrottenberg/ffmpeg.svg?maxAge=2592000)]()\n\n# Introduction\nNodeflux Software Engineer Internship Batch 2 Technical Assessment \n\u003cbr /\u003e\n\u003cbr /\u003e\nA docker containerized HTTP API server that could retrieve GET information about current status of covid cases and vaccination rates in Indonesia. Server is able to list the data by yearly, monthly, daily, and be able to provide information on general situations. Data is fetched from official Indonesian Goverment APIs. \n\u003cbr /\u003e\n\u003cbr /\u003e\nHTTP API server is written in Python using Flask Framework. Flask Blueprint is used for code modularization. Error handling is defined for various scenario and will reports errors by returning appropriate HTTP status code. Postman is used during the development process and Python unittest module is used to do unit testing for each created API. Python coverage module is used to measure test coverage. Server is containerized using Docker. The Docker Image is pushed to Docker Hub.\n\n## Getting started\n\nInstall [docker](https://docs.docker.com/engine/installation/) and pull application's docker image from :\n\u003cbr/\u003e\nDocker Image repository link : \n\u003cbr/\u003e \npull docker image using : https://hub.docker.com/r/davidf1000/api-nodeflux-assessment\n```shell\ndocker pull davidf1000/api-nodeflux-assessment\n```\n\nRun the image using : \n```shell\ndocker run -it -d --network=host --rm -p 5000:5000 davidf1000/api-nodeflux-assessment\n```\n\nOtherwise, for the standalone web service:\n```shell\npip install -r requirements.txt\npython3 app.py\n```\n\n\nVisit [http://localhost:5000](http://localhost:5000)\n\n\u003cbr/\u003e \u003cbr/\u003e\nTo build Docker images using Dockerfile, run :\n```shell\ndocker build -t \u003cimage-name\u003e . \n```\n\u003cbr/\u003e \u003cbr/\u003e\n\n## Implementation\nRun inside docker image : \n![dockerrun](https://user-images.githubusercontent.com/47879766/147946745-672f0062-04d5-4ad0-8591-aa87ab783b89.png)\nRun using standalone web service : \n![pythonapp](https://user-images.githubusercontent.com/47879766/147946749-2c42667c-4736-4bb5-a116-578fba987e60.png)\nDocumentation of API using Postman : \n\n1.  API used for Covid Cases Data : https://hub.docker.com/r/davidf1000/api-nodeflux-assessment\n![1](https://user-images.githubusercontent.com/47879766/147946715-f8430315-53eb-42a3-94a1-487afd811ea6.png)\n2. \"http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/\"  \n![2](https://user-images.githubusercontent.com/47879766/147946723-e6319177-75a4-4b39-b30f-8b862d8914db.png)\n3. http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/yearly\n![3](https://user-images.githubusercontent.com/47879766/147946724-14bf78b9-97b0-4d61-b6b2-bd575aea6b48.png)\n4. http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/yearly/\\\u003cyear\\\u003e\n![4](https://user-images.githubusercontent.com/47879766/147946726-5d0fad28-60af-4ca5-a1de-05505c2c2e46.png)\n5. http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/monthly\n![5](https://user-images.githubusercontent.com/47879766/147946729-2ed9de3f-5758-44bc-a3a6-9b783effb4a2.png)\n6. http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/monthly/\\\u003cyear\\\u003e\n![6](https://user-images.githubusercontent.com/47879766/147946731-21255bd9-2123-43b3-a79d-758b74dcd5a7.png)\n7. http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/monthly/\\\u003cyear\\\u003e/\\\u003cmonth\\\u003e\n![7](https://user-images.githubusercontent.com/47879766/147946735-f31add29-a24c-472b-a0e9-84eca79ce55f.png)\n8. http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/daily\n![8](https://user-images.githubusercontent.com/47879766/147946737-12e35e71-14dc-4419-b53f-5e3677c63c82.png)\n9. http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/daily/\\\u003cyear\\\u003e\n![9](https://user-images.githubusercontent.com/47879766/147946739-090e2886-2915-47e9-8df4-9deb0c528cca.png)\n10. http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/daily/\\\u003cyear\\\u003e/\\\u003cmonth\\\u003e\n![10](https://user-images.githubusercontent.com/47879766/147946741-7b0e0ffa-ea46-4dc5-959f-7e70143eff0c.png)\n11. http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/daily/\\\u003cyear\\\u003e/\\\u003cmonth\\\u003e/\\\u003cdate\\\u003e\n![11](https://user-images.githubusercontent.com/47879766/147946742-8498c6ac-c39b-49d7-9197-253a63a9ad6b.png)\n## Unit Tests\nUnit Test using unitest module. List of unit testing criteria implemented: \n1. 200 OK response\n2. Method allowed\n3. Content return\n4. Query string validity\n5. Path param validity\n6. Response body  \n7. 404 Not found response\nUnit tests individual API with:\n\n```shell\npython3 tests/test_all.py \u003capiClassName\u003e \n```\n1. GeneralTest : http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/\n2. YearlyTest : http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/yearly\n3. YearlyProvidedYearTest : http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/yearly/\\\u003cyear\\\u003e\n4. MonthlyTest : http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/monthly\n5. MonthlyProvidedYearTest : http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/monthly/\\\u003cyear\\\u003e\n6. MonthlyProvidedYearMonthTest : http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/monthly/\\\u003cyear\\\u003e/\\\u003cmonth\\\u003e\n7. DailyTest http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/daily\n8. DailyProvidedYearTest : http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/daily/\\\u003cyear\\\u003e\n9. DailyProvidedYearMonthTest : http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/daily/\\\u003cyear\\\u003e/\\\u003cmonth\\\u003e\n10. DailyProvidedYearMonthDateTest : http://\\\u003chost\\\u003e:\\\u003cport\\\u003e/daily/\\\u003cyear\\\u003e/\\\u003cmonth\\\u003e/\\\u003cdate\\\u003e\n\nOr to run every testcase from every API : \n```shell\npython3 tests/test_all.py\n```\n\n### Unit Test Result \n![test_result](https://user-images.githubusercontent.com/47879766/147946754-04927e16-e575-4d6a-987e-3dcfe1b5b4e1.png)\n### Unit Test Coverage\nTo Check the coverage of unit test run: \n```shell\ncd tests\ncoverage run -m unittest test_all.py\n```\nTo show report of the results : \n```shell\ncoverage report\n```\n![coverage](https://user-images.githubusercontent.com/47879766/147946744-cc18c41c-4619-4937-9a5a-596f8595a51f.png)\nBased on test coverage report, unit test has a test coverage of 95% \n## Additional Information\nBased on Implementation of Covid Cases HTTP API, server is able to meet all the requirements needed and provide error handling for various scenarios. Unit testing of the API shows average test coverage of 95%. \n### Current Limitations\nSystem still doesnt fully handle internal system error, especially when caused by improper JSON response structure and querying data  \n### Future Ideation\n- Use the API to create Covid Cases Plotter Website (Reference : https://github.com/davidf1000/Corona-Tracker-React , https://warm-mesa-01623.herokuapp.com/ ) \n- Further containerizing Flask Web Apps together with uWSGI and NGINX using docker compose so that it can be deployed securely with high performance and efficiency \n- Create new string query to sort lists of data with ASC or DESC order\n- Create new string query to limit the elements of data lists for the first X latest data\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidf1000%2Ftechnical-assessment-covid-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidf1000%2Ftechnical-assessment-covid-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidf1000%2Ftechnical-assessment-covid-api/lists"}