CSE323 · Customer Ordering subsystem — a Flask web app where customers browse the menu, place orders, and track delivery; staff manage orders, the catalog, and fulfillment.
- Overview
- Screenshots
- Features
- Tech stack
- Architecture
- Quick start
- Environment variables
- Roles & demo accounts
- Demo mode (order tracking)
- Promo codes
- Project structure
- API overview
- Known limitations
- Related docs
AURA is a layered Routes → Services → Repositories → Models application:
| Role | What they do |
|---|---|
| Customer | Firebase sign-up/login, menu, cart, checkout, order history, tracking, profile & rewards |
| Admin | Dashboard, order status updates, menu CRUD-style management |
| Delivery | Pick up READY orders and advance to OUT_FOR_DELIVERY → DELIVERED |
Payment is recorded in the database (no live payment gateway). Card data stores last four digits only.
First time setup: If images do not show on GitHub, run
COPY_SCREENSHOTS.batonce (copies PNGs from your Downloads folder intodocs/screenshots/).
| Menu & categories | Product details |
![]() |
![]() |
| Shopping cart (dark mode) | Checkout |
![]() |
![]() |
| Order tracking (live timers) | Profile & preferences |
![]() |
|
| Notifications | |
![]() |
| Admin dashboard | Admin orders |
![]() |
![]() |
| Order detail & status | Menu management |
![]() |
![]() |
| Delivery dashboard | |
![]() |
- Browse menu by category, search, and open product pages (reviews, wishlist when logged in)
- Session cart: add / update quantity / remove / special requests
- Checkout: saved addresses, phone, instructions, card or cash on delivery
- Pricing: promo or voucher, $5 delivery, 8% tax, free-delivery progress on cart
- Order lifecycle with 4-stage tracking and per-stage elapsed timers
- In-app notifications on status changes
- Profile: edit details, dietary preferences, saved cards & addresses, AURA Rewards
- KPI dashboard (orders, revenue, catalog counts)
- Filter orders by status; open order detail and update status
- Edit menu items, stock, and availability toggle
- Filter orders: ready → out for delivery → delivered
- One-click status advance from the delivery dashboard
- Customers: Firebase (email verification)
- Staff: local password hash (Werkzeug)
- RBAC via
@role_required()—customer,admin,delivery,chef
| Layer | Technology |
|---|---|
| Backend | Flask 3, SQLAlchemy 2, Flask-Login, Flask-Migrate, Flask-WTF |
| Database | SQLite (instance/app.db) — override with DATABASE_URL |
| Auth | Firebase Admin + Identity Toolkit (customers) |
| Frontend | Jinja2, custom CSS (style.css, admin.css), vanilla JS |
| UI extras | Tailwind CDN on cart & order-tracking pages; light/dark theme toggle |
| Tooling | pytest, coverage (see requirements.txt) |
Routes (blueprints) → Services (business rules) → Repositories → Models
Blueprints registered in app/__init__.py: auth, main, customer, order, admin, delivery, profile, notifications, pages.
- Python 3.10+
- pip
- Firebase project (for customer register/login) — see SETUP.md
git clone <your-repo-url>
cd Customer-Ordering-System
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS / Linux
pip install -r requirements.txtCreate .env (see Environment variables), then:
python seed.py
set SEED_DEV_STAFF=1 # Windows CMD — optional admin/delivery users
python seed.py
python run.pyProduction: gunicorn wsgi:app
Screenshots are stored under docs/screenshots/. To copy from C:\Users\TECHNO\Downloads:
COPY_SCREENSHOTS.bat
# or: powershell -File scripts/copy_screenshots.ps1| Variable | Required | Description |
|---|---|---|
SECRET_KEY |
Recommended | Flask session secret |
DATABASE_URL |
No | Default SQLite; use Postgres/MySQL URI in production |
FIREBASE_WEB_API_KEY |
For customers | Firebase Web API key |
FIREBASE_CREDENTIALS |
For Firebase Admin | Path to service account JSON |
WTF_CSRF_SECRET_KEY |
No | CSRF secret if CSRF is enabled |
SEED_DEV_STAFF |
No | Set to 1 when running seed.py to create dev staff users |
After SEED_DEV_STAFF=1 python seed.py:
| Account | Password | Role |
|---|---|---|
aura_admin |
AdminPass!123 |
Admin |
aura_delivery |
DeliveryPass!123 |
Delivery |
Customers register through Firebase (email verification). Use your own test account for screenshots and demos.
Auto-advance the timeline for presentations (mutates DB — use test orders only):
http://127.0.0.1:5000/order/order/<id>/track?demo=1
Restart from the beginning:
http://127.0.0.1:5000/order/order/<id>/track?demo=1&restart=1
| Setting | Value |
|---|---|
| Interval | 10 seconds per stage |
| Flow | CONFIRMED → PREPARING → READY → DELIVERED |
| Manual step | “Force next stage” in the demo panel |
| API | POST /api/order/<id>/advance |
Applied at checkout (validated in CheckoutService):
| Code | Discount | Min. order |
|---|---|---|
SAVE10 |
10% | — |
AURA20 |
20% | $30 |
SPRING15 |
15% | $25 |
Vouchers and referral codes are also supported via the rewards system (app/constants/rewards.py).
Customer-Ordering-System/
├── app/
│ ├── __init__.py # Application factory
│ ├── models/ # SQLAlchemy models
│ ├── repositories/ # Data access
│ ├── services/ # Business logic
│ ├── routes/ # Blueprints
│ ├── templates/ # Jinja2 HTML
│ ├── static/css/ # Global & admin styles
│ └── constants/ # Promos, rewards, roles
├── config.py
├── run.py # Dev server
├── wsgi.py # Production entry
├── seed.py
├── requirements.txt
├── SETUP.md # Firebase setup
├── docs/screenshots/ # README images
└── scripts/copy_screenshots.ps1
| Area | Examples |
|---|---|
| Auth | POST /auth/register, POST /auth/login, GET /auth/logout |
| Customer | /customer/menu, /customer/cart, /customer/checkout, /customer/orders |
| Order | GET /order/order/<id>/track, POST /api/order/<id>/advance |
| Admin | /admin/, /admin/orders, /admin/menu |
| Profile | /profile, /api/addresses, /api/cards, /api/rewards/redeem |
| Notifications | /notifications, /api/notifications |
Most JSON endpoints require login. See route modules under app/routes/ for full detail.
- No real payment processor (payments stay PENDING)
- Chef role exists; no dedicated kitchen display UI yet
product_bproute module exists but is not registered in the factory- End-to-end browser tests (e.g. Playwright) not included in this repo
- Demo mode changes real order rows — do not use on production data
- SETUP.md — Firebase configuration
- schema.sql — legacy SQL reference (ORM models are authoritative)
| Name | ID |
|---|---|
| Mona Mohamed | 120230016 |
| Mariam Gamal Elsayed | 120230012 |
| Nancy Ahmed | 120230045 |
| Marisia Micheal | 120230233 |
| Kirolos Khairy Shawkey | 120230237 |










