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.sql
In terminal, run the following:
mysql -u root -pStrongPassword123! restoran -e "
CREATE OR REPLACE VIEW allemployees AS
SELECT e.id, e.name, e.email, e.phone, e.salary,
e.Role_id AS role_id,
r.name AS role_name
FROM employee e
JOIN role r ON e.Role_id = r.id;"Edit 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
Andrej TroΕΎiΔ Software Developer specializing in Backend Systems & Infrastructure
MIT License β feel free to use, modify, and distribute.



