A comprehensive full-stack web application built with Flask that provides a complete food ordering experience with AI-powered recommendations.
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
- โ 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
- Smart Recommendations: Content-based filtering algorithm
- Personal Preferences: Based on order history and ratings
- Popular Items: Trending menu items
- Category Analysis: Intelligent category suggestions
- 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
- 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
- USER - User accounts and profiles
- ORDER - Order information and status
- ORDERDETAILS - Individual order items
- MENUITEM - Food items and pricing
- PAYMENT - Payment transactions
- FEEDBACK - Customer reviews and ratings
- DELIVERY - Delivery tracking and assignment
- KITCHENSTAFF - Staff management
- RECOMMENDATION - AI recommendation data
- Python 3.8+
- pip (Python package manager)
-
Clone/Download the project to your local machine
-
Navigate to the project directory:
cd "food order system"
-
Run the setup script:
python run.py
-
Install dependencies:
pip install -r requirements.txt
-
Configure email for 2FA (optional but recommended):
- See
EMAIL_SETUP_GUIDE.mdfor detailed instructions - Set environment variables or edit
app.pywith your email credentials - Test configuration:
python test_email_config.py
- See
-
Create sample data (optional):
python create_sample_data.py
-
Start the application:
python app.py
- Application URL: http://localhost:5000
- Admin Login: admin@foodsystem.com / admin123
- Customer Registration: Available at /auth/register
- Full system access
- User management
- Menu item management
- Order management
- Staff management
- Reports and analytics
- System configuration
- Most admin capabilities
- Order supervision
- Staff scheduling
- Performance monitoring
- Report generation
- Order processing
- Payment handling
- Feedback management
- Basic reporting
- Browse menu with search/filter
- Shopping cart management
- Order placement and tracking
- AI-powered recommendations
- Feedback and reviews
- Order history
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
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
- Personal: Based on individual user history
- Popular: Trending items across all users
- Similar: Items similar to highly-rated purchases
- Seasonal: Time-based recommendations
- Sales Dashboard: Overview of key metrics
- Sales Report: Detailed sales analysis with filters
- Menu Analysis: Performance of individual items and categories
- Customer Analysis: Customer behavior and segmentation
- Delivery Performance: Delivery timing and staff efficiency
- Feedback Summary: Customer satisfaction analytics
- Total revenue and order counts
- Average order value
- Customer retention rates
- On-time delivery percentage
- Average customer ratings
- Menu item popularity scores
- 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
- Bootstrap 5: Responsive CSS framework
- Font Awesome: Icon library
- Custom CSS: Enhanced styling and animations
- JavaScript: Interactive features and AJAX calls
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
- Admin: admin@foodsystem.com / admin123
- Supervisor: supervisor@foodsystem.com / supervisor123
- Employee: alice@foodsystem.com / employee123
- Customer: Register new account or use existing sample customers
- Customer Journey: Browse menu โ Add to cart โ Place order โ Track delivery โ Provide feedback
- Admin Tasks: Add menu items โ Manage users โ View reports โ Monitor orders
- Order Management: Process orders โ Update status โ Assign delivery โ Handle payments
- 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
The recommendation system uses a hybrid approach:
-
Content-Based Analysis:
- User preference profiling
- Category affinity scoring
- Historical purchase analysis
-
Popularity-Based Recommendations:
- Order frequency analysis
- Rating-weighted popularity
- Trending item detection
-
Collaborative Patterns:
- Similar user behavior
- Cross-category recommendations
- Seasonal preference tracking
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
- 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
โ
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