A Java-based, console-driven Restaurant Management System designed to automate restaurant operations such as table booking, order management, kitchen processing, and billing. The system leverages multithreading, synchronization, file-based persistence, and a producer-consumer architecture to simulate real-world restaurant workflows while supporting concurrent users.
Traditional restaurant operations often rely on manual processes for table reservations, order handling, and billing, leading to delays, booking conflicts, and poor customer experience. This project modernizes restaurant management by providing:
- Real-time table booking
- Concurrent booking conflict handling
- Menu browsing and order placement
- Multithreaded waiter and chef workflow
- Order status tracking
- Automatic table release after checkout
- Shared table availability across multiple application instances
The system follows a layered architecture consisting of:
- View Layer
- Service Layer
- DAO Layer
- Model Layer
- Concurrency Workers
- View all restaurant tables
- Display seating capacity and availability
- Book tables instantly
- Prevent double booking
- Automatic table release after checkout
- Shared availability across multiple terminals
-
Browse menu items
-
View:
- Item Name
- Price
- Preparation Time
- Available Quantity
- Add multiple items to cart
- Specify quantities
- Place orders after table booking
- Associate orders with specific tables
- Orders submitted to centralized order queue
- Waiter threads forward orders to kitchen
- Chef threads process orders concurrently
- Simulated preparation time
- Real-time status updates
- Checkout enabled only after all orders are prepared
- Bill generation support
- Table automatically released after payment
- Multi-customer table booking
- Producer-consumer order processing
- Thread-safe kitchen queue
- File locking for table reservation consistency
Customer
│
▼
Customer Console (View Layer)
│
▼
Service Layer
│
├── DAO Layer
│ ├── Table Storage (File)
│ └── Order Storage (Memory)
│
└── Concurrency Pipeline
│
▼
Order Dispatcher
│
▼
Waiter Threads
│
▼
Kitchen Queue
│
▼
Chef Threads
restaurant-management-system/
│
├── model/
│ ├── MenuItem.java
│ ├── OrderItem.java
│ ├── Order.java
│ ├── OrderStatus.java
│ └── Table.java
│
├── dao/
│ ├── TableDAO.java
│ └── OrderDAO.java
│
├── service/
│ ├── BookingService.java
│ ├── OrderService.java
│ └── KitchenService.java
│
├── worker/
│ ├── OrderDispatcher.java
│ ├── WaiterWorker.java
│ └── ChefWorker.java
│
├── view/
│ └── CustomerConsole.java
│
├── data/
│ └── tables.json
│
└── Main.java
Represents a menu item.
Attributes
- id
- name
- price
- prepTime
Represents a menu item with quantity.
Attributes
- MenuItem
- quantity
PLACED
IN_PROGRESS
PREPAREDRepresents a customer order.
Attributes
- orderId
- tableId
- items
- status
Functions
- getTotalPrepTime()
- markPrepared()
Represents a restaurant table.
Attributes
- tableId
- capacity
- available
Functions
- lock()
- release()
Handles persistent table storage.
Responsibilities
- Read table data
- Save updates
- Lock tables
- Release tables
Methods
getAllTables()
lockTables()
releaseTables()
saveToFile()Handles in-memory order storage.
Methods
saveOrder()
getOrdersByTable()
updateOrderStatus()Responsible for reservation logic.
Methods
bookTables()
releaseTables()Coordinates complete order lifecycle.
Responsibilities
- Create order
- Save order
- Submit to dispatcher
- Return confirmation
Handles kitchen operations.
Responsibilities
- Maintain kitchen queue
- Start chef workers
- Update order status
- Process completed orders
Thread-safe queue receiving customer orders.
BlockingQueue<Order>Acts as the entry point for incoming orders.
Waiter threads continuously:
- Pick order from dispatcher
- Mark as IN_PROGRESS
- Forward order to kitchen queue
Chef threads continuously:
- Consume orders
- Simulate cooking time
- Mark order as PREPARED
Multiple customers may attempt to reserve the same table.
To avoid race conditions:
- Table information is stored in a shared file
- File locking is used
- Booking operation is synchronized
Example:
Customer A -> Book Table 1
Customer B -> Book Table 1
Result:
Customer A -> Success
Customer B -> Table Already Booked
The kitchen workflow follows a Producer-Consumer model.
Customer
│
▼
Order Dispatcher
│
▼
Waiter Workers (Producer)
│
▼
Kitchen Queue
│
▼
Chef Workers (Consumer)
Benefits:
- High scalability
- Thread safety
- Efficient order handling
- Realistic restaurant simulation
PLACED
│
▼
IN_PROGRESS
│
▼
PREPARED
- Customer books table
- Customer places order
- Order enters dispatcher queue
- Waiter picks order
- Order forwarded to kitchen
- Chef prepares order
- Status updated to PREPARED
- Customer requests checkout
- Table released
The system validates:
- Invalid table IDs
- Already booked tables
- Non-numeric input
- Invalid menu selections
- Invalid quantities
- Empty cart checkout
- Empty order placement
Tables are stored in a shared file:
[
{
"tableId": 1,
"capacity": 4,
"available": true
}
]- Multiple application instances share data
- Real-time table availability
- Booking consistency
- File-locking support
- Java
- OOP Principles
- Collections Framework
- Multithreading
- ExecutorService
- BlockingQueue
- File I/O
- JSON Persistence
- Producer-Consumer Pattern
This project demonstrates practical implementation of:
- Object-Oriented Design
- Layered Architecture
- Multithreading
- Synchronization
- Producer-Consumer Pattern
- ExecutorService
- File-Based Persistence
- Concurrent Programming
- Thread-Safe Data Structures
- Real-Time Workflow Simulation
- GUI using JavaFX or Swing
- Database integration (MySQL/PostgreSQL)
- REST APIs using Spring Boot
- Admin Dashboard
- Online Reservations
- Payment Gateway Integration
- Notification System
- Analytics Dashboard
- Inventory Management
- Customer Loyalty Program
1. Customer enters restaurant
2. Views available tables
3. Books Table 3
4. Browses menu
5. Adds:
- Pizza x2
- Coke x2
6. Places order
7. Waiter forwards order
8. Chef prepares food
9. Status becomes PREPARED
10. Customer requests checkout
11. Bill generated
12. Table released
Restaurant Management System Java Console-Based Concurrent Restaurant Operations Simulator
Developed as an academic project to demonstrate real-world usage of Java concurrency, synchronization, layered architecture, and producer-consumer design patterns.