DBS Project | FAST NUCES Karachi
Group Members: Daanial Tejani (24K-0671), Bazil Uddin Khan (24K-0559), Abdul Manan (23K-0829)
- Register & login with secure password hashing
- Browse restaurants and menus (grouped by category)
- Search for food items
- Add items to cart, adjust quantities
- Checkout with Cash on Delivery or Online payment
- Track order status in real time
- Dashboard with stats (customers, orders, revenue)
- View and manage all orders (update status)
- View customer list
- View restaurant list
- Enable/disable menu items
- 9 normalized tables (1NF, 2NF, 3NF compliant)
- Foreign keys with CASCADE rules
- Triggers for auto-updating order totals and restaurant ratings
- Views for order summaries, revenue reports, popular items
- Advanced SQL queries (JOINs, GROUP BY, HAVING, aggregates)
| Layer | Technology |
|---|---|
| Frontend | HTML5, CSS3, Bootstrap 5, JS |
| Backend | Python 3 + Flask |
| Database | MySQL (schema provided) |
| Fonts | DM Sans, Playfair Display |
| Icons | Bootstrap Icons |
pip install flask werkzeugcd food_ordering
python app.pyThe app will start at http://localhost:5000
| Role | Email / Username | Password |
|---|---|---|
| Customer | bazil@example.com | pass123 |
| Customer | daanial@example.com | pass123 |
| Customer | manan@example.com | pass123 |
| Admin | admin | admin123 |
The app runs with in-memory data by default (no MySQL needed for demo).
To use MySQL in production:
- Install MySQL and create the database:
mysql -u root -p < sql/schema.sql- Update
app.pyto use SQLAlchemy with your MySQL connection string.
The sql/schema.sql file includes:
- All 9 CREATE TABLE statements
- Triggers (auto order total, auto restaurant rating)
- Views (customer orders, restaurant revenue, popular items)
- Sample data (4 restaurants, 12 menu items, 3 customers, 4 orders)
- 5 advanced query examples (commented out, for your report)
food_ordering/
├── app.py # Flask application (all routes)
├── sql/
│ └── schema.sql # Complete MySQL schema + data
├── templates/
│ ├── base.html # Base layout (navbar, footer, styles)
│ ├── index.html # Home page (hero, categories, restaurants)
│ ├── menu.html # Restaurant menu page
│ ├── login.html # Customer login
│ ├── register.html # Customer registration
│ ├── cart.html # Shopping cart
│ ├── checkout.html # Checkout page
│ ├── my_orders.html # Customer order history
│ ├── track_order.html # Order tracking with step indicator
│ ├── search_results.html # Search results page
│ ├── admin_login.html # Admin login
│ ├── admin_dashboard.html# Admin dashboard with stats
│ ├── admin_orders.html # Admin order management
│ ├── admin_customers.html# Admin customer list
│ ├── admin_restaurants.html # Admin restaurant list
│ └── admin_menu.html # Admin menu item management
└── README.md
| Table | Description |
|---|---|
| categories | Food categories (Burgers, Pizza...) |
| restaurants | Restaurant info and ratings |
| customers | Customer accounts |
| admins | Admin accounts |
| menu_items | Food items linked to restaurants |
| orders | Customer orders |
| order_details | Items within each order |
| payments | Payment records |
| reviews | Customer reviews for restaurants |
See sql/schema.sql — bottom section contains 5 commented queries:
- Total revenue per restaurant (delivered orders)
- Top 3 most ordered items
- Customers who spent more than Rs. 1500
- Average order value per restaurant
- Monthly order count
© 2025 FoodExpress — FAST NUCES DBS Project