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.
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 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!
- 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:
npm install
To install all the dependencies frompackage.json
.- In a terminal, run
npm build:w
to run the TypeScript compiler in watch mode. This will transpiler all the files and put them indist
directory every time you save a file. - In another terminal, run
npm start
to run the server.
- Run
swagger project edit
to open Swagger Editor in the browser. Make sure the server is running as well in a separate terminal window.
- Run
npm run debug
- 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.
- The following tutorials are a good start on how APIs are implemented in Swagger:
- Implement the server logic such as Google Maps API calss in the
server
directory.