លំហសិក្សាកម្ពុជា
V1.0
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 |
| Stores restaurant food items and stock counts. |
| table_id | None |
| Manages physical dining room capacity and table state. |
orders | order_id | table_id |
| Stores finalized customer bills and tax summaries. |
order_items | order_item_id |
|
| 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:
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: | nserts row into | 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 | Catalog updates to show matching items (e.g., Salmon, Salad) | Instant table filter on | PASS |
TC-05 | Record Update | Select row, change Price to | 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 | Removes item from SQLite and clears selection state | Record removed cleanly | PASS |
TC-07 | Financial Logic | Subtotal: | Discount = | Computed exactly as | PASS |
TC-08 | Boundary Guard | Pass Discount: | Raises | UI halts with error dialog | PASS |
4.3
Evaluation of System Performance & Integrity
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.
· [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