លំហសិក្សាកម្ពុជា លំហសិក្សាកម្ពុជា V1.0
ចូល ចុះឈ្មោះ

UP intake 2 Assessment II

មូលសង្ខេប / Abstract

This project presents the design and implementation of a desktop-based Restaurant Management System developed using Python 3.11+, PyQt6, and SQLite3. Traditional manual ordering, paper-based billing, and unmonitored ingredient tracking in food service operations often lead to calculation discrepancies, order delays, and inventory shortages. To address these challenges, an event-driven architecture separates presentation layouts, business services, and database persistence layers. The software incorporates core modules: food and beverage catalog CRUD operations, real-time dining table status tracking, order line-item calculation (subtotal, VAT, and discounts), and transactional stock adjustments. System evaluation verified data persistence across relational tables and accurate execution of input validation safeguards and business calculations. The final deliverable provides small-to-medium restaurant establishments with an offline-capable, structured solution for operational workflows.

ពាក្យគន្លឹះ

FACULTY OF SCIENCE AND TECHNOLOGY

DEPARTMENT OF INFORMATION & COMMUNICATION TECHNOLOGY

COURSE PROJECT REPORT

ON

 DESIGN AND DEVELOPMENT OF RESTAURANT

MANAGEMENT SYSTEM

USING PYQT6 AND SQLITE3

COURSE: PYTHON PROGRAMMING II ACADEMIC YEAR: 2025–2026

SUPERVISED BY:

 Lecturer SEK SOCHEAT

 Faculty of Science and Technology

GROUP ASSIGNMENT

SIV Chong

LY Venghak

PHEARUM Dara


I: Introduction

1.1 Background of the Study

Food service establishments handle high volumes of rapid transactions, requiring fast coordination among table ordering, kitchen inventory consumption, and checkout billing. While computerized systems are standard in enterprise chains, small-to-medium restaurants often rely on manual paper tickets and basic spreadsheets. These methods introduce administrative overhead, slow down order fulfillment, and impede daily revenue tracking.

1.2 Problem Statement

Manual restaurant workflows present critical operational risks:

o   nefficient order entry that causes billing errors during peak operational hours.

o   Lack of real-time inventory monitoring and automated low-stock warnings for high-turnover ingredients.

o   Discrepancies in manual calculations of promotional discounts and statutory Value-Added Tax (VAT).

o   Absence of centralized local reporting for analyzing daily sales, top-selling menu items, and revenue.

1.3 Research Questions

o   How can an event-driven desktop interface be designed using PyQt6 to streamline restaurant table orders and menu CRUD management?

o   How can SQLite3 be structured with relational constraints to record line-item orders and automate stock deduction?

o   How can input validation and automated calculation services be implemented to eliminate billing inaccuracies?

1.4 Objectives

·       General Objective: Design, build, and test a standalone desktop Restaurant Management System using PyQt6 and SQLite3.

·       Specific Objectives:

o   Design a normalized SQLite3 relational database schema with referential integrity constraints.

o   Build responsive PyQt6 GUI windows using modular layouts (QVBoxLayout, QHBoxLayout, QGridLayout, QFormLayout).

o   Implement full CRUD functionality for menu items, categories, and dining tables.

o   Implement business services for VAT computation, bill discounts, and inventory deductions.

o   Verify operational accuracy via a test suite and validate system stability.

1.5 Scope and Limitations

o   In Scope: Local desktop application, menu catalog management, dine-in table status tracking, itemized receipt generation, stock deduction, and daily sales summaries.

o   Limitations: Standalone deployment (no multi-terminal cloud synchronization), local receipt rendering without external thermal printer drivers, and simulated offline payment processing.

II: Literature Review

2.1 Software Development Life Cycle (SDLC)

Software engineering standards emphasize structured methodologies to ensure software reliability and traceability. Following ISO/IEC/IEEE 12207:2017 guidelines, this project executes sequential development phases: requirement definition, architectural design, modular implementation, verification testing, and formal maintenance documentation.

2.2 Requirements Engineering

Following ISO/IEC/IEEE 29148:2018 standards, project features are divided into functional requirements (direct system behaviors) and non-functional requirements (integrity, usability, and speed). Rigorous validation guarantees that all user inputs pass strict boundary conditions before database execution.

2.3 GUI and Event-Driven Programming

Desktop applications utilize an event loop managed by QApplication.exec(), which continuously listens for OS-level inputs, hardware interrupts, and window redraw events. PyQt6 facilitates this via signals and slots: UI widgets emit typed signals (e.g., QPushButton.clicked, QLineEdit.textChanged) that invoke designated Python callable slots. Layout managers (QFormLayout, QGridLayout) provide adaptive UI scaling across varying monitor display resolutions without hardcoded coordinates.

2.4 SQLite3 Database Architecture

SQLite3 is an embedded, serverless, ACID-compliant transactional database engine directly accessible via Python’s standard sqlite3 module. Data integrity is enforced using primary keys, NOT NULL clauses, CHECK expressions, and explicit foreign key constraints (PRAGMA foreign_keys = ON;).

III: Methodology and System Design

3.1 System Architecture

The application uses a 3-tier architectural separation to maintain modularity, testability, and clear separation of concerns:

3.2 Database Schema & ERD Design


Database Schema Planning

Table Name

Primary Key

Foreign Keys

Key Columns & Constraints

Purpose

categories

category_id

None

name TEXT UNIQUE NOT NULL

Categorizes dishes (e.g., Appetizer, Main, Drink).

 

menu_items

item_id

category_id

price REAL CHECK(price >= 0), stock_qty INT DEFAULT 0

Stores restaurant food items and stock counts.

dining_tables

table_id

None

table_number TEXT UNIQUE, status TEXT DEFAULT 'Available'

Manages physical dining room capacity and table state.

orders

order_id

table_id

order_date TEXT, grand_total REAL NOT NULL

Stores finalized customer bills and tax summaries.

order_items

order_item_id

order_id, item_id

quantity INT CHECK(quantity > 0), line_total REAL

Stores individual line items per customer order.


IV: RESULTS, TESTING, AND EVALUATION

4.1 Implementation Artifacts & User Interface Walkthrough

The developed desktop application successfully establishes a responsive 3-tier event-driven architecture using PyQt6 for the presentation layer and SQLite3 for data persistence. The user interface is organized into distinct functional modules accessible via tabbed navigation: 

o   Menu Management View:

  • Features: Provides real-time filtering via a text input field (textChanged signal) linked directly to the catalog table, alongside comprehensive CRUD (Create, Read, Update, Delete) controls.
  • UI Integration: As shown in the management view, users can seamlessly select existing dishes (such as Caesar Salad, Ribeye Steak, Iced Lemon Tea, and Chocolate Lava Cake) to populate input fields for price, cost, and stock quantity updates. Referential integrity ensures categories (Appetizer, Main Course, Beverages, Desserts) maintain proper foreign key relationships.
       POS Orders & Calculation Engine
  • Features: Streamlines order creation by allowing operators to select catalog items, specify quantities, assign orders to active dining tables, and compute billing metrics in real time.
  • Calculation Workflow: The embedded business logic service automatically computes the Subtotal, applies percentage-based Discounts, calculates statutory VAT (10.00%), and evaluates the final Grand Total while preventing non-negative balance boundary violations. 
Dining Tables Module
  • Features: Tracks physical seating capacity and real-time operational states (Available, Occupied) across restaurant tables.
  • UI Integration: Administrators can view table status IDs, table numbers, and seating capacities, and add new dining tables dynamically through form inputs. 

4.2 System Test Cases & Results Matrix

Test ID

Module / Feature

Test Condition / Input

Expected System Output

Actual Result

Verdict

TC-01

Database Init

Launch main.py when data/restaurant.db is missing

 

Auto-creates SQLite schema and tables with foreign key constraints

DB file generated with complete schema

PASS

TC-02

Menu Item Entry

Insert "Ribeye Steak", Price: $24.50, Stock:

nserts row into menu_items; table refreshes immediately

Item appears in catalog table

PASS

TC-03

Duplicate Validation

Re-insert existing unique name "Ribeye Steak"

Rejects insertion and triggers duplicate error dialog

Warning displayed; duplicate prevented

PASS

TC-04

Search & Filter

Type "Sal" into the catalog filter input

Catalog updates to show matching items (e.g., Salmon, Salad)

Instant table filter on textChanged

PASS

TC-05

Record Update

Select row, change Price to $28.00, click Update

Database record is updated via parameterized query

 

Price reflects in DB and UI table

PASS

TC-06

Deletion Guard

Select item, trigger Delete, click "Yes" on QMessageBox

Removes item from SQLite and clears selection state

Record removed cleanly

PASS

TC-07

Financial Logic

Subtotal: $100.00, Discount: 10%, Tax:

Discount = $10.00, Taxable = $90.00, Tax = $9.00, Total = $99.00

Computed exactly as $99.00

PASS

TC-08

Boundary Guard

Pass Discount: 120% into calculation service

Raises ValueError and prevents invalid computation

UI halts with error dialog

PASS


4.3 Evaluation of System Performance & Integrity

  • ACID Compliance & Data Persistence: Transaction management via Python’s sqlite3 driver successfully maintained data integrity across relational tables (categories, menu_items, dining_tables, orders, and order_items). Enforced foreign key constraints (PRAGMA foreign_keys = ON;) prevented orphaned order records.
  • UI Responsiveness: The integration of PyQt6 layout managers (QVBoxLayout, QHBoxLayout, QGridLayout, QFormLayout) ensured adaptive scaling across standard monitor displays without hardcoded pixel coordinates. Event loops handled asynchronous user interactions smoothly during peak test operations. 

V: Conclusion and Future Work

5.1 Fulfillment of Project Objectives

The developed Restaurant Management System satisfies all engineering requirements specified in Chapter I:

o   A modular 3-tier architecture isolates PyQt6 GUI components from SQLite3 transactional logic.

o   Relational database tables enforce domain integrity constraints (CHECK, UNIQUE, foreign keys).

o   Real-time search and CRUD forms allow staff to maintain catalog records and stock counts.

o   Financial calculation services automate tax and promotional deductions without calculation drift.

5.2 System Limitations

o   Standalone offline deployment restricts operation to a single terminal.

o   Kitchen Display System (KDS) integration and automated network printing are not implemented in this baseline.

5.3 Future Work

o   Integrate a local network socket layer or cloud backend for multi-station synchronization across the ordering counter and kitchen.

o   Add automated ESC/POS thermal printing integration for receipt generation.

o   Introduce Role-Based Access Control (RBAC) to restrict menu pricing adjustments to managerial accounts.

References

·        [1] IEEE Author Center, "IEEE Reference Guide," IEEE, 2025. [Online]. Available: IEEE Author Center.

·        [2] ISO/IEC/IEEE, ISO/IEC/IEEE 12207:2017 Systems and Software Engineering — Software Life Cycle Processes, Geneva, Switzerland: ISO, 2017.

·        [3] ISO/IEC/IEEE, ISO/IEC/IEEE 29148:2018 Systems and Software Engineering — Life Cycle Processes — Requirements Engineering, Geneva, Switzerland: ISO, 2018.

·        [4] The Qt Company, "Signals and Slots - Qt for Python Documentation," Qt Documentation, 2026.

·        [5] Python Software Foundation, "sqlite3 — DB-API 2.0 Interface for SQLite Databases," Python 3.11 Documentation, 2026.

·        [6] SQLite Consortium, "SQLite Foreign Key Support & ACID Transactions," SQLite Documentation, 2026.

·        [7] I. Sommerville, Software Engineering, 10th ed., Boston, MA, USA: Pearson, 2016.

·        [8] R. S. Pressman and B. R. Maxim, Software Engineering: A Practitioner's Approach, 9th ed., New York, NY, USA: McGraw-Hill, 2020. 

ចែករំលែក
រក្សាទុក
ការផ្សព្វផ្សាយ
ការផ្សព្វផ្សាយ
មតិយោបល់ 0
ចូលគណនី ដើម្បីបញ្ចេញមតិ