A complete, professional pet shop e-commerce platform with modern UI/UX built using PHP, MySQL, and Tailwind CSS.
- Features
- Screenshots
- Installation
- Usage
- Project Structure
- Technologies
- Security
- Documentation
- Troubleshooting
- License
- π Modern Homepage - Hero banner, featured pets, categories showcase, testimonials
- ποΈ Advanced Shop - Category filters, price range, search, pagination (12 items/page)
- π Smart Shopping Cart - AJAX updates, real-time quantity management, no page reload
- π³ Secure Checkout - Multi-step process, multiple payment methods (COD, Card, UPI)
- π¨βπΌ User Dashboard - Profile management, complete order history with status tracking
- π± Fully Responsive - Mobile-first design, works on all devices
- π Analytics Dashboard - Real-time statistics (orders, revenue, customers, pets sold)
- π Pet Management - Full CRUD operations with image upload and stock tracking
- π Category Management - Add/Edit/Delete categories with pet count display
- π¦ Order Management - 7-stage status tracking (Pending β Confirmed β Processing β Packed β Out for Delivery β Delivered)
- π Sales Reports - Comprehensive analytics with CSV export
- Overall statistics
- Monthly sales breakdown (12 months)
- Top 10 best-selling pets
- Category-wise performance
- Recent orders (last 20)
- π¨ Modern UI - Sidebar navigation, color-coded status badges, responsive tables
- β Warm pet-themed color palette (Orange #FF8C42, Cream #FFF4E6, Brown #8B4513)
- β Smooth animations and hover effects
- β Card-based modern layouts
- β Loading spinners and notifications
- β Auto-dismissing flash messages
- β Mobile-responsive navigation
- β SQL injection prevention (prepared statements)
- β
Password hashing (bcrypt via
password_hash()) - β
XSS protection (
htmlspecialchars()) - β Secure file uploads (type/size validation)
- β Session-based authentication
- β Role-based access control (admin/user)
- β CSRF token generation ready
- Homepage: Modern hero banner with featured pets
- Shop Page: Advanced filtering and responsive grid layout
- Shopping Cart: Real-time AJAX updates
- Checkout: Multi-step secure checkout process
- Dashboard: Comprehensive statistics and analytics
- Pet Management: CRUD operations with image preview
- Order Management: Enhanced status tracking with 7 stages
- Reports: Visual analytics with CSV export
- XAMPP/WAMP/LAMP (Apache + MySQL + PHP 7.4+)
- Web Browser (Chrome, Firefox, Edge, Safari)
- Text Editor (Optional - VS Code, Sublime, etc.)
# Place the Petshop folder in your htdocs directory
C:\xampp\htdocs\PetshopOption A - phpMyAdmin (Recommended):
- Open
http://localhost/phpmyadmin - Create new database:
petshop - Select the database
- Go to Import tab
- Choose file:
database/petshop.sql - Click Go
Option B - MySQL Command Line:
mysql -u root -p
CREATE DATABASE petshop;
USE petshop;
SOURCE C:/xampp/htdocs/Petshop/database/petshop.sql;Open includes/config.php and verify:
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', ''); // Your MySQL password
define('DB_NAME', 'petshop');
define('SITE_URL', 'http://localhost/Petshop');Run the image setup script:
http://localhost/Petshop/update_images.php
This will:
- Copy images to
assets/uploads/pets/ - Update database with image paths
- Show preview of all pets
Import the status migration:
- Open phpMyAdmin β petshop database β SQL tab
- Import:
database/add_order_statuses.sql - Click Go
- User Panel:
http://localhost/Petshop - Admin Panel:
http://localhost/Petshop/admin/login.php
Username: admin
Password: admin123
Email: admin@petshop.com
Register a new account at:
http://localhost/Petshop/user/register.php
-
Browse Pets
- Visit homepage or shop page
- Use filters (category, price, search)
- View pet details
-
Purchase Process
- Add pets to cart
- Update quantities as needed
- Register/Login
- Complete checkout with shipping details
- Choose payment method
-
Track Orders
- View order history in dashboard
- Check order status
- Update profile information
-
Login
- Access:
http://localhost/Petshop/admin/login.php - Use admin credentials
- Access:
-
Manage Pets
- Add new pets with images
- Edit existing pet details
- Update stock and prices
- Delete pets
-
Process Orders
- View all orders with filters
- Update order status:
- Pending β Confirmed
- Confirmed β Processing
- Processing β Packed
- Packed β Out for Delivery
- Out for Delivery β Delivered
- View customer details
-
Generate Reports
- View analytics dashboard
- Export comprehensive CSV reports
- Track monthly sales
- Identify best sellers
Petshop/
βββ admin/ # Admin panel
β βββ includes/ # Admin components
β β βββ sidebar.php # Navigation sidebar
β β βββ footer.php # Admin footer
β βββ dashboard.php # Analytics dashboard
β βββ login.php # Admin login
β βββ manage_pets.php # Pet CRUD operations
β βββ manage_categories.php # Category management
β βββ manage_orders.php # Order management
β βββ reports.php # Sales reports & CSV export
β
βββ assets/
β βββ css/
β β βββ style.css # Custom styles & animations
β βββ js/
β β βββ main.js # JavaScript utilities
β βββ uploads/
β βββ pets/ # Pet images (auto-created)
β
βββ database/
β βββ petshop.sql # Main database schema
β βββ add_order_statuses.sql # Order status migration
β βββ update_images.sql # Image update script
β
βββ includes/
β βββ config.php # Database & site config
β βββ functions.php # Utility functions
β βββ header.php # HTML head
β βββ navbar.php # Navigation bar
β βββ footer.php # Footer
β
βββ user/
β βββ ajax/ # AJAX endpoints
β β βββ add_to_cart.php # Add to cart
β β βββ update_cart.php # Update cart
β βββ cart.php # Shopping cart
β βββ categories.php # Category browsing
β βββ checkout.php # Checkout process
β βββ dashboard.php # User dashboard
β βββ login.php # User login
β βββ logout.php # Logout
β βββ order_success.php # Order confirmation
β βββ register.php # User registration
β βββ shop.php # Product listing
β
βββ images/ # Source images
βββ index.php # Homepage
βββ check_system.php # System diagnostic
βββ debug_admin.php # Admin debug tool
βββ update_images.php # Image setup script
βββ README.md # This file
βββ IMAGE_SETUP_GUIDE.md # Image setup guide
βββ ORDER_STATUS_GUIDE.md # Order status guide
- PHP 7.4+ - Core programming language
- MySQL 5.7+ - Database management
- mysqli - Database connectivity (prepared statements)
- HTML5 - Structure
- Tailwind CSS 3.0 - Utility-first CSS framework
- JavaScript (Vanilla) - Client-side interactivity
- AJAX - Asynchronous updates
- Font Awesome 6.4 - Icons
- Google Fonts (Poppins) - Typography
// All queries use prepared statements
$stmt = $conn->prepare("SELECT * FROM users WHERE username = ?");
$stmt->bind_param("s", $username);// Hashing on registration
$hashed = password_hash($password, PASSWORD_DEFAULT);
// Verification on login
password_verify($password, $stored_hash);// All user inputs sanitized
function sanitize_input($data) {
return htmlspecialchars(strip_tags(trim($data)));
}- File type validation (MIME type checking)
- File size limits (5MB max)
- Unique filename generation
- Secure storage path
- Extension whitelist
- IMAGE_SETUP_GUIDE.md - Image integration instructions
- ORDER_STATUS_GUIDE.md - Order management guide
- walkthrough.md - Complete feature walkthrough
- users - User accounts with role-based access
- categories - Pet categories
- pets - Pet inventory with images
- orders - Customer orders
- order_items - Order line items
Located in includes/functions.php:
sanitize_input()- Input sanitizationis_logged_in()- Authentication checkis_admin()- Admin role checkadd_to_cart()- Cart managementupload_image()- Secure file uploadformat_price()- Currency formatting
β Database Connection Error
Solution: Check config.php credentials and ensure MySQL is running
β Images Not Showing
Solution: Run http://localhost/Petshop/update_images.php
β Admin Login Not Working
Solution: Run http://localhost/Petshop/debug_admin.php
β Order Modal Not Opening
Solution: Clear browser cache and refresh page
β Page Not Found (404)
Solution: Verify SITE_URL in config.php matches your setup
Run comprehensive system check:
http://localhost/Petshop/check_system.php
This checks:
- PHP version and extensions
- Database connection and tables
- Admin user existence
- File permissions
- Image availability
- Order status configuration
- Page accessibility
β
One-click add to cart
β
Real-time cart updates (no page reload)
β
Advanced product filtering
β
Secure checkout process
β
Order tracking
β
Profile management
β
Complete pet inventory control
β
7-stage order status tracking
β
Comprehensive sales analytics
β
CSV export for reports
β
Category management
β
Real-time statistics
β
SQL injection prevention
β
XSS protection
β
Password hashing
β
Secure file uploads
β
Session management
β
Mobile-responsive design
The system includes:
- β 1 Admin user (admin/admin123)
- β 5 Categories (Dogs, Cats, Birds, Fish, Small Pets)
- β 8 Sample pets with images
- β Complete database schema
# 1. Start XAMPP
# Open XAMPP Control Panel
# Start Apache and MySQL
# 2. Import Database
mysql -u root -p petshop < database/petshop.sql
# 3. Setup Images
# Visit: http://localhost/Petshop/update_images.php
# 4. Enable Order Statuses
# Import: database/add_order_statuses.sql in phpMyAdmin
# 5. Access Application
# User: http://localhost/Petshop
# Admin: http://localhost/Petshop/admin/login.phpThis project is open-source and available under the MIT License.
- Colors: Edit Tailwind config in
includes/header.php - Styles: Modify
assets/css/style.css - Functions: Add to
includes/functions.php - Database: Extend schema as needed
- Always use prepared statements
- Sanitize all user inputs
- Hash passwords with bcrypt
- Validate file uploads
- Test on multiple devices
Built with β€οΈ for pet lovers and e-commerce enthusiasts.
Key Technologies:
- PHP for robust backend
- MySQL for reliable data storage
- Tailwind CSS for modern UI
- Vanilla JavaScript for performance
For issues or questions:
- Check Troubleshooting section
- Run system diagnostic:
check_system.php - Review documentation files
- Check browser console for JavaScript errors
πΎ Enjoy managing your pet shop! πΎ
Last Updated: February 15, 2026
Version: 1.0.0
Status: Production Ready β