Skip to content

Never forget your medical supplies again! MediMindeRx is an application designed to help users create reminders for their medical supplies based on time or geolocation. The MediMinderx-API-v1 is the backend application used by all of MediMinderx's applications. The application builds out RESTful API endpoints with full CRUD functionality for use…

Notifications You must be signed in to change notification settings

MediMindeRx/MediMinderx-API-v1

Repository files navigation

Abstract

Never forget your medical supplies again! MediMindeRx is an application designed to help users create reminders for their medical supplies based on time or geolocation.

The MediMinderx-API-v1 is the backend application used by all of MediMinderx's applications. The application builds out RESTful API endpoints with full CRUD functionality for users and their reminders.

The most difficult and rewarding thing about building this application was picking up a brand new tech stack. We were able to learn python and develop this application in flask in a matter of 14 days.

Deployment

Check out our deployed site! MediMindeRx Check out our demo video! MediMindeRx Demo

Set up

Follow the steps below to get this database up and running on your local environment:

Prerequisites

Installation

  • Clone down this repo

    1. git clone [email protected]:MediMindeRx/MediMindeRx-API-v1.git
    2. cd into directory MediMindeRx-API-v1
  • Initialize database for first time with

    1. python3 -m venv env
    2. source env/bin/activate
    3. pip3 install -r requirements.txt
    4. createdb mediminderx
    5. export DATABASE_URL==postgresql://<YOUR USERNAME>:<YOUR PASSWORD>@localhost:5432/mediminderx
    6. python migrate.py db init (this creates a db, so make sure you don’t have one already in postico)
    7. python migrate.py db migrate
    8. python migrate.py db upgrade
    9. python run.py to start the server
  • How to run test suite

    1. createdb mediminderx_test
    2. export DATABASE_URL==postgresql://<YOUR USERNAME>:<YOUR PASSWORD>@localhost:5432/mediminderx_test
    3. python migrate.py db upgrade
    4. pytest

Tech Stack

  • Python3
  • Flask
  • PostgreSQL
  • Postico
  • Testing Software
  • Testing Software

Future Extentensions

  • Option to send texts to family members via Twilio api
  • Users can find all the nearest emergency centers (i.e. hostpitals, police stations)
  • Users can get notifications based off heart rate or step count sourced off health application such as thorugh fitbit or apple's health app

Contributors

Endpoints

POST https://mediminderx-api.herokuapp.com/api/v1/users

Body: json {"name": "John"}

Response:

{
  "data": {
      "type": "users",
      "id": 1,
      "attributes": {
          "name": "John"
      }
  }
}

GET https://mediminderx-api.herokuapp.com/api/v1/users/1

Response:

{
  "data": [
      {
          "type": "users",
          "id": 1,
          "attributes": {
              "name": "John"
          }
      }
  ]
}

GET https://mediminderx-api.herokuapp.com/api/v1/users

Response:

{
  "data": [
      {
          "type": "users",
          "id": 1,
          "attributes": {
              "name": "John"
          }
      },
      {
          "type": "users",
          "id": 2,
          "attributes": {
              "name": "Jane"
          }
      }
  ]
}

PATCH https://mediminderx-api.herokuapp.com/api/v1/users/1

Body:

{
  "name": "Jake",
  "id": "1"
}

Response:

{
  "data": {
      "type": "users",
      "attributes": {
          "name": "Jake"
      },
      "id": 1
  }
}

DELETE https://mediminderx-api.herokuapp.com/api/v1/users/1

Body:

NO BODY

Response:

{
  "message": "User has been successfully deleted"
}

POST https://mediminderx-api.herokuapp.com/api/v1/reminders

Body:

{
  "user_id": "1",
  "title": "Soccer Practice",
  "supplies": "inhaler",
  "show_supplies": "false"
}

Response:

{
  "data": {
    "type": "reminders",
    "id": 3,
    "attributes": {
        "user_id": 1,
        "location_reminder": null,
        "creation_date": "2020-10-26T20:17:36.207302",
        "schedule_reminder": null,
        "supplies": "inhaler",
        "show_supplies": false,
        "title": "Soccer Practice"
    }
  }
}

PATCH https://mediminderx-api.herokuapp.com/api/v1/reminders/1

Body:

{
  "id": "1",
  "title": "Dance Practice",
  "supplies": "inhaler",
  "show_supplies": "false"
}

Response:

{
  "data": {
    "type": "reminders",
    "attributes": {
        "supplies": "inhaler",
        "user_id": 1,
        "show_supplies": false,
        "location_reminder": null,
        "title": "Dance Practice",
        "creation_date": "2020-10-26T20:17:36.207302",
        "schedule_reminder": null
    },
    "id": 3
  }
}

DELETE https://mediminderx-api.herokuapp.com/api/v1/reminders/3

Body: NO BODY

Response:

{
  "message": "Reminder successfully deleted"
}

GET https://mediminderx-api.herokuapp.com/api/v1/users/1/reminders

Response:

{
  "data": [
    {
      "type": "reminders",
      "id": 4,
      "attributes": {
        "supplies": "inhaler",
        "title": "Soccer Practice",
        "location_reminder": null,
        "schedule_reminder": {
          "data": {
            "type": "schedule",
            "id": 6,
            "attributes": {
              "days": "Tuesday, Wednesday",
              "unix_time": "1603767106",
              "creation_date": "2020-10-26T20:54:48.401702",
              "repeating": false
              "times": "10:30"
            }
          }
        },
        "creation_date": "2020-10-26T20:46:35.589353",
        "user_id": 1,
        "show_supplies": false
      }
    },
    {
      "type": "reminders",
      "id": 5,
      "attributes": {
        "supplies": "Knee Brace",
        "title": "Hockey Game",
        "location_reminder": {
            "data": {
                "type": "location",
                "id": 5,
                "attributes": {
                    "location_name": "Home",
                    "longitude": "-77.0364",
                    "address": "123 Address Lane"
                    "creation_date": "2020-10-26T20:56:33.014708",
                    "latitude": "38.8951"
                }
            }
        },
        "schedule_reminder": null,
        "creation_date": "2020-10-26T20:47:04.818274",
        "user_id": 1,
        "show_supplies": false
      }
    }
  ]
}

POST https://mediminderx-api.herokuapp.com/api/v1/schedules

Body:

{
  "reminder_id": "1",
  "schedule_name": "Soccer reminder",
  "unix_time": "1603767106",
  "repeating": "false",
  "days": "Tuesday, Wednesday",
  "times": "10:30"
}

Response:

{
  "data": {
    "type": "schedule",
    "attributes": {
    "id": 6,
      "days": "Tuesday, Wednesday",
      "unix_time": "1603767106",
      "schedule_name": "Schedule 1",
      "repeating": false
      "creation_date": "2020-10-26T20:54:48.401702",
      "times": "10:30"
    }
  }
}

POST https://mediminderx-api.herokuapp.com/api/v1/locations

Body:

{
  "reminder_id": "5",
  "location_name": "Home",
  "latitude": "38.8951",
  "longitude": "-77.0364",
  "address": "123 Address Lane"
}

Response:

{
"data": {
    "type": "location",
    "id": 5,
    "attributes": {
      "location_name": "Home",
      "longitude": "-77.0364",
      "creation_date": "2020-10-26T20:56:33.014708",
      "latitude": "38.8951",
      "address": "123 Address Lane"
    }
  }
}

About

Never forget your medical supplies again! MediMindeRx is an application designed to help users create reminders for their medical supplies based on time or geolocation. The MediMinderx-API-v1 is the backend application used by all of MediMinderx's applications. The application builds out RESTful API endpoints with full CRUD functionality for use…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •