Skip to content

About

A restaurant system manager.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

69 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍽️ Restaurant Order Manager

Project Preview

A console-based restaurant order management system, developed in C++ with SQLite database, a Strategy-pattern loyalty program, and a colorful UI.

📝 Description

A complete restaurant management system developed for the Advanced Programming course. Features three user roles (Customer, Manager, Admin), full database persistence using SQLite, a dynamic customer loyalty/membership system, and an intuitive color-coded console interface.

📥 Download (Ready to Run)

You don't need to compile the code! Download the latest portable version for Windows:

👉 Download Latest Release

Note: Place sqlite3.dll in the same folder as the executable.

✨ Features

Core (Phase 1)

  • Three User Roles: Customer, Manager, System Admin with different access levels
  • Shopping Cart: Add/Remove items, real-time price calculation
  • Order Management: Place orders, track status, view history
  • Menu Management: Managers can add/remove food and drink items
  • System Reports: Admin can view sales statistics and user activity
  • Database Persistence: All data saved to SQLite (survives restart)
  • Colorful UI: ANSI color codes for better user experience
  • Input Validation: Robust error handling for all user inputs

Loyalty & Membership System (Phase 2)

  • Dynamic Membership Levels: Normal → Silver → Gold → VIP, each with its own discount, shipping cost, and points multiplier — implemented with the Strategy design pattern (MembershipLevel base class)
  • Loyalty Points: Customers earn points on every successful order and lose them on cancellation
  • Automatic Level Up / Downgrade: Levels are upgraded automatically as points accumulate, and can be downgraded automatically (or by the Admin) after a period of customer inactivity
  • Order Cancellation & Refund: Managers can cancel orders, which automatically reverses the earned loyalty points
  • Monthly Coupons: Silver/Gold/VIP customers automatically receive discount coupons every month based on their level
  • User Badges: Earn badges like Frequent Buyer, Loyal Customer, Big Spender, and Night Customer based on order history
  • Level Change History: Every level change (up or down) is logged and viewable by the System Admin
  • Detailed Invoice: Full price breakdown at checkout (base price, discount, shipping cost, points earned)

🛠️ Technologies Used

Technology Purpose
C++17 Core language
SQLite3 Database
OOP Classes, inheritance, polymorphism
DAO Pattern Database abstraction
Strategy Pattern Membership level behavior (discount, shipping, points multiplier)
STL Vectors, strings, maps

📁 Project Structure

RestaurantSystem/
├── include/          # Header files (.h)
├── src/              # Source files (.cpp)
├── database/         # SQLite database
└── main.cpp          # Entry point

🚀 How to Run (For Developers)

Prerequisites

  • C++ compiler (GCC/MinGW)
  • SQLite3 library

Compilation

# Clone the repository
git clone https://github.com/EHSBIZ/Restaurant-Order-Manager.git

# Compile
g++ -o food_app main.cpp src/*.cpp -I include -lsqlite3

# Run
./food_app

Windows (Static Build - No DLL)

g++ -o food_app.exe main.cpp src/*.cpp src/sqlite3.c -I include -static-libgcc -static-libstdc++

👥 User Roles

Role Access
Customer Browse restaurants, order food, manage cart, view order history, track loyalty level/points, view coupons and badges
Manager Manage menu, view/update orders, cancel orders
Admin Add restaurants, system reports, adjust user points/levels, view level change logs, run inactivity downgrade check

🎯 Design Pattern: Strategy

Membership level behavior (discount percentage, shipping cost, points multiplier) is implemented using the Strategy pattern instead of scattered if/else chains:

  • MembershipLevel — abstract base class defining the shared interface
  • NormalLevel, SilverLevel, GoldLevel, VIPLevel — concrete strategies, each overriding the behavior for its tier
  • Customer holds a single MembershipLevel* pointer and swaps it at runtime as the customer's points change

This follows the Open/Closed Principle: adding a new tier (e.g. PlatinumLevel) only requires a new class — no existing code needs to change.

🗄️ Database Schema

Table Purpose
restaurants Restaurant information
users User accounts, roles, loyalty points & current membership level
items Menu items (food/drink/other)
orders Order headers, including price breakdown and points earned
order_items Items per order
level_history Log of every membership level change (upgrade/downgrade)
coupons Discount coupons issued to Silver/Gold/VIP customers

🎨 Color Coding

Color Meaning
🟢 Green Success
🔴 Red Errors
🔵 Blue Information
🟡 Yellow Menus

About

A restaurant system manager.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages