A responsive and interactive Food Delivery Site designed to provide users with a seamless experience for browsing, ordering, and managing food deliveries.
-
User Authentication
- Sign up, log in, and secure authentication using tokens.
-
Dynamic Menu
- View a wide range of food items with details such as name, description, and price.
-
Cart Management
- Add, remove, and modify items in the cart.
- View total cost and item quantity.
-
Order Verification
- Verify and confirm orders after successful payment.
-
Order History
- Track past orders and view order details in the "My Orders" section.
-
Admin Panel
- Change and review the status of orders.
- View details of users who made orders.
-
Payment Integration
- Integration with payment gateway to process orders.
- React.js: For building the user interface.
- React Router: For seamless navigation.
- Axios: For API calls.
- CSS: For styling the application.
- Node.js: Server-side runtime environment.
- Express.js: Backend framework for API development.
- MongoDB: Database for storing user data, orders, and menu items.
- React.js: For creating an admin dashboard.
- Axios: For API communication.
- CSS: For styling the admin interface.
- Vite: Development server and build tool for React.
- Toastify: For notifications and alerts.
Ensure you have the following installed:
- Node.js (v14 or above)
- MongoDB
-
Clone the repository:
git clone https://github.com/your-username/food-delivery-site.git
-
Navigate to the project directory:
cd food-delivery-site
-
Install dependencies:
npm install
-
Set up the environment variables: Create a
.env
file in the root directory and add the following:PORT=4000 MONGO_URI=mongodb://localhost:27017/food-delivery JWT_SECRET=your_jwt_secret CLIENT_URL=http://localhost:5173
-
Start the backend server:
npm run server
-
Start the frontend:
npm run dev
-
Start the admin panel: Navigate to the
admin
folder and run:npm install npm start
-
Open the application in your browser:
http://localhost:5173
POST /api/auth/register
: Register a new user.POST /api/auth/login
: Log in a user.
GET /api/food/list
: Fetch the list of available food items.
POST /api/cart/add
: Add an item to the cart.POST /api/cart/remove
: Remove an item from the cart.POST /api/cart/get
: Retrieve the current cart data.
POST /api/order/verify
: Verify the order after payment.GET /api/order/list
: Fetch the list of past orders.GET /api/admin/orders
: Fetch all orders (Admin only).POST /api/admin/orders/update
: Update order status (Admin only).
food-delivery-site/
├── frontend/
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Navbar/
│ │ │ ├── Cart/
│ │ │ └── Order/
│ │ ├── pages/
│ │ │ ├── Home/
│ │ │ ├── Orders/
│ │ │ └── Verify/
│ │ ├── context/
│ │ │ └── StoreContext.js
│ │ ├── App.jsx
│ │ └── index.jsx
│ ├── package.json
├── backend/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ ├── server.js
│ └── package.json
├── admin/
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ └── App.jsx
│ ├── package.json
├── .env
└── README.md
- Add live order tracking.
- Implement user reviews and ratings.
- Support multiple payment methods.
- Mobile app integration.
This project is licensed under the MIT License.
Contributions are welcome! Feel free to open issues or submit pull requests.