An online food ordering platform with a React frontend and a Spring Boot backend. Browse categories, manage menu items, add to cart, and place orders β all in one place.
- Frontend: React 19, React Router, Bootstrap 5, React Toastify
- Backend: Java 17, Spring Boot 3.5, Spring Data JPA
- Database: MySQL 8+
backend/β Spring Boot APIfrontend/β React app (Create React App)
- Java 17
- Node.js 18+ and npm
- MySQL 8+
- Database (MySQL)
- Create a database named
Eatzy. - Update credentials in
backend/src/main/resources/application.properties(or set your own):
spring.datasource.url=jdbc:mysql://localhost:3306/Eatzy
spring.datasource.username=YOUR_USER
spring.datasource.password=YOUR_PASSWORD
spring.jpa.hibernate.ddl-auto=update- Backend (Spring Boot)
Windows PowerShell:
cd backend
./mvnw.cmd spring-boot:runmacOS/Linux:
cd backend
./mvnw spring-boot:run- Default URL:
http://localhost:8080 - CORS is enabled for all origins.
- Frontend (React)
cd frontend
npm install
npm start- App runs at
http://localhost:3000 - The frontend expects the backend at
http://localhost:8080
- Register and log in from the UI.
- Add items to cart and place an order.
- Visit admin routes under
/adminto manage categories, menu, and orders.
- User (Customer):
- Can browse categories and menu without logging in
- Must log in to add items to cart, view cart, or check orders
- Admin:
- Manage categories, menu items, and orders via
/admin
- Manage categories, menu items, and orders via
- Browse and discover: Category list and menu grid with Veg/Non-Veg badges and prices
- Search and sort: Search by name and sort by price (low to high, high to low)
- Cart: Add, increment/decrement quantity, remove items, view total, place order
- Orders: View your orders; list auto-refreshes periodically
- Admin tools: CRUD for categories and menu items, view all orders
Base URL: http://localhost:8080
-
π Auth & Users
POST /registerβ Register a user (body:UserJSON)POST /login-userβ Login with{ email, password }
-
π·οΈ Categories
POST /add-categoryβ Create category (body:Category)GET /get-categoryβ List categoriesPUT /update-category/{categoryId}β Update categoryDELETE /delete-category/{categoryId}β Delete category
-
π Menu Items
POST /add-menu-item/{categoryId}β Create item in category (body:MenuItem)GET /get-menu-itemsβ List all itemsGET /get-menu-item/{id}β Get item by idPUT /update-menu-item/{menuItemId}β Update itemDELETE /delete-menu-item/{menuItemId}β Delete item
-
π Cart
POST /add-to-cart?userId&menuItemId&quantityβ Add to cartGET /get-cart-itemsβ List all cart itemsPUT /update-cart?cartId&quantityβ Update quantityDELETE /delete-cart?cartIdβ Remove from cart
-
π¦ Orders
POST /place-order?userIdβ Place order (body:List<OrderRequestDTO>)GET /get-orders/{userID}β Orders by userGET /get/ordersβ All orders (admin)PUT /update-order-status?orderId&statusβ Update statusDELETE /delete-order?orderIdβ Delete order
- Schema is auto-managed via
spring.jpa.hibernate.ddl-auto=update. - To change backend port, add
server.port=8081inapplication.properties.
Pull requests are welcome. Please open an issue for major changes to discuss what youβd like to change.
This project is for educational/demo purposes. Add a license if you intend to distribute.