A full-featured online food ordering web application built with vanilla PHP, MySQL, and JavaScript. Users can browse a menu, add items to cart, place orders, and track delivery status in real time. Admins have a dedicated dashboard to manage menu items, categories, and order statuses.
| Layer | Technology |
|---|---|
| Backend | PHP 8+ (Vanilla, No Framework) |
| Database | MySQL / MariaDB |
| Frontend | HTML5, CSS3, Vanilla JavaScript |
| Server | Apache (XAMPP / WAMP / Laragon) |
| Architecture | MVC-inspired (Models, Views, Controllers) |
- User Registration & Login — Secure authentication with bcrypt hashing and "Remember Me" cookie support
- Browse Menu — View available food items organized by categories with search functionality
- Add to Cart — Session-based cart with quantity control (add, update, remove) via AJAX
- Checkout & Place Order — Enter delivery address, choose payment method, and confirm order
- Order Tracking — Real-time order status polling (Pending → Preparing → Out for Delivery → Delivered)
- Order History — View all past orders with item details
- Profile Management — Update name, email, delivery address, and change password
- Dashboard — Overview of total orders, revenue, and recent activity
- Manage Orders — View, filter, and advance order statuses
- Manage Menu Items — Add, edit, delete items with image upload (JPEG/PNG, max 2 MB)
- Manage Categories — Create, edit, and delete food categories
- Toggle Availability — Instantly mark items as available or unavailable
This project was built step-by-step following an MVC-inspired architecture:
- Database Design — Defined the relational schema with 5 core tables:
users,categories,menu_items,orders, andorder_items. - Backend Models — Created PHP model classes (
User,Category,MenuItem,Order,Cart) encapsulating all database operations using PDO with prepared statements. - Controllers — Built controllers for auth, profile, checkout, orders, and admin actions to handle business logic and routing.
- API Endpoints — Developed JSON API routes (
/api/cart/,/api/orders/,/api/checkout/,/api/toggle.php) for AJAX interactions. - Views & UI — Designed a modern, responsive UI with custom CSS — separate stylesheets for the storefront and admin panel.
- Frontend JS — Added interactive features (cart updates, menu search, order status polling, admin status controls) using vanilla JavaScript and Fetch API.
- Admin Panel — Built a full admin dashboard with sidebar navigation, data tables, and form-based CRUD for menu/category management.
- Image Uploads — Implemented secure file upload with MIME-type validation and unique filename generation.
- XAMPP (or WAMP / Laragon) with Apache & MySQL running
- PHP 8.0+
- A web browser
-
Clone the repository into your localhost root directory:
cd C:/xampp/htdocs git clone https://github.com/Junayed37/online-food-ordering-system.git "Online Food Ordering System"
-
Import the database:
- Open phpMyAdmin
- Click Import → select the file
food_ordering_system.sqlfrom the project root - Click Go — this creates the database, tables, and sample data automatically
-
Start Apache & MySQL from the XAMPP Control Panel.
-
Open in browser:
http://localhost/Online Food Ordering System/public/index.php -
Default Admin Login:
Email: admin@gmail.com Password: password
- Payment Gateway Integration — Add real payment processing (e.g., SSLCommerz, bKash, Stripe)
- Email Notifications — Send order confirmation and status update emails to customers
- Restaurant Multi-Tenancy — Support multiple restaurant vendors with separate dashboards
- Delivery Personnel Module — Assign riders to orders with GPS-based live tracking
- Ratings & Reviews — Let customers rate food items and leave reviews
- Coupons & Discounts — Implement promo code system with percentage/flat discounts
- PWA & Push Notifications — Make the app installable and send real-time browser notifications
- REST API Refactor — Build a proper RESTful API to support a mobile app (React Native / Flutter)
- Security Enhancements — Add CSRF protection, rate limiting, input sanitization middleware
- Testing — Introduce unit tests and integration tests with PHPUnit
- Containerization — Add Docker setup for one-command deployment
This project is open-source and available for educational purposes.
Built with ❤️ in Bangladesh