A modern, responsive e-commerce website for laptops, desktops, and computer accessories built with HTML, CSS, JavaScript, and PHP.
- Overview
- Features
- Technologies Used
- Project Structure
- Pages
- Installation & Setup
- Database Setup
- Usage
- Design System
- Future Enhancements
- Contributing
TechHub is a comprehensive e-commerce platform designed for selling laptops, desktop computers, and accessories. The project features a modern, responsive design with a clean user interface, product catalog management, user authentication, and shopping cart functionality.
- Product Catalog: Browse laptops, desktops, and accessories
- Product Details: Detailed product pages with specifications, reviews, and warranty information
- Shopping Cart: Add to cart functionality with quantity management
- Checkout Process: Multi-step checkout with order summary
- Product Search & Filtering: Easy navigation and product discovery
- Wishlist: Save favorite products for later
- User Registration: Create new user accounts
- User Login: Secure authentication system
- Password Recovery: Forgot password functionality
- User Profile Management: Account management features
- Responsive Design: Mobile-first approach, works on all devices
- Modern Interface: Clean, professional design with smooth animations
- Interactive Elements: Hover effects, transitions, and dynamic content
- Accessibility: Focus on usability and accessibility standards
- Brand Consistency: Cohesive design system throughout
- Database Integration: MySQL database for user management
- PHP Backend: Server-side processing for authentication
- JavaScript Functionality: Interactive features and form validation
- CSS Grid & Flexbox: Modern layout techniques
- Font Awesome Icons: Professional iconography
- Google Fonts: Typography with Inter font family
- HTML5: Semantic markup structure
- CSS3: Advanced styling with custom properties, grid, flexbox
- JavaScript (ES6+): Interactive functionality and DOM manipulation
- Font Awesome 6.4.0: Icon library
- Google Fonts: Inter font family
- PHP: Server-side scripting for user authentication
- MySQL: Database management system
- Git: Version control
- VS Code: Code editor
- Browser DevTools: Testing and debugging
laptopStore-webProject/
โโโ assets/
โ โโโ css/ # Stylesheets
โ โ โโโ home.css # Homepage styles
โ โ โโโ navbar.css # Navigation styles
โ โ โโโ footer.css # Footer styles
โ โ โโโ laptop.css # Laptop catalog styles
โ โ โโโ laptopDetails.css # Laptop detail page styles
โ โ โโโ desktop.css # Desktop catalog styles
โ โ โโโ desktopDetails.css # Desktop detail page styles
โ โ โโโ accessories.css # Accessories catalog styles
โ โ โโโ accessoryDetails.css # Accessory detail page styles
โ โ โโโ login.css # Login page styles
โ โ โโโ signup.css # Signup page styles
โ โ โโโ checkout.css # Checkout page styles
โ โ โโโ ...
โ โโโ js/ # JavaScript files
โ โ โโโ menu.js # Mobile menu functionality
โ โ โโโ slider.js # Image slider functionality
โ โ โโโ footer.js # Footer interactions
โ โ โโโ checkout.js # Checkout process
โ โโโ images/ # Static assets
โ โโโ banners/ # Banner images
โ โโโ icons/ # Brand and social icons
โ โโโ products/ # Product images
โโโ admin/ # Admin panel (future development)
โโโ config/ # Configuration files (future development)
โโโ includes/ # PHP includes (future development)
โโโ models/ # Data models (future development)
โโโ *.html # Main pages
โโโ *.php # PHP pages with backend functionality
โโโ database.php # Database connection
home.html- Homepage with featured products and navigationaboutus.html- Company information and missionprivacyPolicy.html- Privacy policy and data handlingtermsConditions.html- Terms of service and conditions
Laptop.html- Laptop catalog pagedesktop.html- Desktop computer catalog pageaccessories.html- Accessories catalog page
L1.html,L2.html,L3.html,L4.html- Individual laptop product pagesD1.html,D2.html,D3.html,D4.html- Individual desktop product pagesmouse.html- Wireless optical mouse detailskeyboard.html- Mechanical gaming keyboard detailsearphone.html- Premium wireless earphones detailsspeaker.html- Portable Bluetooth speaker details
checkout_L7.html- Laptop checkout pagecheckout_D1.html- Desktop checkout page (Model D1)checkout_D2.html- Desktop checkout page (Model D2)checkout_D4.html- Desktop checkout page (Model D4)
login.php- User login with database integrationsignup.php- User registration with database storageforgotPassword.php- Password recovery functionality
database.php- MySQL database connection configuration
- XAMPP/WAMP/LAMP: Local server environment
- MySQL: Database server
- Web Browser: Modern browser (Chrome, Firefox, Safari, Edge)
- Text Editor: VS Code recommended
-
Clone the Repository
git clone https://github.com/Kavindya-Kariyawasam/laptopStore-webProject.git cd laptopStore-webProject -
Setup Local Server
- Install XAMPP/WAMP/LAMP
- Place project folder in
htdocs(XAMPP) orwww(WAMP) directory - Start Apache and MySQL services
-
Database Configuration
- Open phpMyAdmin (http://localhost/phpmyadmin)
- Create a new database named
lapstore - Import the database schema (see Database Setup section)
-
Configure Database Connection
- Open
database.php - Verify connection settings:
$server = "localhost"; $username = "root"; $password = ""; $database = "lapstore";
- Open
-
Launch Application
- Open browser and navigate to
http://localhost/laptopStore-webProject - Access homepage at
home.html
- Open browser and navigate to
Create the following table structure in your lapstore database:
CREATE DATABASE lapstore;
USE lapstore;
-- Users table for authentication
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
Username VARCHAR(50) UNIQUE NOT NULL,
Password VARCHAR(255) NOT NULL,
Email VARCHAR(100) UNIQUE NOT NULL,
FullName VARCHAR(100) NOT NULL,
Phone VARCHAR(15),
Address TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
-- Products table (future enhancement)
CREATE TABLE products (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
category ENUM('laptop', 'desktop', 'accessory') NOT NULL,
price DECIMAL(10,2) NOT NULL,
description TEXT,
specifications JSON,
image_url VARCHAR(255),
stock_quantity INT DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
-- Orders table (future enhancement)
CREATE TABLE orders (
id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT,
total_amount DECIMAL(10,2) NOT NULL,
order_status ENUM('pending', 'processing', 'shipped', 'delivered', 'cancelled') DEFAULT 'pending',
shipping_address TEXT,
payment_method VARCHAR(50),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id)
);-- Insert sample user
INSERT INTO users (Username, Password, Email, FullName, Phone)
VALUES ('admin', 'admin123', 'admin@techhub.lk', 'System Administrator', '+94112345678');
-- Insert sample user
INSERT INTO users (Username, Password, Email, FullName, Phone)
VALUES ('testuser', 'password123', 'test@example.com', 'Test User', '+94987654321');- Browse Products: Navigate through laptop, desktop, and accessory catalogs
- View Details: Click on products to see detailed specifications, reviews, and warranty
- Create Account: Register using the signup page
- Login: Access your account using the login page
- Add to Cart: Select products and add them to your shopping cart
- Checkout: Complete your purchase through the checkout process
- Product Management: Add new products by creating HTML pages following existing patterns
- Styling: Modify CSS files in
assets/css/for design changes - Functionality: Extend JavaScript in
assets/js/for new features - Database: Enhance PHP files for additional backend functionality
- Primary Blue:
#3182ce- Main brand color - Dark Blue:
#2c5aa0- Hover states and emphasis - Light Blue:
#4299e1- Accents and highlights - Text Colors:
#2d3748(dark),#4a5568(gray),#718096(light) - Success Green:
#38a169- Success states - Error Red:
#e53e3e- Error states - Warning Yellow:
#d69e2e- Warning states
- Primary Font: Inter (Google Fonts)
- Weights: 300, 400, 500, 600, 700
- Fallbacks: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif
- Buttons: Consistent styling with hover effects
- Cards: Product cards with shadows and hover animations
- Forms: Styled inputs with validation states
- Navigation: Responsive navbar with mobile menu
- Tabs: Interactive tab system for product details
- Admin Panel: Product management, order tracking, user management
- Shopping Cart: Persistent cart with session management
- Payment Integration: Stripe, PayPal, or local payment gateways
- Inventory Management: Stock tracking and availability
- Order Management: Order history and tracking
- Email Notifications: Order confirmations and updates
- Product Reviews: User-generated reviews and ratings
- Search Functionality: Advanced product search and filtering
- Wishlist: Save products for later
- Responsive Optimization: Enhanced mobile experience
- MVC Architecture: Implement proper Model-View-Controller pattern
- Database Optimization: Improved queries and indexing
- Security: Enhanced authentication and authorization
- API Development: RESTful APIs for frontend-backend communication
- Testing: Unit tests and integration tests
- Performance: Image optimization and caching
- SEO: Search engine optimization
- Lead Developer & Project Owner: Kavindya Kariyawasam
- Developer: Shehan Maleesha
- Developer: Manodi Gamage
- Developer: Lasini Pallewaththa
- Developer: Parindya Mullegama
- Repository: laptopStore-webProject
- Desktop Product Pages: Completely redesigned and modernized all desktop product detail pages (D1.html, D2.html, D3.html, D4.html) with consistent styling, responsive design, and modern component architecture
- Laptop Product Pages: Modernized laptop detail pages (L1.html, L2.html, L3.html, L4.html) with improved layout, interactive elements, and cohesive design system
- Accessory Product Line: Designed and developed comprehensive accessory product pages including:
mouse.html- Wireless Optical Mouse with complete specifications and reviewskeyboard.html- Mechanical Gaming Keyboard with switch details and RGB featuresearphone.html- Premium Wireless Earphones with ANC and audio specificationsspeaker.html- Portable Bluetooth Speaker with waterproof features and connectivity options
- Desktop Details CSS: Developed comprehensive styling system in
desktopDetails.csswith CSS custom properties, responsive grid layouts, and interactive components - Laptop Details CSS: Enhanced
laptopDetails.csswith modern design patterns, warranty container fixes, and mobile-first responsive design - Accessory Details CSS: Created unified
accessoryDetails.csssystem ensuring consistent styling across all accessory product pages - Component Standardization: Implemented consistent design patterns for product cards, tabs, rating systems, and interactive elements
- Interactive Features: Developed JavaScript functionality for image galleries, quantity controls, color selection, and tab navigation systems
- Responsive Design: Ensured all pages work seamlessly across desktop, tablet, and mobile devices
- Performance Optimization: Optimized CSS and JavaScript for better loading times and user experience
- Cross-browser Compatibility: Tested and ensured compatibility across major browsers
- Comprehensive README: Created detailed project documentation including:
- Complete project overview and feature descriptions
- Technology stack documentation
- Installation and setup instructions
- Database schema and configuration
- Usage guidelines and development workflows
- Future enhancement roadmap
- Code Documentation: Added inline comments and maintained clean, readable code structure
- Branch Management: Maintained organized development workflow with feature branches
- Commit Standards: Implemented clear commit messaging for better project history
- Code Review Process: Ensured quality through systematic code review and testing
- File Organization: Restructured project for better maintainability and scalability
- CSS Methodology: Implemented consistent naming conventions and modular CSS architecture
- Asset Management: Organized images, icons, and static assets for optimal performance
- Responsive Framework: Built custom responsive grid system using CSS Grid and Flexbox
- Design Consistency: Achieved unified design language across all product categories
- User Experience: Significantly improved navigation, product discovery, and conversion flows
- Code Quality: Established maintainable, scalable codebase for future development
- Documentation: Created comprehensive guides for future developers and contributors
- Performance: Optimized loading times and responsiveness across all devices
- Font Awesome: For providing excellent icons
- Google Fonts: For the Inter font family
- Google: For product images
- Community: For inspiration and feedback
Built with โค๏ธ for the tech community
Last updated: September 2025