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
.envfile in theApidirectory. - Add the following environment variables:
MONGODB_URI=<your_mongodb_connection_string> JWT_SECRET=!@#$%^&*() PORT=3000Replace
<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 startThe server will start on port 3000 (or the port specified in your
.envfile). -
Start the frontend development server:
cd ../Client npm run devThe 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].