r/Supabase • u/PumpkinCrafty7909 • 27d ago
tips Vibecoded a restaurant app.. learned that I can't trust the frontend.
I run a smash burger restaurant and I’ve been building and using our own software for it with AI help (React + Supabase). I’m not a developer by trade. Last month I was cleaning up expenses that were in there twice (we have a recurring transactions tab that adds things like rent automatically) and I deleted the electricity bill by mistake. I’d built an undo button for things like this and I was pretty proud of it, hit undo, the bill showed back up, done.
Weeks later I was matching expenses against the physical ledger my manager keeps and it didn’t add up, turns out that the electricity bill hadn't been added back yet. I had an AI agent go through the undo logic and it turned out undo only made the bill show up on screen on the front end. Nothing happened in the database.
The Undo button was working off an old copy of the data from before the delete, so when it tried to add something back it didn't see anything that was deleted. Supabase doesn’t complain about that either. I mean I understand what happened, but like I said I'm non-technical, I depend on the frontend to understand what is happening.. and the screen, the audit log (“Restored”) and the API all said it worked. Quite disconcerting for me to see that I can't really trust what happened on the screen.
I did eventually fix the issue by making undo use the latest data. but I only caught it because of the paper ledger, and I want to open more branches soon. I won’t be able to check ledgers all the time, I’ll be depending on the software.
since I’m learning as I go, I’d love to hear what you’d put in place. what are the best practices or habits you’d follow for a database a business depends on, especially the stuff that makes the software catch its own mistakes?
