A console-based restaurant order management system, developed in C++ with SQLite database, a Strategy-pattern loyalty program, and a colorful UI.
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.
You don't need to compile the code! Download the latest portable version for Windows:
Note: Place sqlite3.dll in the same folder as the executable.
- 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
- Dynamic Membership Levels: Normal → Silver → Gold → VIP, each with its own discount, shipping cost, and points multiplier — implemented with the Strategy design pattern (
MembershipLevelbase 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)
| 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 |
RestaurantSystem/
├── include/ # Header files (.h)
├── src/ # Source files (.cpp)
├── database/ # SQLite database
└── main.cpp # Entry point
- C++ compiler (GCC/MinGW)
- SQLite3 library
# 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_appg++ -o food_app.exe main.cpp src/*.cpp src/sqlite3.c -I include -static-libgcc -static-libstdc++| 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 |
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 interfaceNormalLevel,SilverLevel,GoldLevel,VIPLevel— concrete strategies, each overriding the behavior for its tierCustomerholds a singleMembershipLevel*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.
| 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 | Meaning |
|---|---|
| 🟢 Green | Success |
| 🔴 Red | Errors |
| 🔵 Blue | Information |
| 🟡 Yellow | Menus |
