This project is a full-stack web application that allows users to share and discover recipes. Users can create accounts, log in, add their own recipes, save recipes they find interesting, and view detailed information about each recipe. The application provides a platform for users to connect with each other through their shared love of cooking.
- User Authentication: Secure user registration and login functionality.
- Recipe Creation: Users can add their own recipes with details like ingredients, quantities, and images.
- Recipe Discovery: Browse and search for recipes shared by other users.
- Save Recipes: Save favorite recipes to a personal collection.
- Detailed Recipe View: View comprehensive information about each recipe, including ingredients and instructions.
- User Profiles: View and manage personal profile information.
- Protected Routes: Authenticated users only can access certain routes.
- Frontend:
- React
- React Router DOM
- Vite
- react-toastify
- CSS (Bootstrap classes and inline styles)
- Backend:
- Node.js
- Express
- Mongoose
- jsonwebtoken
- bcryptjs
- cors
- body-parser
- Database:
- MongoDB Atlas
- Build Tool:
- Vite
- Node.js (v16 or higher)
- npm or yarn
- MongoDB Atlas account
-
Clone the repository:
git clone <repository_url> cd <repository_name>
-
Install backend dependencies:
cd Api npm install
-
Configure backend environment variables:
- Create a
.env
file in theApi
directory. - Add the following environment variables:
MONGODB_URI=<your_mongodb_connection_string> JWT_SECRET=!@#$%^&*() PORT=3000
Replace
<your_mongodb_connection_string>
with your MongoDB Atlas connection string. - Create a
-
Install frontend dependencies:
cd ../Client npm install
-
Start the backend server:
cd Api npm start
The server will start on port 3000 (or the port specified in your
.env
file). -
Start the frontend development server:
cd ../Client npm run dev
The frontend will be accessible at
http://localhost:5173
(or the port specified by Vite).
├── Api/
│ ├── Models/
│ │ ├── Recipe.js
│ │ ├── SavedRecipe.js
│ │ ├── User.js
│ ├── controllers/
│ │ ├── recipe.js
│ │ ├── user.js
│ ├── middlewares/
│ │ ├── auth.js
│ ├── routes/
│ │ ├── recipe.js
│ │ ├── user.js
│ ├── server.js
│ ├── package.json
│ └── ...
├── Client/
│ ├── src/
│ │ ├── components/
│ │ │ ├── AddRecipe.jsx
│ │ │ ├── Detail.jsx
│ │ │ ├── Home.jsx
│ │ │ ├── Login.jsx
│ │ │ ├── Navbar.jsx
│ │ │ ├── Profile.jsx
│ │ │ ├── Register.jsx
│ │ │ └── Saved.jsx
│ │ ├── context/
│ │ │ ├── App_State.jsx
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ ├── index.css
│ │ └── ...
│ ├── public/
│ │ └── vite.svg
│ ├── vite.config.js
│ ├── package.json
│ └── ...
├── .gitignore
├── README.md
└── ...
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your fork.
- Submit a pull request to the main repository.
If you have any questions or suggestions, feel free to contact me at [Your Email].