Skip to content

AT95BL/Restaurant-Organization-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍽️ Restoran β€” Restaurant Management System

A full-featured desktop application for managing restaurant operations β€” orders, reservations, menu, staff, and inventory.

Java MySQL Swing Status


πŸ“‹ Overview

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.


✨ Features

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

Business Logic Highlights

  • 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

πŸ—οΈ Architecture

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.


πŸ—„οΈ Database

Tables (19)

_table Β· category Β· customer Β· discount Β· employee Β· ingredient Β· item Β· itemhasingredient Β· order Β· ordereditem Β· payment Β· paymenttype Β· purchase Β· purchaseitemingredient Β· reservation Β· role Β· shift Β· supplier Β· user_account

Views (11)

allaccounts Β· allcategories Β· allemployees Β· allingredients Β· allitems Β· allmenuitems Β· allorders Β· allpaymenttypes Β· allreservations Β· allsuppliers Β· freetables

Triggers (6)

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

Stored Procedures (20+)

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


πŸš€ Getting Started

Prerequisites

1. Clone the repository

git clone https://github.com/your-username/restoran.git
cd restoran

2. Set up the database

mysql -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;"

3. Configure the connection

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";

4. Add MySQL Connector/J to IntelliJ

File β†’ Project Structure β†’ Libraries β†’ + β†’ Java β†’ select mysql-connector-j-8.x.jar

5. Run

Launch Main.java as the main class.


πŸ”‘ Default Accounts

Username Password Role Access
admin admin123 Manager Full access
marko marko123 Waiter Orders, Menu, Reservations
jelena jelena123 Waiter Orders, Menu, Reservations

Screenshots

Menu β€” authenticated user

Menu

Orders β€” authenticated user

Orders

Reservations β€” authenticated user

Reservations

Login screen with guest preview option

Login


πŸ› οΈ Tech Stack

Layer Technology
Language Java 17
UI Framework Java Swing
Database MySQL 8.0
DB Connectivity JDBC (MySQL Connector/J)
IDE IntelliJ IDEA

πŸ“ Project Structure

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

πŸ‘€ Author

Andrej Trožić Software Developer specializing in Backend Systems & Infrastructure

LinkedIn
GitHub
Portfolio


πŸ“„ License

MIT License β€” feel free to use, modify, and distribute.

About

A desktop application for managing restaurant operations, built with Java Swing and MySQL.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages