Hi everyone,
I built Whisker because setting up a simple online store shouldn't require WordPress, Composer, or $39/month SaaS fees. It's a self hosted e-commerce cart in pure PHP + MySQL with no external dependencies.
Upload to any shared hosting, run the 6-step web installer, start selling. That's it.
What it does: product catalog with variants (Size × Color with individual SKU/price/stock per combo), 4 payment gateways (Razorpay, Stripe, CCAvenue, crypto), multi-currency, admin dashboard, order management, invoices, customer accounts, SEO engine with JSON-LD product schema, CSV bulk import, support tickets, coupon system.
Security: PDO prepared statements, bcrypt, CSRF, session fingerprinting, webhook signature verification, login rate limiting, upload MIME+extension validation.
~130 files, 25 tables, runs on PHP 8.0+ and MySQL 5.7+.
Demo: https://whisker.lohit.me
GitHub: https://github.com/WhiskerEnt/Whisker-Cart
I'd appreciate any feedback on the architecture or security. Happy to discuss technical decisions.
- a good chunk of data seems to be passed around in associative arrays; It would be much easier to understand, and enforce type safety if you use Model and/or DTO classes.
- you're storing currency amounts using decimals in the database which is fine, but using floats in the app code is a problem. Floating point maths is not precise. Either use integers (and convert to a float for display purposes) or use something like the BCMath extension.
- there seems to be huge swathes of inline styles in your views. This just sounds painful to manage/style/adjust over time.
- best practice is to have a subdirectory which is specified as the docroot and includes just the public assets (images, css, etc) and the front controller (index.php)
- your php code defaults to the currency symbol for Indian rupees but the stripe gateway at least defaults to USD.
reply