This documentation provides detailed instructions on how to set up, install, and configure a MERN (MongoDB, Express.js, React, Node.js) stack food website with Framer Motion. This website allows users to search for food, view recipes and cooking instructions, and save their favorite recipes to their accounts...
- Prerequisites
- Project Structure
- Setting up the Backend
- MongoDB Configuration
- Express.js Configuration
- Environment Variables
- Running the Application
- Usage
- Searching for Food
- Viewing Recipes
- Saving Recipes
- Contributing
- License
Before you proceed, ensure that you have the following prerequisites installed:
- Node.js and npm: Download and Install Node.js
- MongoDB: Download and Install MongoDB
- Git: Download and Install Git
mern-food-website/
├── backend/
│ └── ...
├── frontend/
│ └── ...
├── ...
└── README.md
- Navigate to the
backend
directory:cd backend
. - Install dependencies: Run
npm install
. - Create a
.env
file in thebackend
directory and add the following environment variables:
DB_CONECTION = your_mongodb_connection_string
PORT = 4000
MY_SECRET = Your_jwt_secret_phrase
Replace your_mongodb_connection_string
with your MongoDB connection string, and Your_jwt_secret_phrase
with a secret key for JWT authentication.
- Start the Express.js server: Run
npm start
.
-
Navigate to the
frontend
directory:cd frontend
. -
Install dependencies: Run
npm install
. -
Start the React frontend: Run
npm start
.
- Access the website at
http://localhost:3000
.
- On the homepage, use the search bar to search for food items.
- Click on a food item to view its details, including the recipe and cooking instructions.
- After searching for food, you can click on a food item to view its recipe and instructions.
- To save a recipe, you need to create an account and log in.
- Click the "Sign Up" button to create an account or the "Log In" button to log in.
- Once logged in, you can click the "Save" button on a recipe to save it to your account.
If you'd like to contribute to this project, please fork the repository, make your changes, and create a pull request.