Note: * You will only need docker installed on your computer to run this app
- Fork Branch
- Open terminal and clone forked branch:
git clone https://github.com/<YOUR USERNAME>/recommendation.git
- Go inside point-system directory:
cd recommendation
- Add upstream repo:
git remote add upstream https://github.com/fcgl/recommendation.git
- Confirm that you have an origin and upstream repos:
git remote -v
This build should work for both macOS and Linux
- Download docker for your operating system
- From project root run the following commands:
- Build And Run:
docker-compose up --build
- Build And Run:
Confirm everything was ran correctly by going to the following endpoint: * http://localhost:5000/health/v1/marco
TODO: Automate this so the process is automatically ran every 24 hours
Logic:
- Endpoint
user_recommendation/v1/toggle
is ran every 24 hours - The endpoint runs a process that inserts UserRecommendation objects into the database.
The UserRecommendation objects hold a list of Product Ids. The UserRecommendation Id's are
referenced in the User object
- Initially the user is given recommendations based on what's popular
- As we get more data we will turn on our recommendation process which gives more user specific recommendations
- When the user opens up the application an API request will be made to
endpoint
user_recommendation/v1
to get the products recommended to the user
- Make an api request to
http://localhost:5000/dev/v1/populate_data
- This will populate your database with 2 Users and 3 Products. This is enough to test the generic version of the recommendation system (based on popularity)
- To toggle the recommendation process make an API request to
http://localhost:5000/user_recommendation/v1/toggle
- To see a user's recommendation make an api request to
http://localhost:5000/user_recommendation/v1?userId=1
(Where userId can be the id of any user in the database)