A full-stack e-commerce application mimicking a luxury retail experience. Built with vanilla PHP, MySQL, and modern JavaScript (ES6+).
- Secure Authentication: User registration/login with Bcrypt password hashing.
- Database-Persisted Cart: Shopping carts are stored in MySQL and sync across devices (session-independent).
- Admin Dashboard:
- Full CRUD operations for Products (Add, Edit, Delete).
- Secure image upload handling (whitelist validation).
- Order management and tracking.
- Role-Based Access Control (RBAC): distinct
customerandadminroles. - Asynchronous UX: Seamless "Add to Cart" and updates using Fetch API (no page reloads).
- Responsive Design: Mobile-first CSS layout.
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Backend: PHP 7.4+ (OOP, PDO/MySQLi)
- Database: MySQL (Normalized Schema: Users, Products, Cart, Orders)
- Server: Apache (XAMPP/LAMP)
lv-ecommerce/
├── css/ # Stylesheets (main, shop, cart, admin)
├── js/ # JavaScript modules (Auth, Cart AJAX, Admin CRUD)
├── php/ # Backend Logic
│ ├── db.php # Database connection
│ ├── auth/ # Login, Register, Session management
│ ├── cart/ # API endpoints for Cart operations
│ └── admin/ # Product management API
├── database/ # SQL Schema (setup.sql)
├── uploads/ # Product images
└── index.html # Entry point- Clone the repo:
git clone https://github.com/nahiketema/lv-ecommerce.git
- Set up the Database:
- Import
database/setup.sqlinto your MySQL server (via phpMyAdmin or CLI). - Configure
php/db.phpwith your DB credentials.
- Import
- Run:
- Serve the project folder using XAMPP/Apache.
- Visit
http://localhost/lv-ecommercein your browser.
This project is open-source and available under the MIT License.
