A Java desktop application for managing canteen orders. CafeOrd provides a modern, user-friendly interface for placing orders, logging in securely, and viewing detailed order summaries. The system uses Java Swing for the interface and MySQL for database storage.
- Login Interface: Secure login system for users, with stored credentials in MySQL.
- Interactive Menu: Select items, adjust quantities, and see price calculations in real-time.
- Order Summary: View selected items with total cost, shown before finalizing the order.
- Database Integration: Users, orders, and items are stored in a MySQL database for persistent data handling.
Before running the application, make sure you have:
- Java Development Kit (JDK) version 8 or higher.
- MySQL Database installed and configured with the canteen schema.
- MySQL Connector for Java to establish database connections.
git clone https://github.com/your-username/CanteenManagementSystem.git
cd CanteenManagementSystem
- Launch MySQL and create a new database for the project.
- Run the following commands to create the required tables:
CREATE DATABASE canteen_db; USE canteen_db;
CREATE TABLE user ( id INT PRIMARY KEY AUTO_INCREMENT, username VARCHAR(50) UNIQUE, password VARCHAR(50) );
- Open
CanteenManagementSystem.java
. - Update database credentials in the
connectDatabase()
method:
String url = "jdbc:mysql://localhost:3306/canteen_db";
String user = "root";
String password = "your_password";
javac CanteenManagementSystem.java
java CanteenManagementSystem
- Login: Enter username and password to access the system.
- Browse Menu: Select items, adjust quantities, and see calculated costs.
- Place Order: Review your order and submit for processing.
CafeOrd/
├── src/
│ └── CanteenManagementSystem.java
└── README.md
- Java Swing for user interface design.
- MySQL Connector to connect Java to the MySQL database.
- Role-based Access: Separate views for customers and staff.
- Order History: Save past orders and allow users to view them.
- Enhanced UI: Add more customization and theme options.