/admin directory of the monorepo, but it shares the same Node.js/Express backend as the customer-facing frontend — all API calls go to the same server.
Architecture Overview
The admin app is a standalone React + Vite application. It connects to the backend via theurl constant defined in App.jsx:
The backend URL is hardcoded to
http://localhost:3000 in admin/src/App.jsx. Update this value to your production backend URL before deploying the admin panel.Pages and Routes
Add Food Item
/add — Upload an image and fill in item details to add a new dish to the menu.All Foods List
/list — Browse every item in the catalogue and remove items that are no longer available.Orders
/orders — View all customer orders and advance each order through its delivery lifecycle.Add Food Item
The/add page lets operators upload a new dish to the menu. The form submits as multipart/form-data to POST /api/food/add.
Form Fields
Category Options
The category dropdown is populated with these exact values:Submission Flow
backend/uploads/. The image is then served at /images/<filename>.
Food List
The/list page calls GET /api/food/list on mount and renders a table of all items currently in the catalogue.
Table Columns
Deleting a Food Item
Clicking the X button callsPOST /api/food/remove with { id: foodId }:
removeFood in foodController.js first retrieves the document to get the image filename, then removes the file from disk before deleting the MongoDB document:
Orders
The/orders page provides a live view of every order placed through the customer app. It calls GET /api/order/list on mount to load all orders.
Order Card Contents
Each order card displays:- Item list —
item.name × item.quantityfor every item in the order, comma-separated - Customer name —
address.firstName + " " + address.lastName - Delivery address — street, then city / state / country / zipcode on the next line
- Phone number —
address.phone - Item count — total number of distinct items
- Order total —
$<amount>
Updating Order Status
A<select> dropdown on each card reflects the current status and lets operators move it forward:
POST /api/order/status with { orderId, status }: