Blog
How Lodge Internet works, how to get the most from it, and what we've built along the way.
Signing in to a Wi-Fi controller with no browser, and the servers that logged each other out
To read a voucher's balance, our backend signs in to TP-Link's cloud the way a person at the dashboard would. The account allows one session at a time, and for a while our own servers kept signing each other out.
For engineers
One engine, three doors: how Lodge Internet is built
The website, WhatsApp and Telegram are three ways in to one backend that owns every price, stock count and balance. Here is how the pieces fit, and why the clients are kept deliberately simple.
For engineers
Small things that keep the website standing
Five small pieces of the Lodge Internet website that rarely get noticed, each written because something real went wrong without it, from stale tabs after a deploy to the Android back button.
For engineers
No token in JavaScript: cookie sessions and two API clients
Our website keeps every sign-in in a cookie no script can read, and a cookie only counts when the request says which part of the site sent it. This is the lesson that made us build it that way.
For engineers
Money arithmetic lives in one file
Why the browser never decides what a checkout costs, how the server quotes a total and checks the payment against that same total, and why partner payouts are worked out once, on the server, for every screen.
For engineers
Moving a live money system off Firestore without anyone noticing
On 1 October 2026 we moved every record from Firestore to Postgres. We did it by putting one interface in front of the database, teaching Postgres to answer exactly as Firestore did, and proving it byte for byte before the switch.
For engineers
Six characters aren't an address
Every Wi-Fi controller issues its own voucher codes, so the same six characters can exist on two networks at once. How a balance check works out which voucher you actually mean, and refuses to guess.
For engineers
Selling the last code exactly once
How the backend holds one Wi-Fi code for you before you pay, re-checks it inside the transaction, and makes the claim that hands it over safe to run twice.
For engineers
Making a website feel like an app
How we rebuilt the Lodge Internet website for a 360 px phone first, with colour tokens that flip for dark mode, glass bars, bottom sheets, and one Tailwind rule we learned the hard way.
For engineers
Leaving Firebase Auth in a day
On 2 October 2026 customer sign-in moved from Firebase Auth to our own backend. Nobody had to reset a password: we check Firebase's hashes with Firebase's own algorithm, then rewrite each one in ours the first time its owner signs in.
For engineers
Hostels by id, not by name
A hostel's name was its key everywhere, so renaming one left references behind and checks compared ids with names. How we're moving to ids, why a rename now runs references first and the hostel last, and why closing a hostel is a switch, not a delete.
For engineers
Credit first, then spend: the wallet that replaced three special cases
Every bank transfer now lands in the customer's wallet first, exactly once, and only then pays for whatever is waiting. Part-payments, overpayments and transfers with no order stopped being special cases.
For engineers
A device list with no "add one" button
TV access at a hostel is a list of device addresses on the Wi-Fi controller, and the controller only lets us replace the whole list at once. Here is how we stop two purchases from erasing each other.
For engineers
Designing a chatbot when every message costs money
From 1 October 2026, WhatsApp bills us for replies past a monthly allowance. How that changed the way our bot talks, when it chooses to say nothing, and the tests that stop a stray message creeping back in.
For engineers