Food Hub System
A layered Java web app for ordering food online - JSP and Servlets over a MySQL schema, with separate customer and employee roles.
Why it exists
Food Hub behaves like an online grocery-pickup service: a customer orders food without ever walking a store aisle, while staff manage what's in stock and who has an account - the same split most real ordering platforms are built around.
It was also a deliberate exercise for COE692 in a specific engineering discipline: a strict layered architecture where each tier only ever talks to the one directly beneath it - the GUI never touches the database, the database never renders a page. That constraint is the whole point of the stack below.
A request's path through the stack
Four layers, each only talking to the one directly below it - a classic enterprise-Java shape, built to keep the web pages, the request handling, the data objects, and the database each in their own lane.
GUIHTML / JSP
BusinessServlets
AssistanceDTOs
PersistenceCRUD classes
MySQL4 tables: Customer, Employee, FoodItem, ShoppingCart
Two roles, one system
A customer can
- Browse the catalog of available food items
- Add items to a shopping cart
- Check out - available stock is deducted automatically
An employee can
- Create, update, or delete food items in the catalog
- Create, update, or delete customer and employee accounts
- View the full customer list and current inventory
The data model
Four tables, designed as an ER model before a line of SQL was written. Customer and Employee share the same login shape; ShoppingCart is really an order line, referencing a Customer and a FoodItem together.
Customer
PK: CustomerID
Employee
PK: EmployeeID
FoodItem
PK: FoodItemID
ShoppingCart
PK: CustomerID + FoodItemID
Built with a partner for COE692, split across the four layers above so each person could own a piece of the stack. Two small rules do a lot of the real work: placing an order deducts the quantity ordered from that item's available stock, and each cart line's total price is computed as price times quantity rather than stored redundantly.