How rizwan17/ecommerce works
Purpose and entry points
This is a PHP/MySQL storefront with customer registration, login, product browsing, cart/checkout, and an administrative catalog/customer/order dashboard. Public entry points include index.php, login.php, register.php, cart.php, and profile.php; administrative access begins at admin/login.php and admin/index.php.
Public storefront and customer sessions
Customer-facing pages render the catalog and account experience, while request handlers perform authentication and account changes. Key paths are index.php, login_form.php, customer_registration.php, and logout.php. Shared database access is exposed through db.php, creating a boundary between page/controller scripts and persistence.
Cart, order, and payment flow
The purchase flow is form/action driven: cart.php presents cart state, cart_process.php mutates it, and customer_order.php creates or presents customer orders. Payment outcome endpoints are payment_success.php and cancel.php, indicating a redirect/callback boundary with an external payment provider, though provider-specific integration code is not present in the tree. action.php is likely a shared AJAX or request-dispatch endpoint.
Administration domain
The /admin area separately manages dashboard access and commerce records. admin/index.php is the dashboard entry, with dedicated management pages at admin/products.php, admin/categories.php, admin/brands.php, admin/customers.php, and admin/customer_orders.php. Administrative authentication lifecycle is handled by admin/login.php, admin/register.php, and admin/admin-logout.php.
Admin application layer
The admin domain has explicit class-based model/service wrappers, unlike the mostly page-oriented public side. admin/classes/Database.php centralizes admin persistence connectivity; admin/classes/Admin.php and admin/classes/Credentials.php support administrator identity/access; admin/classes/Products.php and admin/classes/Customers.php represent primary managed entities. This is the clearest internal abstraction boundary in the repository.
Persistence and catalog assets
MySQL schema/data is captured in database/khanstore.sql; runtime connection constants appear in config/constants.php and public DB setup in db.php. Product media is filesystem-backed under product_images, rather than an object-storage integration. Products, brands, categories, customers, and orders appear to be the central relational domains.
Runtime and presentation infrastructure
The application requires a PHP-capable web server and MySQL-compatible database. It uses server-rendered PHP templates in the admin area (admin/templates/top.php, admin/templates/navbar.php, admin/templates/sidebar.php) and browser-side JavaScript for admin interactions (admin/js/products.js, admin/js/categories.js). UI dependencies are vendored Bootstrap and jQuery assets under css/bootstrap.css, js/bootstrap.js, and js/jquery2.js.
Components 17
Public Storefront
Customer-facing PHP pages and handlers.
- Storefront Pages · Catalog, login, registration, cart, and profile entry points.
index.php - Customer Auth · Processes login, registration, and logout.
login_form.php - Public DB Access · Shared persistence boundary for public scripts.
db.php - Cart Processing · Presents and mutates cart state.
cart_process.php - Orders & Checkout · Creates or presents customer orders.
customer_order.php - Payment Provider · Redirect/callback integration is implied by outcome endpoints.
- Payment Outcomes · Success and cancellation return endpoints.
payment_success.php
Administration
Separate dashboard and catalog management area.
- Admin Dashboard · Dashboard plus product, category, brand, customer, and order management.
admin/index.php - Admin Authentication · Administrator login, registration, and logout lifecycle.
admin/login.php - Admin Models & Access · Admin identity, credentials, products, and customers abstraction layer.
admin/classes/Admin.php - Admin Database Layer · Central admin persistence connectivity.
admin/classes/Database.php - Admin Templates · Shared top, navbar, and sidebar layout.
admin/templates/top.php - Admin JavaScript · Product and category interactions.
admin/js/products.js
Persistence & Assets
Shared relational data and product media.
- MySQL Store · Products, brands, categories, customers, and orders.
database/khanstore.sql - Product Images · Filesystem-backed product media.
product_images
Other components
- PHP Web Server · Serves page-oriented PHP entry points.
- Vendored UI Assets · Bootstrap and jQuery assets.
css/bootstrap.css
Connections 21
- PHP Web Server → Storefront Pages: serves
- PHP Web Server → Customer Auth: routes requests
- PHP Web Server → Cart Processing: routes requests
- PHP Web Server → Orders & Checkout: routes requests
- Storefront Pages → Public DB Access: queries
- Customer Auth → Public DB Access: authenticates via
- Cart Processing → Orders & Checkout: checkout
- Orders & Checkout → Payment Provider: redirects to
- Payment Provider → Payment Outcomes: returns outcome
- Public DB Access → MySQL Store: reads and writes
- PHP Web Server → Admin Dashboard: serves
- PHP Web Server → Admin Authentication: routes requests
- Admin Dashboard → Admin Models & Access: manages through
- Admin Authentication → Admin Models & Access: uses
- Admin Models & Access → Admin Database Layer: persists through
- Admin Database Layer → MySQL Store: reads and writes
- Admin Dashboard → Admin Templates: renders with
- Admin Dashboard → Admin JavaScript: enhanced by
- Admin Models & Access → Product Images: manages media
- Storefront Pages → Vendored UI Assets: loads
- Admin Templates → Vendored UI Assets: loads