Skip to content

Franz Franz

goFranz // personal journal all writing
Opinion · ai

A Doctor Vibe-Coded His Practice Software. Here's What I Found.

Notes from porting a web and mobile app built with Claude, by someone who has never written code.

I’m currently porting an application that was written by a doctor, using Claude (through the web interface). He has never written a line of code in his life. Over roughly six months, he built a web app for staff and a mobile app for patients that way, and had Claude set up everything around it as well: the GitHub repositories, the Supabase backend, the deployments.

In numbers, that’s about 840 commits across two repositories, between June and November. It works: You can log in, book, record, pay. And he was able to put his own requirements, and the way his practice actually runs, straight into the software, without a developer translating it for him. The software does what his practice needs, because he described it himself.

Now I’m going through it, to get it into a state I can deploy. Here’s what that looks like.

What I found

The setup first. The code was spread across two repos that share one database, so a schema change for one app can break the other. The database itself was built by 190 SQL scripts, numbered and run by hand, in order, against the hosted project. A number of server-side functions weren’t in either repo at all; they only existed on the backend. The mobile app’s web build was deployed by committing the compiled output: 77 commits that change nothing but build artifacts. And the app shipped with the production backend as its default, so a local build without configuration talks to production.

None of that is a security problem by itself. It does mean that nobody, human or chatbot, could rebuild the system from the repositories.

Then the security review. These are the findings that matter, simplified:

  1. Anyone on the internet could read treatment records, names and diagnoses included, without logging in. A handful of database functions run with elevated privileges and never check who’s calling. Everywhere else, row-level security protected the data; these functions bypass it.
  2. Anyone could also mark those treatments as completed or cancelled, again without an account. Same pattern, writing instead of reading.
  3. Payment slips were public. Anyone could list and read the storage bucket holding bank transfer screenshots, and any logged-in user could replace anyone else’s slip.
  4. Every staff account could read and edit every patient, whatever its role. Reception had the same access as the doctor. Patients sign a consent form that’s meant to control exactly this; it had no effect on what staff could see.
  5. Patients could edit fields they had no business editing: their own appointment status, visits marked as already completed, and their own patient number. That last one is fun: a patient who sets it to something non-numeric breaks the numbering for every new patient after them.
  6. Signing up was open, with no email confirmation and a 6-character minimum password. So “logged-in user” in point 3 means anyone with an email address.

The root cause of the first two is a single default: In Postgres, every new function is executable by everyone, anonymous users included, unless someone explicitly revokes that. 143 of 236 privileged functions were callable that way. Most of them check the caller themselves; the ones above don’t.

Of course, none of this is unique to AI. I’ve seen every item on that list in code written by developers with years of experience. The difference is that a developer, or at least a reviewer, usually knows these categories exist. Here, nobody was in a position to ask “who else can call this?”, and Claude only did what it was asked.

I’m fairly sure someone else would have found most of this within days of going live. The data involved is health records and payment details.

Supabase is not the problem

It’s tempting to blame the backend. I don’t think that’s fair. Supabase did what it says: a Postgres database with row-level security, storage, auth and functions, all reachable from the client. That model gets you something running fast, and it’s the reason a non-developer could get this far.

The catch: The security model lives in the database, in policies and grants and function settings, and you can’t see any of it from the app. The app works either way. And because so much of the logic sits in Supabase-specific pieces, moving away from it later is close to a rewrite. That isn’t wrong, but it’s a decision nobody was in a position to make.

So what’s needed?

I don’t think the answer is more agents, and I’m not convinced it’s “hire someone to write the code” either. Agents will get better over the next months and years. But if you don’t know what you’re looking at, you rely on whatever the chatbot tells you, and click accept on things you can’t evaluate.

What was missing here is someone who understands how these systems fit together: what’s secure, what’s maintainable in a year, what scales, and what you’ll regret. That person might not write much code in the future. But they’d draft the plan before the first prompt, decide where the logic lives, set the defaults, and review what comes back. Even a page of that at the start would have prevented most of the list above.

I use AI every day, for most of my work. You still need a capable developer, or a good team, on your side - less for the typing, more for the choices that decide whether the application can grow.

In this case, the vibe-coded version did its job: It’s a better requirements document than most I’ve been handed. I know exactly what he wants, and how his day works. What’s left is making it safe to deploy, and easy to scale.