Skip to content

Commit

Permalink
added to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Salazar committed Jan 25, 2017
1 parent 234677c commit 6cbaa37
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,34 @@

This project is my solution to the Simple Habit interview challenge to build a simple topic recommender based on data they sent me.

## Demo

[simplehabitrecommender.herokuapp.com](http://simplehabitrecommender.herokuapp.com)

## Usage

Go to `http://simplehabitrecommender.herokuapp.com/recommendations?subtopic=XYZ` where the `subtopic` is the ID of one of the topics in `lib/subtopics.json`. You will receive either an HTML page or JSON response depending on how the request is fired.
Go to `http://simplehabitrecommender.herokuapp.com/recommendations?subtopic=X` where **X** is the ID of one of the topics in `[lib/data/subtopics.json](https://github.com/DiegoSalazar/simple_habit_recommender/blob/master/lib/data/subtopics.json)`. You will receive either an HTML page or JSON response depending on how the request is fired.

To receive JSON do either:

**Browser**

Add `.json` to the end of the `/recommendations` part of the URL e.g. `http://simplehabitrecommender.herokuapp.com/recommendations.json?subtopic=X

To receive JSON run:
Or run this command in the:

**Terminal**

```bash
curl -H"ACCEPT: application/json" http://simplehabitrecommender.herokuapp.com?recommendations?subtopic=XYZ
curl -H"ACCEPT: application/json" http://simplehabitrecommender.herokuapp.com/recommendations?subtopic=X
```

## How I solved the challenge

I created a Rails App to utilize its db tools to load the data from the two json files in `lib/data`. I designed the data relational data schema to define the relationship between the Sub Topics, Listens, and Users. I then wrote I SQL query with some Ruby post processing to display the top four recommendations for sub topics that users who also listened to the queried sub topic have also listened to.

I then added HTML and styling to display the data and query interface in a neat little app on Heroku.

## Challenge Instructions

For this exercise, we want to be able to build a simple recommendation engine for Simple Habit meditators. To do this, we’ve included a list of all the meditations that have been completed by users on our site — this file is called ‘listens.json’. The format of this file is a JSON array that contains objects that contain three properties:
Expand Down

0 comments on commit 6cbaa37

Please sign in to comment.