Description
We are developing a health monitoring platform that tracks participating patients’ daily health metrics such as steps, resting heart rate etc. We collect these data through wearable trackers and sync them into our cloud database. At the same time we also build APIs for our client app to view these data.
Task Description
You are given a zipped folder containing MongoDB dump files. Unzip and use mongorestore to recover it into your local MongoDB. It should be restored to a database named empower-auth.
Your task is to build a RESTful API server that sits on top of this database.
This API service should include:
1. A login endpoint that allows a patient to login with username and password. Use the Patient collection in the db as your datasource–its schema should be self explaining. Choose whatever auth method of your liking.
3. A rank endpoint that returns a list of Patient.username s. The list is ordered by the total steps a user has accumulated throughout the history, in Descending order. Use the same activity_daily_summary collection in the db as your datasource.
Requirements
● Use the Python Flask framework to build your API server.
● Include a readme file in the root folder that documents your endpoints.
● Unit test your code as much as possible. Use the pytest tool.
● Initialize a git repository in your project folder so we can view your commit histories.
● Provide a start.sh (start.bat in Windows) script file in the root folder that builds the dependencies and then starts the server.
● Host the Flask server at http://localhost:5000 and MongoDB at http://localhost:27017
Submission
● Zip your project folder and email it to wang.c@nus.edu.sg
● Do not include the database dump files as we have the same copy on our local machines.
Good luck!
Chen
Reviews
There are no reviews yet.