A full-featured desktop application for managing restaurant operations — orders, reservations, menu, staff, and inventory.
Restoran is a desktop-based restaurant management system built with Java Swing and MySQL. It covers the full operational lifecycle of a restaurant — from taking orders and managing table reservations to tracking menu items, staff, and ingredient inventory.
The system features role-based access control, with business logic implemented entirely on the database layer through stored procedures, views, and triggers — ensuring a clean separation of concerns and consistent data integrity.
| Module | Description | Access |
|---|---|---|
| 🔐 Login | Secure authentication with role-based access | All |
| 📋 Orders | Create, view, add items, and close orders with automatic billing | All |
| 📅 Reservations | Manage table reservations and guest records | All |
| 🍕 Menu | Full CRUD for menu items and categories | All |
| 👥 Staff | Manage employees and roles | Manager only |
- Tables automatically change status (free / reserved / occupied) via database triggers
- Order total is automatically calculated with discount applied on close
- Ingredient stock is tracked — decremented on order, incremented on purchase
- New guests can be registered directly from the reservation form
- Managers have full access; waiters see only operational modules
restoran/
├── db/
│ └── DatabaseConnection.java # Singleton connection manager
├── model/
│ ├── Employee.java
│ ├── Item.java
│ ├── Order.java
│ ├── Reservation.java
│ ├── Customer.java
│ ├── LoggedUser.java # Session state
│ └── ...
├── dao/
│ ├── AuthDAO.java
│ ├── EmployeeDAO.java
│ ├── ItemDAO.java
│ ├── OrderDAO.java
│ └── ReservationDAO.java
└── ui/
├── LoginForm.java
├── MainWindow.java
├── OrderPanel.java
├── ReservationPanel.java
├── MenuPanel.java
└── EmployeePanel.java
Pattern: 3-layer architecture (Model → DAO → UI). No ORM — all database logic is handled through stored procedures and views, keeping the application layer thin and the data layer consistent.
_table · category · customer · discount · employee · ingredient · item · itemhasingredient · order · ordereditem · payment · paymenttype · purchase · purchaseitemingredient · reservation · role · shift · supplier · user_account
allaccounts · allcategories · allemployees · allingredients · allitems · allmenuitems · allorders · allpaymenttypes · allreservations · allsuppliers · freetables
| Trigger | Event | Effect |
|---|---|---|
trg_order_set_table_occupied |
INSERT on order |
Sets table → "occupied" |
trg_order_free_table |
UPDATE on order |
Sets table → "free" on payment |
trg_reservation_set_table_reserved |
INSERT on reservation |
Sets table → "reserved" |
trg_reservation_cancel_free_table |
UPDATE on reservation |
Sets table → "free" on cancel |
trg_purchase_update_stock |
INSERT on purchaseitemingredient |
Increments ingredient stock |
trg_ordereditem_decrease_stock |
INSERT on ordereditem |
Decrements ingredient stock |
login_user · get_all_employees · add_employee · update_employee · delete_employee · get_all_items · add_item · update_item · delete_item · create_order · add_item_to_order · close_order · get_all_orders · ordered_items_by_order_id · get_all_reservations · add_reservation · cancel_reservation · add_customer · get_all_customers · get_all_roles · add_category · add_ingredient
- Java JDK 17+
- MySQL Server 8.0+
- IntelliJ IDEA (or any Java IDE)
- MySQL Connector/J 8.x
git clone https://github.com/your-username/restoran.git
cd restoranmysql -u root -p < sql/01_restoran_ddl.sql
mysql -u root -p < sql/02_restoran_views_triggers_procedures.sql
mysql -u root -p < sql/03_restoran_testni_podaci.sqlEdit src/restoran/db/DatabaseConnection.java:
private static final String URL = "jdbc:mysql://localhost:3306/restoran?useSSL=false&serverTimezone=Europe/Sarajevo&allowPublicKeyRetrieval=true";
private static final String USERNAME = "root";
private static final String PASSWORD = "your_password";File → Project Structure → Libraries → + → Java → select mysql-connector-j-8.x.jar
Launch Main.java as the main class.
| Username | Password | Role | Access |
|---|---|---|---|
admin |
admin123 |
Manager | Full access |
marko |
marko123 |
Waiter | Orders, Menu, Reservations |
jelena |
jelena123 |
Waiter | Orders, Menu, Reservations |
Menu — authenticated user
Orders — authenticated user
Reservations — authenticated user
Login screen with guest preview option
| Layer | Technology |
|---|---|
| Language | Java 17 |
| UI Framework | Java Swing |
| Database | MySQL 8.0 |
| DB Connectivity | JDBC (MySQL Connector/J) |
| IDE | IntelliJ IDEA |
restoran/
├── sql/
│ ├── 01_restoran_ddl.sql
│ ├── 02_restoran_views_triggers_procedures.sql
│ └── 03_restoran_testni_podaci.sql
├── src/
│ └── restoran/
│ ├── db/
│ ├── model/
│ ├── dao/
│ ├── ui/
│ └── Main.java
└── README.md
AT95BL GitHub) · LinkedIn
MIT License — feel free to use, modify, and distribute.



