By: Rebecca Ahn, Angeline Hui, Teresa Liang, Nathan Pietrantonio
- Download or Clone the repo
- Navigate into
backend/recommendation
- Run:
pip install -r requirements.txt
- Optional: create and source Python virtual environment
- Run:
python recommendation_api.py
- Leave this running in the background, this service hosts the backend recommendation API
- Download the env.json (TODO: FIX)
- Move the env.json file to the health-habitat/src/api directory
NOTE: A Mac with Xcode and Xcode CLI tools is required to compile and run the app
- Change into the health-habitat directory:
cd health-habitat
- Install dependencies
npm install
npx expo install
npx expo install react-native-health
(sometimes must be installed individually)npx expo install expo-location
(sometimes must be installed individually)
- Compile the app
npx expo run:ios
- Quit the expo UI in terminal
- Install Xcode "pods"
cd ios
pod install
(may need to run twice)
- Double-click healthhabitat.xcworkspace to open in Xcode
- On the left, select "healthhabitat"
- Click on "Signing and Capabilities" in the center pane
- Select a team (personal user)
- Click the "trash bin" icon next to "Push Notifications" (not allowed for non-paying Apple Developers)
- Click "+" icon in top right of window
- Add HealthKit permissions
- Under "healthhabitat" on the left, navigate to
healthhabitat/healthhabitat/info.plist
- Add the following rows to
info.plist
(right click -> add row), and add a string (length > 12) for the value of eachPrivacy - Health Share Usage Description
Privacy - Health Update Usage Description
Privacy - Location Always and When In Use Usage Description
Privacy - Location When In Use Usage Description
Privacy - Location Always In Use Usage Description
- Save Xcode (cmd + s)
- Recompile the app: (from
/health-habitat
)npx expo run:ios
- Start development server:
npx expo start
- Press
i
to open IOS simulator, allow Health Habitat to install - Enjoy!
- Terrarium
- After logging in, users are presented with a "terrarium" which slowly "dies" over time if they do not keep their health score above pre-determined values
- Health Score
- The health score is a rounded value reprsented by ((Diet Score + Meditation Score + Exercise Score) / 3)
- This score represents the user's "overall" scoring and it slowly decreases over time as the scores in each category decrease
- The user can complete tasks in each category to increase this score, but doing tasks in one category can only get, at most, 1/3 of this overall score
- Recommendation Categories
- Each of these categories has a score which decreases with time. This score can be increased throughout the day by completing the recommended tasks in each.
- Diet Recommendations
- Diet recommednations use the Spoonacular API to recommend a recipe to make
- Meditation Recommendations
- Meditation uses a Random Forest Classifier to recommend a music genre to meditate to. This cateogry then filters down to one song, and recommends a location to meditate at based off of user context
- Exercise Recommendations
- Exercise uses a Gradient Boosting Regressor to recommend an intensity level of exercise to complete. A final exercise recommendation is then made based off of user context and a user model. This user model incorporates data about the user's previous exercise behavior, the equipment they have, and their access to a gym