Nodejs + Express + MongoDB + HTML5 + Heroku
- Web Development Project 2 : FoodieLand
- Project Objective : Apply the concepts learned in class by building a basic fullstack application with Nodejs, Express, javascript, MongoDB and HTML5. Deploy on Heroku.
- Build a network of community application called 'foodieLand' where people can dive into their favorite restaurants.
- Registered users submit content to the site such as links, text posts, images which are then voted stars by other members.
- Allowed user implement CRUD operations on it. The collections in the database would be based on the length from the user's current location and the numeric ranking of the chosen restaurant.
- User can login and sign up (sign out) account. @Yuan Wang
- User can add/delete restaurants with address, upload pictures, and write reviews. @Weihong Yang
- User can edit their profile reviews and rate by stars from scale 1 to 5. @Yuan Wang
- User can search profile to show the restaurant with related rating and comments. @Weihong Yang
- Class Link: https://johnguerra.co/classes/webDevelopment_fall_2022/
- Professor: John Alexis Guerra Gómez
- Release: Here to Start
- Demo: Video
At the db
folder, we have provided 2 JSON files to be used as a collection for the database.
- foodiehouse.json
- login.json
Before running the program we first need to create a local database.
Run the following command in your terminal to start local mongo server: mongod --dbpath ~/data/db
Keeping the local server running, open a new terminal and run the following to create nomadLocalDB database and import the given JSON files as collections:
- Projects collection
mongoimport -h localhost:27017 -d foodDB -c login --drop --jsonArray --file ./db/login.json
- Users collection
mongoimport -h localhost:27017 -d foodDB -c foodiehouse --drop --jsonArray --file ./db/foodiehouse.json
NOTE: In ./db/myMongoDB.js
make sure the global constant is saying DB_NAME = "foodDB"
, otherwise the program cannot find the local database.
Once the local database has been created, follow these steps to run locally:
- Run Mongo server:
mongod --dbpath ~/data/db
- Run client server:
npm start
- Using your browser go to localhost: http://locahost:3001/
$ git clone [email protected]:wyang10/Foodieland.git
$ npm start
- Main folders:
- db: Connections to databases and other operations.
- public: Static files. Include frontend javascript, html files and corresponding css files.
- routes: Backend javascript files.