An awesome web application built with Node.js, Express, and MongoDB for you to readily manage your restaurant lists with an account: Create, view, edit, delete, filter, sort, and search restaurant are as easy as pie 🥧
Functions | Detail | URL |
---|---|---|
Sign up for an account | 1. User can sign up an account by inputting name, email, password 2. User can see warning message if required columns are empty or passwords inputted are incorrect 3. User can be redirected to login page and receive a warning message if the account inputted has been registered |
/users/register |
Log in with email | 1. User can log in using registered email | /users/login |
Log in with Facebook account | User can log in via Facebook with a Facebook account | /auth/facebook |
Log in with Google account | User can log in via Google with a Google account | /auth/google |
Log out | User can log out of an account | /users/logout |
View all restaurants | 1. User can view name, category, and rating of all restaurants after login 2. User can get an error message when no restaurant to display after login |
/ |
View a restaurant detail | 1. User can view restaurant name, category, address, description and image after login 2. User can see his or her name on the logo, "食客" will be displayed if name is not provided |
/restaurants/:id |
Create a restaurant | 1. User can add a new restaurant by inputting related info after login 2. User can get a placeholder image when image URL is not provided 3. User can get a warning message below corresponded column when submitting invalid info |
/restaurants/new |
Edit a restaurant | User can update detail info of a restaurant after login | /restaurants/:id/edit |
Delete a restaurant | 1. User can delete a restaurant after login 2. User can receive a warning message before actual delete |
/restaurants/:id/delete |
Search restaurants by input | User can search restaurants by inputting name or category after login | /search |
Search restaurants by category | User can search restaurants by choosing a given category after login | /search |
Pagination | User can see at most six restaurants on a page and travel among pages | /search |
Filter restaurants | 1. User can filter restaurant list based on rating range after login 2. User can see the amount of restaurants at each rating range on filter panel based on given search input after login |
/search |
Sort all restaurants | User can sort restaurants list by name, rating, or category based on given search input after login | /search |
Page not found | User can get an error message when travelling to a page not existing | /:any_other_URL |
The following instructions will get you a copy of the project and all the setting needed to run it on your local machine.
Clone this repository to your local machine
$ git clone https://github.com/smallpaes/restaurant-list-v3.git
-
Create a new App at https://developers.facebook.com/
-
Create a new project at https://console.developers.google.com/
-
Enter the project folder
$ cd restaurant-list-v3
- Install npm packages
$ npm install
- Create .env file
$ touch .env
- Store API Key in .env file and save
GOOGLE_ID=<YOUR_GOOGLE_APP_ID>
GOOGLE_SECRET=<YOUR_GOOGLE_APP_SECRET>
GOOGLE_CALLBACK=<YOUR_GOOGLE_REDIRECT_URI>
FACEBOOK_ID=<YOUR_FACEBOOK_APP_ID>
FACEBOOK_SECRET=<YOUR_FACEBOOK_APP_SECRET>
FACEBOOK_CALLBACK=<YOUR_FACEBOOK_REDIRECT_URI>
- Import user and restaurant seeds
$ cd models/seeds
$ node seeder.js
- Find the message for successful import
> db connected!
> restaurant seeds are created
- Activate the server
$ cd ../../
$ npm run dev
- Find the message for successful activation
> Express is listening on http://localhost:3000
> mongodb connected!
You may visit the application on browser with the URL: http://localhost:3000