Tribhuvan University (TU) — BCA (Bachelor of Computer Application) 4th & 5th Semester E-Commerce Web Application (Project-I / Project-II)
A production-grade, full-featured Jewellery Shop E-Commerce Web Application designed specifically for online jewellery retail in Nepal. Developed using purely fundamental web technologies (Vanilla HTML5, CSS3, ES6+ JavaScript, Core PHP, and MySQL) with zero heavy frameworks, implementing strict industry-standard modular architecture (MVC principles), clean relational database schema, secure authentication with OTP verification, and multi-gateway online payments (eSewa & Khalti).
- Repository Name:
jewellery-shop-ecommerce-project - Academic Program: Tribhuvan University (TU) — BCA (Bachelor of Computer Application)
- Course Modules: Project-I (BCA 4th Semester) / Project-II (BCA 5th Semester) / E-Commerce Project / Web Technology Project
- Target Domain: Traditional & Modern Jewelry Retail Industry in Nepal
- Keywords:
TU IT Project,BCA Project-I,BCA Project-II,Tribhuvan University BCA,PHP MySQL E-Commerce,eSewa Payment Gateway Nepal,Khalti Payment Gateway Nepal,Core PHP E-Commerce Project
| Layer | Technology Used |
|---|---|
| Frontend | Vanilla HTML5, Custom CSS3 (Flexbox/Grid), Native JavaScript (ES6+) |
| Icons & Typography | FontAwesome 5.15.4, Google Fonts (Inter) |
| Backend Architecture | Core PHP (Modular & Procedural with strict separation of responsibilities) |
| Database | MySQL / MariaDB (Relational DB with foreign key constraints & cascading deletes) |
| Mailing System | PHPMailer via Mailtrap / SMTP (HTML Email Templates with OTP verification) |
| Payment Integration | eSewa v2 (HMAC-SHA256 Signature Verification) & Khalti Web Checkout (KPG-2 Lookup API) |
- Hero & Interactive Catalog: Dynamic product showcase with category filtering, search bar, and sorting.
- Cart & Checkout Flow: Item management, delivery address verification, fee calculation, and real-time toast alerts.
- Online Payment Processing: Integrated eSewa v2, Khalti v2, and Cash on Delivery (COD) with automatic abandoned order handling.
- User Security & Authentication: User registration, password reset with 6-digit OTP verification via PHPMailer.
- Profile & Order Tracking: Live order status history (
Pending,Confirmed,Shipped,Delivered,Rejected,Failed,Cancelled).
- Financial Analytics & Revenue Overview: Real-time earnings summary showing Net Delivered Revenue, Confirmed Incoming Value, Pending Orders Value, and Rejected/Cancelled counts.
- Product Management (CRUD): Add, view, edit, search, update stock, and delete products with image upload management.
- Category Management (CRUD): Organize products into traditional Nepali categories (Tilhari, Pote, Rani Haar, Jhumka, Chura, Nathiya, Gold Rings, Bridal Sets).
- Order Processing: Update order status with colored badge indicators and view itemized order invoices.
- User Management: Monitor registered customer accounts and verification statuses.
⚠️ IMPORTANT: You MUST import the SQL database file first. Importing this file seeds the initial database tables, default admin login accounts, sample categories, and products. If you do not import this file, admin login and product display will fail!
-
Start XAMPP / WAMP:
- Launch XAMPP Control Panel and start Apache and MySQL services.
-
Import Database Dump (Seed Data):
- Open phpMyAdmin in your browser:
http://localhost/phpmyadmin - Click on the Import tab.
- Choose the SQL seed file located at:
database/jewelry_shop.sql - Click Go to execute. The database
jewelry_shopwill be created automatically with all seeded tables, products, categories, and admin accounts.
- Open phpMyAdmin in your browser:
-
Database Connection Configuration:
- File Path:
config/db.php - Ensure your database connection settings match your local environment:
$host = 'localhost'; $user = 'root'; $pass = ''; $dbname = 'jewelry_shop';
- File Path:
- Admin Login Route:
http://localhost/jewelry-shop/admin - Default Seeded Admin Accounts:
- Super Admin Email:
admin@gmail.com - Password:
admin(stored securely using password_hash bcrypt) - Secondary Admin 1:
suman.admin@gmail.com| Password:admin - Secondary Admin 2:
aarav.admin@gmail.com| Password:admin
- Super Admin Email:
To enable OTP verification emails for registration and password resets, configure your SMTP / Mailtrap credentials in config/mail.php:
// File: config/mail.php
define('MAIL_HOST', 'sandbox.smtp.mailtrap.io'); // Or your SMTP host
define('MAIL_PORT', 587);
define('MAIL_ENCRYPTION', 'tls');
define('MAIL_USERNAME', 'YOUR_MAILTRAP_USERNAME'); // Replace with your credentials
define('MAIL_PASSWORD', 'YOUR_MAILTRAP_PASSWORD'); // Replace with your credentials
define('MAIL_FROM_EMAIL', 'noreply@jewelryshop.com');
define('MAIL_FROM_NAME', 'Jewellery Shop');Configure eSewa and Khalti API credentials in config/payment.php:
// File: config/payment.php
// eSewa Sandbox Setup
define('ESEWA_PRODUCT_CODE', 'EPAYTEST');
define('ESEWA_SECRET_KEY', '8gBkn4kZchycDACm');
define('ESEWA_FORM_URL', 'https://rc-epay.esewa.com.np/api/epay/main/v2/form');
define('ESEWA_STATUS_URL', 'https://rc.esewa.com.np/api/epay/transaction/status/');
// Khalti Sandbox Setup
define('KHALTI_SECRET_KEY', '96271831a4e445008be39596e0943e29'); // Put your Khalti Secret Key here
define('KHALTI_PUBLIC_KEY', '1a2c64a484ec43bf8a06da6d3f96dcd1');
define('KHALTI_INITIATE_URL', 'https://dev.khalti.com/api/v2/epayment/initiate/');
define('KHALTI_LOOKUP_URL', 'https://dev.khalti.com/api/v2/epayment/lookup/');- Test Mobile Numbers:
9806800001,9806800002,9806800003,9806800004,9806800005 - Password:
Nepal@123 - MPIN:
1122 - Test Token / OTP:
123456
- Merchant Sandbox Portal: Register as a merchant at Khalti Test Admin Portal.
- Sandbox Login OTP:
987654 - Test Khalti Mobile IDs:
9800000000,9800000001,9800000002,9800000003,9800000004,9800000005 - Test MPIN:
1111 - Test OTP:
987654
jewelry-shop/
├── actions/ # Business logic handlers (place-order, cart-actions)
├── admin/ # Admin panel dashboard & management views
│ ├── actions/ # Admin AJAX & form processors
│ ├── assets/ # Admin CSS and JS assets
│ ├── includes/ # Admin header, sidebar & footer
│ ├── index.php # Admin dashboard with financial metrics
│ ├── products.php # Product catalog CRUD
│ ├── categories.php # Category management CRUD
│ ├── orders.php # Order status management
│ └── users.php # Registered users list
├── assets/ # Public CSS, JavaScript & icon assets
├── config/ # Configuration files
│ ├── constants.php # Global paths and site constants
│ ├── db.php # Database connection file
│ ├── mail.php # Mailtrap / SMTP config
│ ├── mailer.php # PHPMailer template service
│ └── payment.php # eSewa & Khalti gateway credentials
├── database/ # Database seed file (jewelry_shop.sql)
├── includes/ # Public header, footer, toast notices
├── payments/ # Gateway controllers (eSewa & Khalti handlers)
├── uploads/ # Product and category image uploads
├── index.php # Homepage & Hero Banner
├── shop.php # Product catalog & filters
├── product-details.php # Product detail view
├── cart.php # Shopping cart view
├── checkout.php # Checkout form & payment selection
├── profile.php # User profile & order tracking
├── register.php # User registration
├── verify-otp.php # OTP verification view
└── README.md # Project documentation
- Developer: Mahendra Mahara
- GitHub: @mahendramahara
- LinkedIn: Mahendra Mahara
Developed for Tribhuvan University (TU) BCA Degree Requirements.