tusmanakhter / MigrantHub

MIT License
4 stars 3 forks source link

167 another feature for recommendations #271

Closed miramarhaba closed 5 years ago

miramarhaba commented 5 years ago

167

In this pr, nothing has changed directly from the user's perspective in the interface or in the workflow, the recommendations will just be more accurate because they are also factoring in the user's age as well, instead of just previous service ratings.

TESTING STEPS To test locally, you can run the two microservices separately in Visual Studio and test them.

  1. Authenticate your local command line of choice to the storage bucket by setting the google application credentials environment variable to the path to the key.json that we will give you:
    • Mac/Linux Example: export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/key.json"
    • Windows Powershell: $env:GOOGLE_APPLICATION_CREDENTIALS="C:\Users\username\Downloads\key.json"
    • Windows Command Prompt: set GOOGLE_APPLICATION_CREDENTIALS=C:\Users\username\Downloads\key.json
  2. Run the script that uploads your local db information to the storage bucket. The script can be found in server > db > generateMLData.js, and can be run with node generateMLData.js. Make sure you run it in the command line that you authenticated!
  3. With visual studio (different from visual studio code), run microservice 1 (Service_Rating_Model) to create the model of your data
  4. With visual studio, run microservice 2 and make a call to it with a RESTful client like Insomnia or Postman to get 3 recommendations for a specific user. The get call is as follows: localhost:{somePort}/api/recommendation/{userID}/{userAge}. You should see 3 recommendations along with their percentages returned.

The demo steps on the site once things are hosted would be to log in and look at the "Recommended Services" section, where there should be recommendations for the user.