Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Smart Food Ordering System

A comprehensive full-stack web application built with Flask that provides a complete food ordering experience with AI-powered recommendations.

๐Ÿฝ๏ธ System Overview

This is a 3-tier architecture application featuring:

  • Frontend: HTML, CSS, JavaScript with Bootstrap for responsive design
  • Backend: Flask (Python) with SQLAlchemy ORM
  • Database: SQLite with 9 normalized tables

๐Ÿš€ Features

Core Functionality

  • โœ… User Management: Role-based access (Admin, Supervisor, Employee, Customer)
  • โœ… Menu Management: Full CRUD operations with categories and search
  • โœ… Order Processing: Shopping cart, order tracking, status management
  • โœ… Payment System: Multiple payment methods with transaction tracking
  • โœ… Delivery Management: Real-time tracking with staff assignment
  • โœ… Kitchen Staff: Staff scheduling and performance tracking
  • โœ… Feedback System: Customer reviews and rating analytics

๐Ÿค– AI-Powered Features

  • Smart Recommendations: Content-based filtering algorithm
  • Personal Preferences: Based on order history and ratings
  • Popular Items: Trending menu items
  • Category Analysis: Intelligent category suggestions

๐Ÿ“Š Analytics & Reporting

  • Sales Reports: Comprehensive sales analytics with filtering
  • Menu Performance: Top-selling items and category analysis
  • Customer Analytics: Customer behavior and retention metrics
  • Delivery Performance: On-time delivery tracking and staff performance
  • Feedback Analytics: Rating trends and sentiment analysis

๐Ÿ” Security Features

  • Password Hashing: Werkzeug security for secure authentication
  • Two-Factor Authentication (2FA): Email-based OTP verification with backup codes
  • Session Management: Secure user sessions
  • Role-Based Access: Granular permission control
  • SQL Injection Prevention: Parameterized queries

๐Ÿ“‹ Database Schema

Tables (9 Normalized Tables)

  1. USER - User accounts and profiles
  2. ORDER - Order information and status
  3. ORDERDETAILS - Individual order items
  4. MENUITEM - Food items and pricing
  5. PAYMENT - Payment transactions
  6. FEEDBACK - Customer reviews and ratings
  7. DELIVERY - Delivery tracking and assignment
  8. KITCHENSTAFF - Staff management
  9. RECOMMENDATION - AI recommendation data

๐Ÿ› ๏ธ Installation & Setup

Prerequisites

  • Python 3.8+
  • pip (Python package manager)

Quick Start

  1. Clone/Download the project to your local machine

  2. Navigate to the project directory:

    cd "food order system"
  3. Run the setup script:

    python run.py

Manual Setup (Alternative)

  1. Install dependencies:

    pip install -r requirements.txt
  2. Configure email for 2FA (optional but recommended):

    • See EMAIL_SETUP_GUIDE.md for detailed instructions
    • Set environment variables or edit app.py with your email credentials
    • Test configuration: python test_email_config.py
  3. Create sample data (optional):

    python create_sample_data.py
  4. Start the application:

    python app.py

๐ŸŒ Access Information

๐Ÿ‘ฅ User Roles & Capabilities

Admin

  • Full system access
  • User management
  • Menu item management
  • Order management
  • Staff management
  • Reports and analytics
  • System configuration

Supervisor

  • Most admin capabilities
  • Order supervision
  • Staff scheduling
  • Performance monitoring
  • Report generation

Employee

  • Order processing
  • Payment handling
  • Feedback management
  • Basic reporting

Customer

  • Browse menu with search/filter
  • Shopping cart management
  • Order placement and tracking
  • AI-powered recommendations
  • Feedback and reviews
  • Order history

๐Ÿ“Š Sample Data

The application includes comprehensive sample data:

  • 350+ Orders spanning different time periods
  • 30+ Menu Items across 6 categories (Appetizers, Main Course, Chinese, Continental, Desserts, Beverages)
  • 10+ Users with different roles
  • Kitchen Staff with various shifts and departments
  • Realistic Transactions with payments, feedback, and deliveries

๐Ÿค– AI Recommendation System

Algorithm: Content-Based Filtering

The recommendation engine analyzes:

  • Order History: Previous purchases and frequencies
  • Rating Patterns: Highly rated items and categories
  • Popular Trends: System-wide popular items
  • Category Preferences: User's preferred food categories

Recommendation Types:

  • Personal: Based on individual user history
  • Popular: Trending items across all users
  • Similar: Items similar to highly-rated purchases
  • Seasonal: Time-based recommendations

๐Ÿ“ˆ Reports & Analytics

Available Reports:

  1. Sales Dashboard: Overview of key metrics
  2. Sales Report: Detailed sales analysis with filters
  3. Menu Analysis: Performance of individual items and categories
  4. Customer Analysis: Customer behavior and segmentation
  5. Delivery Performance: Delivery timing and staff efficiency
  6. Feedback Summary: Customer satisfaction analytics

Key Metrics:

  • Total revenue and order counts
  • Average order value
  • Customer retention rates
  • On-time delivery percentage
  • Average customer ratings
  • Menu item popularity scores

๐Ÿ”ง Technical Architecture

Backend (Flask)

  • app.py: Main application entry point
  • models.py: SQLAlchemy database models
  • routes/: Modular blueprint-based routing
  • Authentication: Session-based with role checking
  • Database: SQLite with automatic table creation

Frontend

  • Bootstrap 5: Responsive CSS framework
  • Font Awesome: Icon library
  • Custom CSS: Enhanced styling and animations
  • JavaScript: Interactive features and AJAX calls

File Structure:

food order system/
โ”œโ”€โ”€ app.py                 # Main Flask application
โ”œโ”€โ”€ models.py             # Database models
โ”œโ”€โ”€ requirements.txt      # Python dependencies
โ”œโ”€โ”€ run.py               # Setup and launch script
โ”œโ”€โ”€ create_sample_data.py # Sample data generator
โ”œโ”€โ”€ routes/              # Route blueprints
โ”‚   โ”œโ”€โ”€ auth.py          # Authentication routes
โ”‚   โ”œโ”€โ”€ menu.py          # Menu management
โ”‚   โ”œโ”€โ”€ orders.py        # Order processing
โ”‚   โ”œโ”€โ”€ users.py         # User management
โ”‚   โ”œโ”€โ”€ payments.py      # Payment handling
โ”‚   โ”œโ”€โ”€ feedback.py      # Feedback system
โ”‚   โ”œโ”€โ”€ delivery.py      # Delivery tracking
โ”‚   โ”œโ”€โ”€ kitchen.py       # Kitchen staff
โ”‚   โ”œโ”€โ”€ recommendations.py # AI recommendations
โ”‚   โ””โ”€โ”€ reports.py       # Analytics and reports
โ”œโ”€โ”€ templates/           # HTML templates
โ”‚   โ”œโ”€โ”€ base.html        # Base template
โ”‚   โ”œโ”€โ”€ dashboard.html   # Main dashboard
โ”‚   โ”œโ”€โ”€ auth/           # Authentication pages
โ”‚   โ”œโ”€โ”€ menu/           # Menu pages
โ”‚   โ””โ”€โ”€ ...             # Other template directories
โ””โ”€โ”€ static/             # Static files
    โ”œโ”€โ”€ css/style.css   # Custom styles
    โ””โ”€โ”€ js/main.js      # JavaScript functionality

๐Ÿงช Testing Data

Test Credentials:

Test Scenarios:

  1. Customer Journey: Browse menu โ†’ Add to cart โ†’ Place order โ†’ Track delivery โ†’ Provide feedback
  2. Admin Tasks: Add menu items โ†’ Manage users โ†’ View reports โ†’ Monitor orders
  3. Order Management: Process orders โ†’ Update status โ†’ Assign delivery โ†’ Handle payments

๐Ÿš€ Performance Features

  • Optimized Queries: Efficient database operations with proper indexing
  • Pagination: Large datasets handled with pagination
  • Caching: Session-based cart management
  • Responsive Design: Mobile-friendly interface
  • Fast Search: Real-time search and filtering

๐Ÿ”ฎ AI Implementation Details

The recommendation system uses a hybrid approach:

  1. Content-Based Analysis:

    • User preference profiling
    • Category affinity scoring
    • Historical purchase analysis
  2. Popularity-Based Recommendations:

    • Order frequency analysis
    • Rating-weighted popularity
    • Trending item detection
  3. Collaborative Patterns:

    • Similar user behavior
    • Cross-category recommendations
    • Seasonal preference tracking

๐Ÿ“ž Support

For technical support or questions about the implementation:

  • Review the code comments and documentation
  • Check the Flask and SQLAlchemy documentation
  • Examine the sample data and test scenarios

๐Ÿ“š Additional Documentation

  • TWO_FACTOR_AUTH_GUIDE.md - Complete guide to Two-Factor Authentication setup and usage
  • EMAIL_SETUP_GUIDE.md - Quick email configuration for 2FA (Gmail, Outlook, etc.)
  • DOCUMENTATION/ - Comprehensive technical and user documentation

๐Ÿ† Key Achievements

โœ… Complete CRUD Operations for all 9 database tables
โœ… Role-Based Security with proper access controls
โœ… Two-Factor Authentication with email OTP and backup codes
โœ… AI-Powered Recommendations with content-based filtering
โœ… Comprehensive Reporting with SQL joins and aggregations
โœ… Responsive Design with modern UI/UX
โœ… Scalable Architecture with modular blueprints
โœ… Performance Optimized for 500+ records
โœ… Production-Ready with proper error handling


Built with โค๏ธ using Flask, SQLAlchemy, Bootstrap, and AI algorithms

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages