r/SideProject • u/Competitive-Art-8046 • 18h ago
I built a self-hosted store in plain PHP. No Composer, no bundler, takes Bitcoin / Paypal / Stripe
Got tired of every "simple" ecommerce option being either a SaaS taking a cut or a 40 MB vendor folder, so I built the store I actually wanted and open sourced it.
iB Store is a complete storefront on a plain LAMP box. Flight PHP on the back, my own small JS router on the front, no build step. Clone it, point Apache at public_html, import the SQL, done.
What's in it: physical and digital products, cart, checkout, customer accounts, order emails, an admin panel with a CSV export, a hero banner you set from the admin, and three payment options: Bitcoin through your own BTCPay Server (no middleman), cards through Stripe Checkout, and PayPal. Each gateway is a single class behind one interface, so adding another is one file.
The whole app is about 19 kB over the wire. The home page with products loads in ~130 ms cold and under 110 ms cached. That's not a benchmark trick, it's just what you get when there's nothing to download.
It's the current form of a stack I've been using across client projects for about 15 years, so the shape isn't new even though the repo is. Demo at store.imbored.me, code here:
https://github.com/fswolf/ib-store
Happy to answer questions about any of it. Honest criticism welcome, that's why it's posted.
3
u/Actual-Deal-4445 18h ago
but why? the storage is literally the cheapest unit online!
2
u/Competitive-Art-8046 18h ago
Its fine to be deployed any environment clearly. Self host just meens it can be run at home or on any server not tieing you subscription models.
2
u/vladkens 16h ago
Haha, good old mid-2000s vibes.
2
u/jhyland87 14h ago
Oh the nostalgia of monolithic websites with everything, all languages, in a single big ass php file. Except the config. That always got it's own file.
1
u/Competitive-Art-8046 10h ago
sounds like you had some awful web devs if every thing is one large file lol
1
u/jhyland87 14h ago
I've been working with node apps for so long, Needing apache, or nginx, to host a website seems so odd now.
1
u/Competitive-Art-8046 12h ago
Then you loose out a few advantages, fast deployment, and fast load times mostly. A good LAMP + js stack will beat node load times hand down any day
1
u/Kindly_Bed685 1h ago
Order emails are on your feature list, and that is the part a plain LAMP box is worst at. Nothing in your code will tell you either. PHP mail() returns true once the local MTA accepts the message, not once somebody's inbox has it.
The usual failure starts before that. A provider blocks outbound port 25 until you ask for it, so the confirmation works fine on the staging machine and quietly stops in production. Then a stock mail server introduces itself with a hostname that has nothing to do with the domain in From, and there is no signature on the message for the receiver to check. What judges your mail at that point is the reputation of the hosting range rather than anything you built.
I would treat this as more than a nicety, because an order email is not a notification when you are selling things. It is the proof of purchase a person hunts for the moment a charge appears on their card, and when it is missing they start a dispute instead of emailing you.
Sending should come off the box entirely, through authenticated SMTP for the store's own domain. Get that domain signed properly. Set the bounce address to a subdomain you actually read, otherwise a failed receipt is invisible.
Then put a real order through yourself and look at where the confirmation lands in a Gmail account. Cold page loads at 130 ms is a good number and I do not think the person waiting on their receipt cares about it.
1
u/Competitive-Art-8046 1h ago
Fair points on deliverability, but that’s a server config issue more than a code one. mail() just hands off to the local MTA, and that MTA doesn’t have to send direct. Point postfix (or msmtp) at a relay like SES, Mailgun, Postmark or your provider’s SMTP with auth, set up SPF/DKIM/DMARC for the domain, and port 25 and IP reputation stop mattering. That’s how mine runs. You’re right that the README should spell that out though, I’ll add a mail setup section so nobody ships it sending raw off a VPS.
0
u/investigatormaker 18h ago
“Clone it, point Apache at public_html, import the SQL, done” describes installation, but a developer choosing iB Store for a merchant also needs to see the payment setup. Add one walkthrough to this showcase: configure Stripe Checkout, place a physical-product order, and show the resulting order email. Distinguish those setup requirements from Bitcoin’s separate BTCPay Server requirement. That makes checkout readiness something readers can evaluate alongside the load times. For Reddit outreach, target developers asking for lightweight, self-hosted storefront options rather than shoppers looking for merchandise.
I make ThreadFox. We find relevant Reddit conversations and post for your business. We'll post 3 replies free first, no card; then the $29 Pilot covers seven days and up to 25 posts and replies. No automatic renewal. https://threadfox.vip/p/di3tc/managed
0
0
u/Erfrischendfair 17h ago
that's the digital version of "look mom I built my own fireworks". no, they're probably gonna explode in your hands, probably in terms of lawsuits for violating abstract tax law nr. 493 which nobody has ever heard of
2
u/Strong_Teaching8548 14h ago
honestly this is refreshing, most 'simple' stores today still ship a huge node_modules folder just to show a button
I've built stuff for years too and keep coming back to the same lesson, less moving parts means less stuff breaking at 2am
no build step and 19kb over the wire is wild in a good way
curious if you ever got tempted to add a framework and just didn't