{"id":15983313,"url":"https://github.com/suyashkumar/heart_rate_databases_starter","last_synced_at":"2025-03-17T22:31:24.758Z","repository":{"id":77761937,"uuid":"124593798","full_name":"suyashkumar/heart_rate_databases_starter","owner":"suyashkumar","description":"Starter codebase for BME590 Databases Assignment","archived":false,"fork":false,"pushed_at":"2018-04-04T16:04:57.000Z","size":6,"stargazers_count":4,"open_issues_count":2,"forks_count":28,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T05:48:08.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/suyashkumar.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":"2018-03-09T21:12:40.000Z","updated_at":"2025-01-10T19:47:10.000Z","dependencies_parsed_at":"2023-03-12T01:58:22.454Z","dependency_job_id":null,"html_url":"https://github.com/suyashkumar/heart_rate_databases_starter","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/suyashkumar%2Fheart_rate_databases_starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyashkumar%2Fheart_rate_databases_starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyashkumar%2Fheart_rate_databases_starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyashkumar%2Fheart_rate_databases_starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suyashkumar","download_url":"https://codeload.github.com/suyashkumar/heart_rate_databases_starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243891860,"owners_count":20364601,"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":[],"created_at":"2024-10-08T01:41:35.046Z","updated_at":"2025-03-17T22:31:24.509Z","avatar_url":"https://github.com/suyashkumar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# heart_rate_databases_starter\nStarter codebase for BME590 Databases Assignment (which can be found [here](https://github.com/mlp6/Medical-Software-Design/blob/master/Lectures/databases/main.md#mini-projectassignment)). \n\nTo get started with this sample code, you first need to get the mongodb program running. To do this, simply run \n```\ndocker run -v $PWD/db:/data/db -p 27017:27017 mongo\n```\n\neither on your local machine (if you have docker installed there) or on a virtual machine you have access to where you can first install docker.\n\n:eyes: if you are running your mongodb database on a virtual machine, you need to replace the `connect` URI string in `main.py`. Replace `localhost` with a VM address, like so:\n\n```py\nconnect(\"mongodb://vcm-0000.vm.duke.edu:27017/heart_rate_app\") # open up connection to db\n```\n\nonce your database is running and your connection string is set, you can run the starter program by running `main.py` after activating your `virtualenv` and installing all the dependencies listed in `requirements.txt`.\n\n```\npython main.py\n```\n\n## The Assignment + Hints\n\nThis starter code _is not_ a flask server like you need to build in your assignment--`main.py` is an example module that contains several useful functions for creating a `User` (`create_user`) and updating a `User` with a new heart rate and heart rate timestamp (`add_heart_rate`). \n\n`models.User` is a data model that represents the entity we want to store and retreive from the database. You can see that `User` is just a python class with some properties. \n\n:eyes: When writing the `POST /api/heart_rate` endpoint, you need to first check if the user with the given email already exists in the database. If so, then you can use `add_heart_rate` to append a heart rate measurement to that user. If not, then you would want to `create_user`. I did not explicitly show you how to check if a user already exists in the database, but this is something you should be able to figure out based on the sample code + google + office hours! \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuyashkumar%2Fheart_rate_databases_starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuyashkumar%2Fheart_rate_databases_starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuyashkumar%2Fheart_rate_databases_starter/lists"}