π Overview CampusHub is a production-ready cafeteria management system designed to modernize university cafeteria operations. Built from scratch over 2 weeks with 3,500+ lines of code, it addresses real-world inefficiencies observed at PAF-IAST campus by providing a seamless digital ordering experience.
π― Key Highlights Real-time order tracking with visual progress indicators
Four distinct user roles with specialized dashboards
Persistent shopping cart across browser sessions
Complete authentication & authorization system
Responsive design for all devices
Role-based UI with dynamic updates
π Features π₯ Multi-Role System Role Capabilities Students Browse menu, place orders, track deliveries, manage wallet Teachers All student features + special privileges Administrators Manage menu, view all orders, generate reports, user management Kitchen Staff View pending orders, update preparation status π οΈ Technical Features β Real-time order tracking with color-coded progress bars
β Dark/Light theme toggle with persistent preference
β Toast notifications for user feedback
β Discount/Offer system with code validation
β Wallet system for cashless payments
β Admin dashboard with comprehensive statistics
β Kitchen interface for order preparation tracking
β Search & filter functionality across menu
β Shopping cart with persistent storage
ποΈ Architecture text βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β Frontend β β Backend β β Database β β β β β β β β β’ HTML5/CSS3 ββββββΊβ β’ Python Flask ββββββΊβ β’ SQLite3 β β β’ Vanilla JS β β β’ REST API β β β’ 8 Tables β β β’ Bootstrap 5 β β β’ 25+ Endpoints β β β’ Relationships β β β’ Animate.css β β β’ JWT Sessions β β β’ Indexes β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ π Database Schema sql users menu_items orders cart βββββββββ βββββββββββ ββββββββ βββββββ β’ id β’ id β’ id β’ id β’ username β’ name β’ user_id β’ user_id β’ email β’ category β’ total β’ item_id β’ password_hash β’ price β’ status β’ quantity β’ role β’ description β’ created_at β’ added_at β’ balance β’ preparation_time β’ delivery_option β’ is_active β’ rating π οΈ Technology Stack Frontend HTML5 - Semantic structure
CSS3 - Styling with animations
Vanilla JavaScript - 3,500+ lines of interactive logic
Bootstrap 5 - Responsive grid system
Font Awesome - Professional icons
Animate.css - Smooth transitions
Backend Python Flask - Lightweight REST API framework
SQLite3 - Single-file relational database
Jinja2 - Template rendering (if used)
Development Tools VS Code - Primary IDE
Git - Version control
Postman - API testing (25+ test cases)
Chrome DevTools - Debugging & performance
π Project Structure text CampusHub/ βββ Frontend/ β βββ index.html # Main HTML (600+ lines) β βββ style.css # All CSS (900+ lines) β βββ app.js # All JavaScript (1,400+ lines) βββ Backend/ β βββ app.py # Flask server (800+ lines) β βββ database.py # DB operations (600+ lines) β βββ requirements.txt # Python dependencies β βββ config.py # Configuration βββ database/ β βββ campus_hub.db # SQLite database βββ assets/ β βββ images/ # Project screenshots βββ README.md # This file βββ .gitignore # Git ignore rules π Quick Start Prerequisites Python 3.8+
Modern web browser
Git
Installation bash
git clone https://github.com/yourusername/campus-hub-cafeteria.git cd campus-hub-cafeteria
pip install -r requirements.txt
python init_db.py
python app.py
Frontend: http://localhost:5000
API Base: http://localhost:5000/api
Test Accounts Role Username Password Admin admin admin123 Student student1 password123 Teacher teacher1 teacher123 Kitchen Staff kitchen1 kitchen123 π API Documentation Authentication Endpoints http POST /api/auth/login # User login POST /api/auth/logout # User logout GET /api/auth/me # Current user info Menu Endpoints http GET /api/menu # Get all menu items GET /api/menu/categories # Get all categories Cart Endpoints http GET /api/cart # Get user's cart POST /api/cart/add # Add item to cart POST /api/cart/update # Update cart item quantity DELETE /api/cart/remove/:id # Remove item from cart POST /api/cart/clear # Clear entire cart Order Endpoints http GET /api/orders # Get user's orders POST /api/orders/create # Create new order GET /api/orders/:id/track # Track specific order POST /api/orders/:id/update-status # Update order status π§ͺ Testing The project includes comprehensive testing:
Manual Testing User flow testing across all roles
Cross-browser compatibility (Chrome, Firefox, Edge, Safari)
Mobile responsiveness testing
Error scenario testing
API Testing with Postman 25+ API tests organized in collections
Authentication, menu, cart, orders, admin tests
Environment variables for session management
Test Coverage β Authentication & session management
β Cart functionality
β Order processing
β Discount/offer validation
β Admin/kitchen dashboards
β Error handling scenarios
π Key Achievements Technical Excellence 3,500+ lines of clean, documented JavaScript
800+ lines of Python with proper error handling
600+ lines of database code with transaction support
8 normalized tables with foreign key constraints
Real-time updates via polling mechanism
Security measures: password hashing, SQL injection prevention, XSS protection
User Experience Intuitive navigation with active state indication
Progressive disclosure of complex features
Accessibility features: keyboard navigation, screen reader support
Responsive design for all screen sizes
Loading states and meaningful feedback
π Performance Metrics Metric Result Page Load Time < 3 seconds API Response Time < 500ms Mobile Compatibility 100% Browser Compatibility Chrome, Firefox, Edge, Safari Database Queries Optimized with indexes
π License This project is licensed under the MIT License - see the LICENSE file for details.
π Star this repository if you find it useful! https://img.shields.io/github/stars/yourusername/campus-hub-cafeteria?style=social https://img.shields.io/github/forks/yourusername/campus-hub-cafeteria?style=social
Built with β€οΈ by Abdul Wasay Full Stack Developer | Computer Science Student