Code Monkey home page Code Monkey logo

remy's Introduction

Remy

Remy is a service that provide restaurant recommendations to users based on their eating preferences. It learns about its users by using some basic information like their prefered food, price range, and their transportation method, and also by studying their actions on the client side on how they interact with each search result to try and improve future results.

This repo contain the backend server of the service. Any client can talk to the server through the API implemented.

Development Environment

The backend of Remy is written in Node.js (TypeScript & JavaScript) and MySQL.

Tools to install

  • Node.js
  • An IDE like Visual Studio Code, Visual Studio Community 2015 or Web Storm

Get a Google Places Web Services API key

  • Get an API Key by following the instructions here.
  • Once you get your Key, add it to the GOOGLE_MAPS_API_KEY variable in .env. DO NOT commit that key with any code changes!

Running the server

Set environment configuration

  • Create a new file named .env and add the following values in it:
GOOGLE_MAPS_API_KEY='YOUR_API_KEY'
DB_USER='DB_USERNAME'
DB_PW='DB_PASS'
DB_HOST='DB_HOST' # localhost if running a local MySQL server
DB_PORT='3306' # default port number
  • cd to the directory of the repo and run the following from a terminal:
  1. npm install To install all the dependencies from package.json.
  2. In a terminal, run npm build:w to run the TypeScript compiler in watch mode. This will transpiler all the files and put them in dist directory every time you save a file.
  3. In another terminal, run npm start to run the server.

To edit the API specs in Swagger Editor TODO, doesn't work

  • Run swagger project edit to open Swagger Editor in the browser. Make sure the server is running as well in a separate terminal window.

To print extra debuging info

  • Run npm run debug

Description of modules used

  • The API specs are defined using Swagger Specs. Swagger Node and Swagger Tools are used to validate the API requests and display the API docs.

Resources

Implementation Guide

  • Implement the server logic such as Google Maps API calss in the server directory.

remy's People

Contributors

yohanna avatar owenwestland avatar

Watchers

James Cloos avatar  avatar Victor Mimo avatar

remy's Issues

Add support for logging in

  • Create a POST /account/login that takes an email and password to login
  • Return User's ID when logging in successfully

Store user actions

  • We need to record user events and actions on the android app to provide better personalized results to the users.

Info Collected

  1. What restaurants user clicked on (expanded their info)
  2. Which restaurants user wanted their direction
  3. Most recent search results
  4. Time stamps of actions

Tasks

  • Add new API specs for the information
    • API for Most recent search API
    • API for User actions
  • Create required tables in the DB to store the new information
    • User Actions table
    • Recent searches table
  • [ ] User Search Results Table
    • [ ] Store the search result generated after applying users analytics
  • [ ] Provide a method to query the Search Results table for analytics

Notes

  • Consider creating a table to store restaurants info and another to store actions performed by user and on what restaurant.
  • User Search results will be queried internally only (i.e. does not need an API for it)
  • Need to create a function that takes a place_id and returns its details as you would get from placesNearby()

Sample JSON

// Search Results Table, also used for to fetch most recent results
// The table would need to have an ID column to indicate which restaurants were part of the same search
// PK can be (user_id, timestamp)
{
  user_id: "",
    restaurants: [
      {
        restaurant: "",
        restaurant_rank: ""
      }
    ]
  timestamp: ""
}

// An alternative to the SearchResults table
// PK (user_id, restaurant_id, timestamp)
// That way we can query it by user_id & restaurant_id
{
  user_id: "",
  restaurant_id: "",
  restaurant_rank: "", // restaurant place on the list
  timestamp: ""
}


// User Actions Table
// Type of actions: click, directions, more_info
// PK can be (user_id, restaurant_id, timestamp)
{
    user_id: "", // User who made the action
    restaurant_id: "",
    actions: "", // enum of click, directions, more_info
    timestamp: "" // of action
}

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.