/dementia_music_memory

Python, Django REST API

Primary LanguagePython

Screen Shot 2020-09-12 at 10 37 54 PM

Music Memory REST API


An Individual project Built using a Django REST Framework that ties to the client-side application, Join Their Journey with Music 🎶 that helps caregivers interact, connect, and record standardized data on those suffering from dementia.

ERD

Screen Shot 2020-09-12 at 10 37 54 PM


Launching the Music Memory API

  1. Create a new directory in your terminal of choice
  2. Clone down the repository by clicking the "Clone or Download" button
  3. In your terminal write: git clone sshKeyGoesHere conversion tool for writers.

Now, set up your virtual environment:

  1. python -m venv musicmemoryEnv
  2. Activate virtual environment:
    • Mac
      • source ./ musicmemoryEnv/bin/activate
    • Windows Maybe need to use Scripts
      • source ./ musicmemoryEnv/Scripts/activate
  3. Install dependencies: pip install -r requirements.txt
  4. Run migrations: python manage.py migrate
  5. Create a superuser for your local version of the app: python manage.py createsuperuser
  6. Now Run that Server! python manage.py runserver

Testing in Postman

Create Caretaker/User

"username": "TestUser",
"email":"TestUser123@gmail.com",
"password" :"123",
"first_name": "Test",
"last_name" : "Testerson",
"title": "Nurse"
}

Screen Shot 2020-09-12 at 10 37 54 PM

{
"title": "Music Therapist"
"first_name": "Molly",
"last_name": "Mollison",
"username": "Molly123"
}

Patient

{
"first_name": "Bobby",
"last_name": "Bobberson",
"diagnosis": "Alzheimers",
"year_of_birth": "1925",
"caretaker_id":(whatever the id is from the caretaker you made)
}

Screen Shot 2020-09-15 at 10 57 56 AM

{
"first_name": "Billy",
"last_name": "Billison",
"diagnosis": "Alzheimers",
"year_of_birth": "1935"
}

Song

List:

Screen Shot 2020-09-14 at 8 48 17 PM

  • Now let's find out what songs were in the billboard top 5 if you're not Logged into the app and you just quickly want to know what songs were in the top 5 billboard charts for a person born between any year from 1920-1970.
  • go to http://127.0.0.1:8000/songs?birth_year=(yyyy) and select GET Screen Shot 2020-09-14 at 8 47 30 PM

Song Response

  {
  "caretaker_id":(whatever the id is from the caretaker you made),
  "song_id": 15,
  "patient_id": (whatever the id is from the patient you made),
  "eye_contact_id": 5,
  "talkativeness_id": 5,
  "mood_id": 5,
  "movement_id": 5,
  "vocalization_id": 5,
  "liked_song_id": 5,
  "notes": "These are the notes"
  }

songresponses_get

  {
  "eye_contact_id": 1,
  "notes": "I wanted to update this file",
  "talkativeness_id": 1,
  "mood_id": 1,
  "movement_id": 1,
  "vocalization_id": 1,
  "liked_song_id": 1
  }

songresponses_get