A simple restaurant website built with Node.js and Express
- Register via email, Facebook, or Google account
- Login to see user's own restaurants
- Click the restaurant to check its details
- Search restaurants by name and category
- Sort restaurants by name, rating, category and location
- Create a restaurant with details autofilled by Google API
- Edit the details of a restaurant
- Delete a restaurant, come with a confirmation alert
-
Please make sure it is installed Node.js (skip if already install)
-
Open Terminal and Clone the project
git clone https://github.com/DannyHucc/my-restaurant-list.git
- Go to the folder where this project is stored
cd my-restaurant-list
- Install the required dependencies
npm install
- Install nodemon (skip if already install)
npm i -g nodemon
- Set environment variables in .env file according to .env.exp
mkdir .env
- Set
PORT(number) to start the server
PORT=<your port>
- MONGODB_URI: Go to MongoDB to create an account and set MongoDB Atlas to get
MONGODB_URIand modify the following parametersusername、password、database
MONGODB_URI=mongodb+srv://<username>:<password>@cluster0.ngwexuq.mongodb.net/<database>?retryWrites=true&w=majority
-
Install studio 3T to view and modify document data, build comprehensive queries, import and export data, among many other tasks
-
Set your
SESSION_SECRET(string)
SESSION_SECRET=<your secret>
- Facebook Login: You need to create an application on Facebook for Developers, and substitute the application ID and application secret into
FACEBOOK_IDandFACEBOOK_SECRETrespectively
FACEBOOK_ID=SKIP
FACEBOOK_SECRET=SKIP
- Facebook Login: set
Domain nameto use callback
FACEBOOK_CALLBACK=http://<Domain name>/auth/facebook/callback
- Google Login: You need to create an application on Google for Developers, and substitute the application ID and application secret into
GOOGLE_IDandGOOGLE_SECRETandGOOGLE_API_KEYrespectively and set domain name to use callback
GOOGLE_ID=SKIP
GOOGLE_SECRET=SKIP
GOOGLE_API_KEY=SKIP
- Google Login: set
Domain nameto use callback
GOOGLE_CALLBACK=http://<Domain name>/auth/google/callback
- Seed your database
npm run seed
- Execute successfully if seeing following message
mongodb connected!
done
restaurantSeeder done!
- Start the server
npm run dev
- Execute successfully if seeing following message
Express is listening on localhost:3000
mongodb connected!
- Now you can browse the website on
http://localhost:3000
- Test account
- name: user1
- email: user1@example.com
- password: 12345678
- name: user2
- email: user2@example.com
- password: 12345678
- Leave server
ctrl + c
- Runtime: node @ 14.16.0
- Framework: express @ 4.17.1
- Database: mongoose @ 5.9.7
- View Engine: express-handlebars @ 4.0.2
- Check package.json for other dependencies
DannyHucc 胡晉嘉


