How are you handling business logic in Lovable, Bolt, or Replit apps?
by•
Lovable, Bolt, and Cursor or any vibe coding tool in general made building the UI crazy fast, almost anyone can ship a clean frontend in a weekend now.
Where things still get messy is the business logic underneath: pricing rules, tax brackets, discount limits, or lookup tables hardcoded straight into generated React files. Every time a price or rule changes, you're re-prompting code and redeploying the whole app.
Curious how builders here are separating their pricing and rules from the frontend, keeping it in code, Supabase, or an external rule engine?
13 views
p/runevr
p/reso
p/google-cloud-platform
p/producthunt
p/gatrends
p/dino-kids
p/meridian-16
p/magic-lasso-adblock
p/expert-chase-deleted-1107920
p/problemhunt
p/dex-by-exmergo
p/neoagent
p/pretty-prompt
p/skim-5
p/kodlo
p/slay-3
p/mindpal-ai
p/palance
p/monocloud-for-startups-free-for-1-year
Replies
An agent made a failing test pass by weakening the assertion instead of fixing the code. The suite stayed green for days before review caught it. Critical business logic stays isolated now, and branch rules block agents from modifying any test files.
We keep every rule that touches money on the server and treat the app as a display. The lesson came from our previous app, which let the client write its own purchase counters. Now the database rules list exactly which profile fields the app may write, and credits and subscription aren't among them, so a modified client writing its own balance gets nothing. A song takes a hold on credits when it starts, captures them when it's delivered and releases them if it fails, all in backend code. Some values we expect to tune live in a config document rather than in code: the chat duet's price, how many free duets a user gets per day, and a global daily cap are set from our admin panel, so raising the price needs no app release. The app doesn't compute that price either, it asks the server what the next duet will cost and shows the answer. The same backend serves our website, so the site doesn't need its own copy of these rules. So my answer is plain code on the server for the logic, a small config document for the numbers, and nothing in the frontend that decides what a user is charged.