Whisker – Self hosted e-commerce cart, pure PHP, zero dependencies

4 points by eLohith 7 hours ago

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.

fcarletti 5 hours ago

That’s seems to have give you a lot of fun and learnings, writing everything by yourself forces you to understand how things work, kudos for that!

The code is very well organized, I’m on my phone and could easily navigate it.

But some stuff twists my nose: 1. No dependencies is cool up to some point, I personally do not try that so I avoid reinventing the wheel. You are prone to have many bugs the community already solved, the trade off end up not being worth the hassle.

2. I see you have many classes but many ones with only static methods. That’s basically global functions that can’t be easily mocked for unit tests and create highly coupled code.

3. Lack tests. Even though you may know the functionality/code from top to bottom, no tests make you prone to break unrelated stuff when writing new code.

Again, nice to see it, awesome you shared! If you want to step up the game https://phptherightway.com/ has a lot of material and references for that.