Skip to content

Code for the Udacity's "Mobile Web Specialist Restaurant Reviews App" Project

Notifications You must be signed in to change notification settings

Voodu/MWS-Project

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mobile Web Specialist Certification Course


General

This repository contains source code of project required to complete Mobile Web Specialist Nanodegree from Udacity & Google. It combines all three stages of the project - fixing responsivness, accessibility, adding service worker and implementing whole offline support to create fully functional Progressive Web Application.

Local Development API server

Location of server = /server Server depends on node.js LTS Version: v6.11.2 , npm, and sails.js Please make sure you have these installed before proceeding forward.

Install project dependancies
# npm i
Install Sails.js globally
# npm i sails -g
Start the server
# node server

You should now have access to your API server environment

debug: Environment : development debug: Port : 1337

Endpoints

GET Endpoints

Get all restaurants

http://localhost:1337/restaurants/

Get favorite restaurants

http://localhost:1337/restaurants/?is_favorite=true

Get a restaurant by id

http://localhost:1337/restaurants/<restaurant_id>

Get all reviews for a restaurant

http://localhost:1337/reviews/?restaurant_id=<restaurant_id>

Get all restaurant reviews

http://localhost:1337/reviews/

Get a restaurant review by id

http://localhost:1337/reviews/<review_id>

Get all reviews for a restaurant

http://localhost:1337/reviews/?restaurant_id=<restaurant_id>

POST Endpoints

Create a new restaurant review

http://localhost:1337/reviews/
Parameters
{
    "restaurant_id": <restaurant_id>,
    "name": <reviewer_name>,
    "rating": <rating>,
    "comments": <comment_text>
}

PUT Endpoints

Favorite a restaurant

http://localhost:1337/restaurants/<restaurant_id>/?is_favorite=true

Unfavorite a restaurant

http://localhost:1337/restaurants/<restaurant_id>/?is_favorite=false

Update a restaurant review

http://localhost:1337/reviews/<review_id>
Parameters
{
    "name": <reviewer_name>,
    "rating": <rating>,
    "comments": <comment_text>
}

DELETE Endpoints

Delete a restaurant review

http://localhost:1337/reviews/<review_id>

Leaflet.js and Mapbox:

This repository uses leafletjs with Mapbox. You need to replace <your MAPBOX API KEY HERE> with a token from Mapbox. Mapbox is free to use, and does not require any payment information.
EDIT
Add file js/private.js and in it provide const MAPBOX_KEY = 'API KEY'; to make maps work.

Note about ES6

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. As much as possible, try to maintain use of ES6 in any additional JavaScript you write.

About

Code for the Udacity's "Mobile Web Specialist Restaurant Reviews App" Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 69.9%
  • CSS 15.4%
  • HTML 14.7%