Git Product home page Git Product logo

rehabplus's Introduction

RehabPlus

Designed for orthopedic surgeons, physiotherapists, and patients, Rehab Plus is a post-surgical/injury recovery application. Built with React Native/ TypeScript and React Navigation, it offers robust backend support with Firebase integration for Authentication and Firestore for the database.

Features

  • Patients can access protocols assigned by their practitioner, allowing for structured and efficient recovery. Each exercise within these protocols comes with a detailed video and description.

  • Practitioners can use pre-made protocols or design their own from an extensive exercise database. This flexibility ensures that they can provide the best tailored recovery plan for their patients.

  • Progress Tracking: Patients' progress in terms of range of motion and strength is meticulously tracked. This empowers both the patient for self-monitoring and the practitioner for evaluation and adjustments.

  • Efficiency for Physiotherapists: Backend protocol adjustments are streamlined, saving time and ensuring that changes can be made quickly and effectively.

Screenshots (Prototype)

Screenshot 2024-01-22 at 1 34 04 PM Screenshot 2024-01-17 at 4 40 52 PM Screenshot 2024-01-22 at 2 12 13 PM Screenshot 2024-01-22 at 2 12 56 PM

Technologies used

  • React Native
  • Expo Go
  • NativeWind
  • React Navigation
  • FireBase/FireStore

rehabplus's People

Contributors

stunnadawg avatar dgendave avatar

Watchers

 avatar  avatar

rehabplus's Issues

Alert breaks adding exercises new Workout

Alert to confirm deletion ruins mapping

Plays into issue #43, the deletion works but when trying to add an alert to confirm an exercise to be deleted from the state, the mapping of the exercise widgets is broken and refuses to load the exercise.

  • May have something to do with setting state under a separate button? The code is commented out, so when ready check it out future me.

Convert code base to Typescript

Introduce type safety to the code base.

This includes:

  • Installing TypeScript for React native:
npm install --save-dev typescript @types/react @types/react-native
  • Creating the tsconfig file
  • Renaming all files to .ts or .tsx
  • Make sure babel.config.js handles typescript correctly
  • Run npx expo start to make sure no errors occur
    Once this issue is resolved we can slowly add type safety to each module/function!

New Protocol Phase widget bug

Phase Widget Render bug

When creating a new protocol/ editing a protocol, the phase widgets are not mapping correctly again, this has happened before and popped up again. Basically the phases are just replacing themselves on screen when a new phase is made, it still adds to the database just a UI issue. The screenShot below demonstrates the UI issue.
Screenshot 2023-11-10 at 7 14 12 PM

Exercise list needs re render on exercise delete

Exercise Delete Scrollview re render

  • Exercise Page While editing workout does not re render when user deletes exercise. I added context state to re fetch the exercises but I have not figured it out yet. This is a future problem for now.

Google Authentication

Authentication process using Google

  • Add Google authentication using Firebase Auth (follow documentation or tutorial)

Images in Protocols

Add images to Protocols

  • When creating new / editing allow physicians to add their own image covers to the protocol
  • Should be able to add through a button on the main editing / creation page

Update Styling

Application needs Style

  • Create an identity for the Application that is used throughout
  • Use blue and grey
  • Use Application Logo

Exercise Database

Begin Creation of Exercise Database

  • Create a database section of exercises

  • Separate into categories example: All categories, Bicep, Quad etc...

  • Query Exercises through search

Create Client Login

Clients need an account/login

  • Upon Physicians creating a Client, a temporary password should be sent to the user for the client to gain access to the app

Image Uploading Function Problem

Image Uploading Stuck

  • When trying to upload an Image to Firestore it hangs on the upload, Specifically on the console.log(Upload is running)
  • No error is ever presented
  • See code below to follow the stack that is used for the attempted image upload

Image Upload Process

First we pick the image from photos Library using Expo image picker

import { View, Text, Image } from "react-native"
import * as ImagePicker from "expo-image-picker"
import React, { Dispatch, SetStateAction, useState } from "react"
import { storage } from "../firebase"
import { Button } from "react-native-paper"

type UrploadImageType = {
  setUri: Dispatch<SetStateAction<string>>
}

const UploadImage = ({ setUri }: UrploadImageType) => {
  const [image, setImage] = useState<string | null>()

  const pickImage = async () => {
    // No permissions request is necessary for launching the image library
    let result = await ImagePicker.launchImageLibraryAsync({
      mediaTypes: ImagePicker.MediaTypeOptions.All,
      allowsEditing: true,
      aspect: [4, 3],
      quality: 1,
    })

    if (!result.canceled) {
      setImage(result.assets[0].uri)
      setUri(result.assets[0].uri)
    }
  }

  return (
    <View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
      {image && (
        <Image source={{ uri: image }} style={{ width: 200, height: 200 }} />
      )}
      <Button onPress={pickImage}>Pick an image from camera roll</Button>
    </View>
  )
}

export default UploadImage

Create Blob when pressing Exercise Create Button, takes in image URI we pass down through props

const getBlobForUri = async (uri: string) => {
    if (uri) {
      const blob: Blob = await new Promise((resolve, reject) => {
        const xhr = new XMLHttpRequest()
        xhr.onload = function () {
          resolve(xhr.response)
        }
        xhr.onerror = function (e) {
          reject(new TypeError("Network request failed"))
        }
        xhr.responseType = "blob"
        xhr.open("GET", uri, true)
        xhr.send(null)
      })

      uploadImage(blob)
    }
  }

Upload the image to FireStore using the Blob, Function taken from FireBase documentation

import { ref, uploadBytesResumable, getDownloadURL } from "firebase/storage"
import { storage } from "../firebase"

const uploadImage = async (blob: Blob) => {
  const metadata = {
    contentType: "image/png",
  }

  // Upload file and metadata to the object 'images/mountains.jpg'
  const storageRef = ref(storage, "images/" + blob)
  const uploadTask = uploadBytesResumable(storageRef, blob, metadata)

  // Listen for state changes, errors, and completion of the upload.
  uploadTask.on(
    "state_changed",
    (snapshot) => {
      // Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded
      const progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100
      console.log("Upload is " + progress + "% done")
      switch (snapshot.state) {
        case "paused":
          console.log("Upload is paused")
          break
        case "running":
          console.log("Upload is running")
          break
      }
    },
    (error) => {
      // A full list of error codes is available at
      // https://firebase.google.com/docs/storage/web/handle-errors
      switch (error.code) {
        case "storage/unauthorized":
          // User doesn't have permission to access the object
          break
        case "storage/canceled":
          // User canceled the upload
          break

        // ...

        case "storage/unknown":
          // Unknown error occurred, inspect error.serverResponse
          break
      }
    },
    () => {
      // Upload completed successfully, now we can get the download URL
      getDownloadURL(uploadTask.snapshot.ref).then((downloadURL) => {
        console.log("File available at", downloadURL)
      })
    }
  )
}

Edit Protocol Workouts

Edit Protocol Workouts

Give the ability to:

  • Delete whole workout
  • Change/Delete exercises in workout
  • Change Reps/Sets in Workout
  • Access Exercise Database to change Exercises
  • Create New workouts within the edit workout section

Ability to Query Clients/Protocols

Basic Querying function

The ability of querying needs to be added to the Client tab and Protocol Tab.

This issue can be completed by:

  • Simple query searching. Example: search the letter "A" and every client with the letter "A" is listed
  • Filter list from A-Z and Z-A
  • Protocol: filter by injury
  • Protocol: filter by weeks, daysPerWeek'
  • Client: Filter by active status

Ability to quick view workout

Quick View workout feature

  • Ability to press a view button to quickly view the exercises/set/reps/description of a workout
  • Bring up Modal not a new page.
  • Click outside of Modal to exit
  • Test Workout Function #77

Protocol Workout Creation

Protocol creation/editing expansion

To complete this issue users must have the option to:

  • Create Individual Workouts within the Protocol, ideally a plus button would add a workout to the protocol.
  • Create Individual exercises within the workout. No limit to the exercises.
  • Add a description for the Exercises (for now keep sets and reps within the description)
  • Order of exercises for now does not matter, that will be a future issue

Re render bug Phases New Protocol Creation

Re-Render bug

An odd bug where around every 1 and 20 times creating phases does not automatically re render page. Phase still is created, just no feedback given to the user.

Add Phases

Add Phases within protocols

  • As of now you go straight to adding new workouts from the create/edit protocol screen.
  • Add an extra layer on to the Create/Edit protocol screen to allow user to create new phases and store the workouts in there
  • This is will require some changes to the database and code refactoring as it adds an extra layer as workouts will be a sub collection stored in the Phases sub collection of protocols.

Sorry future me I forgot to do this beforehand lol

Basic Client Side Navigation

Navigation for Client Side of application

  • Basic routing using React Navigation
  • This issue can be completed once the bottom tabs navigate correctly, all other routing is easy and comes with new features

Refractor Files/ File Structure

Clean up Files and File structure

  • Some Duplicate code within the code base that can just use 1 file not 2 files with similar code
  • File structure, moving some screens that I put into components into the screens folder

Add Loading Spinners

Loading indicators

  • When data is loading add spinners to indicate that the data is being fetched from the database

Protocol Null Client edit error

Edit Client error if Protocol is null

When a client has no protocol attached to their user and a Physician goes to edit their data, indexOf null error appears.

  • Add check to updateClientButton to fix the chance of IndexOf null crashing application

Test Workout Function

Test Workout

  • Ability to start a workout and run through as a Patient would

Checklist

  • First Work Out appears first
  • Next Button switches to the next workout
  • Workouts set complete when data is logged by user (reps/sets)
  • Activity Gauge meter, for User to set exercise toughness ex: Easy, Just Right, Hard
  • Add notes for each workout
  • When finished add notes for Physician

Create new exercises

Ability for Physician to create new exercises

  • Add a description and video, or images

Protocol Phases (edit protocol) Not updating on add

Protocol Phases not re rendering page

  • When adding Phases on the Edit Protocol Page they do not immediately show up unless user leaves page and comes back
  • Page re renders on the New Protocol Creation page when adding Phases
  • Inspected both pages and don't see any major differences with the re-rendering

Phases Card Styling Update

Styling Issue

The card for phases within the main Protocol tab view button on the widgets needs styling update. As of now the card renders but does not show any title and is all bugged. Figure it out StunnaDawg

Add Sets and Reps

Add Sets and Reps to exercises

Within a workout users should be able to add the desired number of sets and reps for select exercises

  • Create text input within exercise widget
  • Add into the initial Map of CategoryID, WorkoutID within exerciseData context within the create workout screen in exercise widget

Create Full Programs

Full Program creation

  • Allow users to add single phases within protocol
  • Creates 1 big Program that includes multiple phases
  • Example, ACL Rehab would include ACL Rehab 1, ACL Rehab 2, ACL Rehab 3 that could be multiple weeks to months

Create Documentation

Create README

  • Title and Logo (if any):

  • Project name and a brief description.

  • Introduction:

  • Brief description of what the app does.

  • Highlight the problem it solves or the need it addresses.

  • Screenshots/GIFs:

  • Showcase the app's functionality visually.

  • List of main features or functionalities in the app.

  • Features:

  • List of primary features or functionalities.

  • Configuration:

  • Essential details about configuration, especially if they pertain to internal tools, servers, or services.

  • Tech Stack:

  • Highlight the main libraries, frameworks, and tools utilized.

  • Deployment:

  • Details on how the app is deployed, any continuous integration/continuous deployment (CI/CD) processes, and relevant environment configurations.

  • Known Issues:

  • A list of known bugs or issues, especially if they are not yet tracked in an internal bug tracker.

Superset Functionality

Create Superset button function

  • Ability to add SuperSet to exercise widget
  • Adds new exercise within widget
  • If exercise is A1 then superset exercise would be A2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.