This is a web application for ordering food from a restaurant. Users can browse the menu, add items to their cart, and place orders. The application is built using React for the frontend and Node.js with Express for the backend.
- Browse the menu: Users can view the available dishes on the menu.
- Add to cart: Users can add items to their cart for ordering.
- Place an order: Users can place orders for the selected items in their cart.
- Order summary: After placing an order, users can view the order summary, including the list of dishes, total amount, and delivery time.
- Clone the repository:
git clone https://github.com/sainRaghuveer/Online-Food-Ordering-System.git
- Install all dependencies in both directories client and server
cd backend
npm install
cd frontend
npm install
- Set up the backend:
- Rename the .env.example file to .env.
- Configure the environment variables in the .env file, including the database connection details and any other necessary configurations.
- Set up the frontend:
-
Open the frontend/src/config.js file.
-
Update the API_URL variable with the appropriate URL for your backend server.
-
Start the application:
-
Start the backend server:
npm run server
- Start the frontend development server:
npm start
Note:
- Before doing anything first create
.env
file and putport
,mongoURl
.> port
is for listening the server.>mongoURl
is for running database and store your data in database so put your mongo link.>
The application will be accessible at http://localhost:3000.
- /backend: Contains the server-side code.
METHOD | ENDPOINT | DESCRIPTION | STATUS CODE |
---|---|---|---|
POST | /api/register | This endpoint should allow users to register. | 200 |
GET | /api/login | This endpoint should allow users to login. | 200 |
GET | /api/dish | This endpoint should allow users to view the all dished present in database. | 200 |
POST | /api/dish | This endpoint should allow users Admin to post new dish. | 200 |
POST | /api/order | This endpoint should allow users to post order. | 200 |
POST | /api/cart | This endpoint should allow users to add food in cart. | 200 |
GET | /api/cart | This endpoint should allow getting all cart data. | 200 |
DELETE | /api/cart | This endpoint should allow users delete cart data | 200 |
PATCH | /api/cart/:id | This endpoint should allow users update quantity | 200 |
- /frontend: Contains the client-side code.
- Frontend: React.js, Chakra UI
- Backend: Node.js, Express
- Database: MongoDB