Skip to content

Yohanna/Remy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.