This project is the continuation of Restaurant Reviews Stage 2 by taking the responsive, accessible, and offline first design built in Stage 1 and 2 and add additional functionalities. There is a form to allow users to create their own reviews. If the app is offline, the form will defer updating to the remote database until a connection is established. Finally, the site is optimized to meet performance benchmarks tested using Lighthouse.
- Make sure to have sailsjs and nodejs installed
- Clone this repository
- Run
npm install
to install all dependencies - Run
sails lift
in root folder to start local server - Navigate to frontend folder and run
gulp
- Site is served on localhost:3000
curl "http://localhost:1337/restaurants"
curl "http://localhost:1337/restaurants/{3}"
Local server
- Node.js
- Sails.js
- Brandy Lee Camacho - Technical Project Manager
- David Harris - Web Services Lead
- Omar Albeik - Frontend engineer
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.
Great, you are ready to proceed forward; awesome!
Let's start with running commands in your terminal, known as command line interface (CLI)
# npm i
# npm i sails -g
# node server
debug: Environment : development debug: Port : 1337
http://localhost:1337/restaurants/
http://localhost:1337/restaurants/?is_favorite=true
http://localhost:1337/restaurants/<restaurant_id>
http://localhost:1337/reviews/?restaurant_id=<restaurant_id>
http://localhost:1337/reviews/
http://localhost:1337/reviews/<review_id>
http://localhost:1337/reviews/?restaurant_id=<restaurant_id>
http://localhost:1337/reviews/
{
"restaurant_id": <restaurant_id>,
"name": <reviewer_name>,
"rating": <rating>,
"comments": <comment_text>
}
http://localhost:1337/restaurants/<restaurant_id>/?is_favorite=true
http://localhost:1337/restaurants/<restaurant_id>/?is_favorite=false
http://localhost:1337/reviews/<review_id>
{
"name": <reviewer_name>,
"rating": <rating>,
"comments": <comment_text>
}
http://localhost:1337/reviews/<review_id>
If you find a bug in the source code or a mistake in the documentation, you can help us by submitting an issue to our Waffle Dashboard. Even better you can submit a Pull Request with a fix :)