A comprehensive e-commerce platform built with PHP and MySQL, designed to provide seamless shopping experiences for customers and efficient management tools for administrators.
shopRADO is a full-featured e-commerce web application that enables customers to browse products, manage shopping carts, and make purchases while providing administrators with powerful tools to manage inventory and user accounts. The platform features a clean, user-friendly interface with robust backend functionality.
- Dual Interface: Separate customer and admin portals for optimal user experience
- Secure Authentication: Role-based access control with encrypted password storage
- Product Management: Complete CRUD operations for product inventory
- Shopping Cart: Dynamic cart functionality with real-time updates
- Database Integration: Well-structured MySQL database with relational integrity
- User registration and secure login/logout
- Browse products with detailed information
- Add products to shopping cart
- Cart management (view, update, remove items)
- Session-based user tracking
- Secure admin authentication
- Centralized dashboard for store management
- Add new products with image uploads
- Edit and delete existing products
- User role management
- Backend: PHP
- Database: MySQL
- Frontend: HTML, CSS, JavaScript
- Security: Password hashing, Session management
- File Handling: Image upload and management
This project is developed and optimized to run on XAMPP (Cross-Platform Apache MySQL PHP Perl), providing a complete local development environment.
XAMPP Components Used:
- Apache HTTP Server - Web server for hosting the PHP application
- MySQL Database Server - Relational database management system for data storage
- PHP - Server-side scripting language for dynamic web content
- phpMyAdmin - Web-based MySQL administration tool for database management
Why XAMPP?
- All-in-One Solution: Complete web development stack in a single package
- Cross-Platform: Compatible with Windows, macOS, and Linux
- Easy Setup: Simple installation and configuration process
- Local Development: Perfect for testing and development without external hosting
- Integrated Tools: Built-in phpMyAdmin for efficient database management
System Requirements:
- XAMPP v3.3.0 or higher
- PHP 7.4+ (included with XAMPP)
- MySQL 5.7+ (included with XAMPP)
- Apache 2.4+ (included with XAMPP)
The shopRADO platform uses a MySQL database that can be easily set up through phpMyAdmin, which comes integrated with XAMPP.
Database Name: shoprado
The application uses three main tables to handle user management, product catalog, and shopping cart functionality:
Database Tables Overview:
- users - Stores customer and admin account information
- products - Contains product catalog with details and pricing
- cart - Manages shopping cart items for each user
Stores user account information with role-based access control.
Structure:
id- Primary key, auto-incrementusername- User display name (50 characters max)email- Unique email address (100 characters max)password- Encrypted password (255 characters for hash)created_at- Account creation timestamprole- User role (user/admin) with default as 'user'
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
role ENUM('user', 'admin') DEFAULT 'user'
);Contains product catalog information with pricing and media.
Structure:
id- Primary key, auto-incrementname- Product name (255 characters max)price- Product price (decimal with 2 decimal places)description- Product description (text field)image- Product image filename (255 characters max)created_at- Product creation timestamp
CREATE TABLE products (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
price DECIMAL(10, 2) NOT NULL,
description TEXT,
image VARCHAR(255),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);Manages shopping cart functionality with user-product relationships.
Structure:
id- Primary key, auto-incrementuser_id- Foreign key linking to users tableproduct_id- Foreign key linking to products tablequantity- Number of items in cartcreated_at- Item addition timestampupdated_at- Last modification timestamp
CREATE TABLE cart (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
product_id INT NOT NULL,
quantity INT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);- Open phpMyAdmin through XAMPP Control Panel
- Create Database:
- Click "New" in the left sidebar
- Enter database name:
shoprado - Click "Create"
- Create Tables:
- Select the
shopradodatabase - Go to "SQL" tab
- Copy and paste each table creation script above
- Execute each script to create the tables
- Select the
- Verify Setup:
- Check that all three tables are created successfully
- Verify table structures match the specifications above
-
Create Project Structure:
- Create a folder named
includesin your project root directory - This folder will contain all configuration and utility files
- Create a folder named
-
Database Configuration File:
- Inside the
includesfolder, create a file nameddb.php - This file handles the MySQL database connection
- Inside the
File Path: includes/db.php
<?php
$host = 'localhost';
$dbname = 'shoprado';
$user = 'root';
$password = '';
try {
$conn = new PDO("mysql:host=$host;dbname=$dbname", $user, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}
?>Configuration Details:
- Host:
localhost(XAMPP default) - Database Name:
shoprado(as created in phpMyAdmin) - Username:
root(XAMPP default MySQL user) - Password: Empty string (XAMPP default - no password)
PDO Benefits:
- Security: Prepared statements prevent SQL injection
- Portability: Works with multiple database systems
- Error Handling: Comprehensive exception handling
- Performance: Efficient database operations
Create a test file to verify your database connection is working properly.
File Path: test_db.php (in project root)
<?php
include 'includes/db.php';
if ($conn) {
echo "Database connected successfully!";
} else {
echo "Failed to connect to the database.";
}
?>Testing Instructions:
- Save the test file in your project root directory
- Ensure XAMPP Apache and MySQL services are running
- Open your web browser and navigate to:
http://localhost/shopRADO/test_db.php - Verify the message "Database connected successfully!" appears
- If successful, you can delete the test file (optional)
Troubleshooting Connection Issues:
- Ensure MySQL service is running in XAMPP Control Panel
- Verify database name matches exactly:
shoprado - Check that all tables are created in phpMyAdmin
- Confirm the
includesfolder path is correct
| Page | Description | URL |
|---|---|---|
| π Register | Enables new users to create an account by providing a username, email, and secure password. All passwords are hashed before storage, and roles are assigned as user by default. |
http://localhost/ecommerce/pages/register.php |
| π Login | Authenticates users via email and password, initializing secure sessions to manage access to protected pages and cart functionality. | http://localhost/ecommerce/pages/login.php |
| πͺ Logout | Logs out the user and destroys session data, redirecting back to the homepage for a secure exit. | http://localhost/ecommerce/pages/logout.php |
| π Home (Product Listing) | Serves as the storefront showcasing all available products. Users can browse, view details, and add items to their shopping cart. | http://localhost/ecommerce/index.php |
| π Shopping Cart | Displays all items added to the userβs cart. Allows updates to quantity, item removal, and prepares the data for future checkout steps. | http://localhost/ecommerce/pages/cart.php |
| Page | Description | URL |
|---|---|---|
| π Admin Login | Secure admin login portal. Grants access only to users with the admin role defined in the users table. |
http://localhost/ecommerce/admin/login.php |
| πͺ Admin Logout | Terminates the admin session and redirects securely to the login screen. | http://localhost/ecommerce/admin/logout.php |
| π Dashboard | Centralized control panel for administrators. Displays an overview of system activity such as product count, users, and quick links to management tools. | http://localhost/ecommerce/admin/dashboard.php |
| π¦ Manage Products | Lists all products with admin options to edit or delete each item. Data is dynamically fetched from the products table. |
http://localhost/ecommerce/admin/manage_products.php |
| β Add Product | A form-based interface for adding new products. Supports product name, price, description, and image upload. | http://localhost/ecommerce/admin/add_product.php |
This section provides a comprehensive explanation of all the key pages in the shopRADO e-commerce platform, covering both customer-facing and administrative functionalities.
π Register
π http://localhost/ecommerce/pages/register.php
The registration page allows new users to create an account on the platform. It captures essential details like username, email, and password. The backend performs robust validation, ensuring unique email addresses and secure password criteria. Passwords are encrypted using industry-standard hashing techniques before being stored in the database. Once registered, users are automatically assigned the role of user and can immediately begin shopping. This page ensures a smooth onboarding experience for new customers.
π Login
π http://localhost/ecommerce/pages/login.php
This page authenticates returning users by verifying their login credentials against the database. It uses secure session management to maintain user state throughout their shopping experience. Once logged in, users gain access to restricted pages such as the cart and checkout process. Proper error handling ensures users receive appropriate messages in case of invalid login attempts or missing data.
πͺ Logout
π http://localhost/ecommerce/pages/logout.php
The logout page securely ends the user's session, clears session variables, and redirects them to the homepage. This action ensures that no residual session data remains, maintaining user privacy and protecting against unauthorized access. Itβs a vital component of secure user session management in the application.
π Home (Product Listing)
π http://localhost/ecommerce/index.php
The homepage serves as the storefront for the platform, dynamically fetching and displaying all available products from the database. Each product entry includes its image, name, price, and an βAdd to Cartβ button for immediate interaction. The layout is user-centric, making product discovery seamless. This page is the heart of the customer experience, offering real-time access to inventory and enabling impulse and informed purchases.
π Shopping Cart
π http://localhost/ecommerce/pages/cart.php
This page provides users with a detailed view of the items they have added to their cart. It supports modifying item quantities, removing products, and preparing for checkout. Cart data is linked to the logged-in user or session, ensuring personalized experiences. The cart reflects live data from the database and adapts in real-time, making it a critical component of the shopping workflow.
π Admin Login
π http://localhost/ecommerce/admin/login.php
A secure access point designed specifically for administrators. This page authenticates admin accounts using the users table, checking for the admin role. Only verified admins can proceed to the backend dashboard. It enforces strict access control and prevents unauthorized users from accessing sensitive functionalities.
πͺ Admin Logout
π http://localhost/ecommerce/admin/logout.php
This page securely terminates the current admin session. It ensures that all admin-related session data is cleared, returning the user to the login page. It's a fundamental part of maintaining a secure and compliant administrative environment.
π Admin Dashboard
π http://localhost/ecommerce/admin/dashboard.php
The central control panel for all administrative tasks. The dashboard provides a snapshot of system metrics such as the number of products listed, user registrations, and overall system performance. It includes navigation links to all major admin tools and streamlines workflow for store management. The dashboard enhances operational visibility and decision-making for administrators.
π¦ Manage Products
π http://localhost/ecommerce/admin/manage_products.php
This page enables admins to view a full list of all products currently available in the store. It provides options to edit or delete any product directly. Each action is tied to database operations, and all updates are reflected instantly in the customer-facing store. The interface is designed for efficiency and ease of use, making inventory control smooth and accurate.
β Add Product
π http://localhost/ecommerce/admin/add_product.php
This form-based page allows administrators to add new products to the platform. It supports uploading product images, entering names, descriptions, and setting prices. All submitted data is validated before insertion into the products table. The newly added products appear instantly on the homepage, making this page essential for expanding the product catalog and keeping the storefront fresh.
Hi, Iβm Rohith Boppana β a passionate and driven final-year B.Tech student in Computer Science and Engineering with a specialization in Artificial Intelligence & Machine Learning.
I'm deeply interested in building real-world tech solutions that combine data, intelligence, and intuitive design. My academic journey and hands-on projects reflect a strong foundation in both theory and practical application.
- π€ Artificial Intelligence & Machine Learning
- π Data Science & Analytics
- π BI Dashboards & Predictive Modeling
- π‘ Problem-Solving with Scalable Technologies
I enjoy translating business needs and data insights into impactful software solutions that solve real problems and enhance user experiences.
π« LinkedIn
Letβs connect and grow professionally:
linkedin.com/in/rohith-boppana-39ab57279
π Portfolio
Explore my latest work, skills, and projects here:
rohith-boppana.vercel.app
π‘ βFinal-year student, forever learner β building the future, one project at a time.β
Feel free to explore my repositories and reach out for collaborations, internships, or to discuss innovative ideas!







