Skip to content

cwaku/restaurant-review-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Front End Developer Nanodegree Course


Restaurant Review App

How to run?

Using Python:

  1. Clone or download the ZIP

  2. To run the app you need a simple HTTP server to serve up the site files on your local computer. Python has some simple tools to do this, and you don't even need to know Python. For most people, it's already installed on your computer.

  3. In a terminal, check the version of Python you have: python -V. If you have Python 2.x, cd into the project home directory and spin up the server with python -m SimpleHTTPServer 8000 (or some other port, if port 8000 is already in use.) For Python 3.x, you can use python -m http.server 8000. If you don't have Python installed, navigate to Python's website to download and install the software.

  4. Navigate to the js directory, open the dbhelper.js file and change the port to your preferred port, with your server running, visit the site: http://localhost:8000. Don't forget to replace the port in the address with whatever port you have chosen.

    Using Node.js live-server:

  5. Type npm install -g live-server in your terminal to install live-server.

  6. cd to directory

  7. Start live-server by entering live-sever in the terminal

  8. Open localhost:8080 in a browser.

Restrictions:

This app uses service worker to cache the resources needed to render this site. I have not used any build tool to compile my js. So right now there is no way to automatically update the service worker when you make changes to your scripts. You have to manually update the myCache variable in serviceworker file(sw.js), each time you make updates to your scripts. Feel free to use a build tool when your make changes to the code base.

Dependencies:

This repository uses leafletjs with Mapbox. You need to replace the api keys in the main.js and restaurant_info.js files with a token from Mapbox. Mapbox is free to use, and does not require any payment information.

Feel free to check out the app here.

Note:

Most of the code in this project has been written to the ES6 JavaScript specification for compatibility with modern web browsers and future proofing JavaScript code.