Skip to content

A modern, full-featured food ordering website built with PHP, MySQL, HTML, CSS, and JavaScript. Features a stunning UI with smooth animations and complete e-commerce functionality.

License

Notifications You must be signed in to change notification settings

kaifansariw/foodify

Repository files navigation

πŸ• Foodify - Food Ordering Website

A modern, full-featured food ordering website built with PHP, MySQL, HTML, CSS, and JavaScript. Features a stunning UI with smooth animations and complete e-commerce functionality.

✨ Features

User Features

  • πŸ” User Authentication - Secure login/registration with password hashing
  • πŸ” Browse Menu - View all available food items with categories
  • πŸ” Search & Filter - Find food by name or category
  • πŸ›’ Shopping Cart - Add/remove items, update quantities
  • πŸ’³ Place Orders - Complete order process with order confirmation
  • πŸ“‹ Order History - View all past orders and their status
  • ❌ Cancel Orders - Cancel pending orders
  • πŸ“± Responsive Design - Works perfectly on all devices

Admin Features

  • πŸ“Š Dashboard - Overview of orders, users, revenue
  • βž• Add Food Items - Add new dishes to the menu
  • πŸ—‘οΈ Delete Food Items - Remove items from menu
  • πŸ“¦ Manage Orders - View all orders and update status
  • πŸ”„ Order Status - Change order status (Pending, Preparing, Delivered, Cancelled)

Design Features

  • 🎨 Modern gradient UI with glassmorphism effects
  • ✨ Smooth animations using AOS (Animate On Scroll)
  • 🌈 Beautiful color schemes and hover effects
  • πŸ“Έ Real food images (placeholders - replace with your own)
  • 🎯 Clean, intuitive navigation

πŸš€ Installation

Prerequisites

  • XAMPP/WAMP/MAMP or any local server with PHP and MySQL
  • PHP 7.4 or higher
  • MySQL 5.7 or higher

Step 1: Clone/Download

# Clone or download this project to your htdocs folder
# Example: C:/xampp/htdocs/foodify/

Step 2: Database Setup

  1. Start Apache and MySQL in XAMPP
  2. Open phpMyAdmin (http://localhost/phpmyadmin)
  3. Create a new database named food_ordering_db
  4. Import the SQL file:
    • Go to the database
    • Click "Import" tab
    • Choose food_ordering_db.sql file
    • Click "Go"

Step 3: Configure Database Connection

Edit includes/db_connect.php if your database credentials are different:

define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'food_ordering_db');

Step 4: Add Food Images

Place your food images in the assets/images/ folder. Default images needed:

  • pizza1.jpg, pizza2.jpg, pizza3.jpg
  • burger1.jpg, burger2.jpg, burger3.jpg
  • dessert1.jpg, dessert2.jpg, dessert3.jpg
  • salad1.jpg, salad2.jpg
  • pasta1.jpg, pasta2.jpg
  • wings.jpg, mozzarella.jpg

Pro Tip: Download free food images from:

Step 5: Access the Website

User Interface: http://localhost/foodify/
Admin Panel: http://localhost/foodify/admin/dashboard.php

πŸ” Default Credentials

Admin Login

Test User Account

Create your own account through the registration page!

πŸ“ Folder Structure

foodify/
β”‚
β”œβ”€β”€ index.php                 # Home page
β”œβ”€β”€ about.php                 # About us page
β”œβ”€β”€ contact.php               # Contact page
β”œβ”€β”€ menu.php                  # Food menu page
β”œβ”€β”€ cart.php                  # Shopping cart
β”œβ”€β”€ order.php                 # Order history
β”œβ”€β”€ order_confirmation.php    # Order success page
β”œβ”€β”€ login.php                 # User login
β”œβ”€β”€ register.php              # User registration
β”œβ”€β”€ logout.php                # Logout handler
β”‚
β”œβ”€β”€ add_to_cart.php          # Add item to cart (AJAX)
β”œβ”€β”€ update_cart.php          # Update cart quantity (AJAX)
β”œβ”€β”€ remove_from_cart.php     # Remove from cart (AJAX)
β”œβ”€β”€ clear_cart.php           # Clear entire cart (AJAX)
β”œβ”€β”€ place_order.php          # Place order (AJAX)
β”œβ”€β”€ cancel_order.php         # Cancel order (AJAX)
β”œβ”€β”€ get_cart_count.php       # Get cart item count (AJAX)
β”‚
β”œβ”€β”€ /admin
β”‚   β”œβ”€β”€ dashboard.php        # Admin dashboard
β”‚   β”œβ”€β”€ add_food.php         # Add/manage food items
β”‚   β”œβ”€β”€ view_orders.php      # View/manage orders
β”‚   └── admin_logout.php     # Admin logout
β”‚
β”œβ”€β”€ /assets
β”‚   β”œβ”€β”€ /css
β”‚   β”‚   └── style.css        # Main stylesheet
β”‚   β”œβ”€β”€ /js
β”‚   β”‚   └── script.js        # JavaScript functionality
β”‚   └── /images
β”‚       └── (food images)    # Food item images
β”‚
└── /includes
    β”œβ”€β”€ db_connect.php       # Database connection
    β”œβ”€β”€ header.php           # Header template
    └── footer.php           # Footer template

πŸ—„οΈ Database Tables

users

  • id, name, email, password, created_at

foods

  • id, name, category, description, price, image_url, created_at

cart

  • id, user_id, food_id, quantity, added_at

orders

  • id, user_id, total_price, status, created_at

order_items

  • id, order_id, food_id, quantity, price

contact_messages

  • id, name, email, message, created_at

🎨 Customization

Change Colors

Edit assets/css/style.css - look for the :root section:

:root {
    --primary: #ff6b6b;
    --secondary: #4ecdc4;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

Change Website Name

Edit includes/header.php and change "Foodify" to your desired name.

Add Categories

Edit menu.php and admin/add_food.php to add more food categories.

πŸ”§ Technologies Used

  • Frontend: HTML5, CSS3, JavaScript (ES6+)
  • Backend: PHP 7.4+
  • Database: MySQL
  • Libraries:
    • AOS (Animate On Scroll)
    • Font Awesome 6
    • Google Fonts (Poppins)

πŸ› Troubleshooting

Cart count not updating

  • Make sure JavaScript is enabled
  • Check browser console for errors
  • Verify AJAX endpoints are accessible

Images not showing

  • Ensure images are in correct folder
  • Check file paths in database
  • Verify image file names match database entries

Database connection error

  • Verify MySQL is running
  • Check database credentials in db_connect.php
  • Ensure database exists

Admin panel not accessible

  • Clear browser cache and cookies
  • Try logging in again with password: admin123

πŸ“ Notes

  • Change admin password in production!
  • Use HTTPS in production environment
  • Add proper email functionality for order confirmations
  • Implement payment gateway for real transactions
  • Add more security measures (CSRF protection, input validation)

πŸš€ Future Enhancements

  • Real-time order tracking
  • Email notifications
  • Payment gateway integration
  • Rating and review system
  • Loyalty points program
  • Multiple delivery addresses
  • Coupon/promo code system
  • Dark mode toggle

πŸ“„ License

This project is open source and available for educational purposes.

πŸ‘¨β€πŸ’» Developer

Created with ❀️ by @kaifansariw


Enjoy your food ordering website! πŸ•πŸ”πŸ°

About

A modern, full-featured food ordering website built with PHP, MySQL, HTML, CSS, and JavaScript. Features a stunning UI with smooth animations and complete e-commerce functionality.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published