recipe-app-demo.mp4
To run this project, ensure you have:
Open a terminal and run:
git clone https://github.com/C22380473/webdevproject
cd webdevprojectfolderRun the following command to install the required Node.js packages:
npm install express express-session mongodb mongoose nodemon bcryptWindows: Open the Services app, find MongoDB, and click Start.
macOS/Linux: Open a terminal and run:
brew services start mongodb-communityIf you installed MongoDB manually, start it with:
mongod --dbpath /path/to/your/dataUsing MongoDB Compass:
- Open MongoDB Compass and connect to your MongoDB instance.
- Create a new database named recipeApp.
- Inside recipeApp, create two collections: recipes and users.
Using MongoDB Shell:
use recipeApp
db.createCollection("recipes")
db.createCollection("users")Using MongoDB Compass:
- Open MongoDB Compass.
- Import the recipeApp.recipes.json file into the recipes collection.
- Import the recipeApp.users.json file into the users collection.
Using MongoDB Shell:
mongoimport --db recipeApp --collection recipes --file recipeApp.recipes.json --jsonArray
mongoimport --db recipeApp --collection users --file recipeApp.users.json --jsonArrayNavigate to the controller folder and start the server:
cd controller
nodemon server.jsOnce the server is running, open your browser and visit: http://localhost:8080
- Ensure MongoDB is running before starting the application.
- The recipeApp database must contain both recipes and users collections with the appropriate data imported.
- If you face any issues, double-check your MongoDB setup and imported data.
- See the MongoDB Installation Guide for troubleshooting.