A restaurant dine-in food ordering system developed using Java and MySQL. The project allows customers to place food orders, generate bills, and provides administrative functionality for managing orders.
This project implements a Soft Delete mechanism for completed orders, preserving historical data while keeping active order records clean and manageable.
- User Registration and Authentication
- Food Menu Management
- Order Placement
- Bill Generation
- Order History Management
- Admin Dashboard
- Soft Delete Implementation for Completed Orders
- Java
- MySQL
- JDBC
- Object-Oriented Programming (OOP)
food/
services/
utils/
main.java
Instead of permanently deleting completed orders from the database, this project uses a soft delete approach.
A dedicated flag is used to mark completed orders as deleted. These orders are hidden from active order listings while still remaining stored in the database.
- Preserves order history
- Prevents accidental data loss
- Simplifies auditing and reporting
- Allows future recovery of records if required
- Java JDK 8 or later
- MySQL Server
- MySQL Connector/J JDBC Driver
- Eclipse IDE (or any Java IDE)
-
Clone or download this repository.
-
Open the project in Eclipse or any Java IDE.
-
Create a MySQL database.
-
Create the required tables for:
- Users
- Orders
- Admin
CREATE TABLE users (
uid INT PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(100) NOT NULL
);CREATE TABLE orders (
order_id INT PRIMARY KEY AUTO_INCREMENT,
uid INT NOT NULL,
item_names VARCHAR(500) NOT NULL,
total DOUBLE NOT NULL,
ordered_at DATETIME DEFAULT CURRENT_TIMESTAMP,
deleted TINYINT DEFAULT 0,
FOREIGN KEY (uid) REFERENCES users(uid)
);CREATE TABLE admin (
aid INT PRIMARY KEY AUTO_INCREMENT,
admin_name VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(100) NOT NULL
);- Add MySQL Connector/J to the project build path.
- Right-click the project.
- Click Build Path.
- Select Configure Build Path.
- Open the Libraries tab.
- Click Add External JARs.
- Select the MySQL Connector/J
.jarfile. - Click Apply and Close.
Update the database credentials inside:
utils/DBConnection.java
Example:
String url = "jdbc:mysql://localhost:3306/food_ordering_system";
String user = "root";
String password = "your_password";Ensure MySQL Server is running before starting the application.
Run:
main.java
- Amay Raj Srivastav
- Anjali Singh
- Aakriti Gupta
- Abhishek Goyal
- Anushka Rai
- Table Management System
- Inventory Tracking
- Online Payment Integration
- Multiple User Roles
- Order Status Tracking
- Sales Reports and Analytics
If you have any queries or you face any difficluty in cloning the repo and running the project then feel free to ask. Our team is always there to respond you asap.