// in brief
- A vibe-coded app that runs isn't a protected app: the risk isn't in the code, it's around it.
- The database is never accessible on the internet, and the API checks a token on every call.
- Three environments at minimum: development, stage, prod. Stage is an exact replica of prod.
- Automated user tests, then documentation that says why things are done this way.
Your application is vibe coded, it runs, you have your first clients. Congratulations. And yet, it could crash as soon as tomorrow.
Recently, I had a call with someone in exactly this situation. Their application, vibe coded, was running at their clients'. But on the architecture side, there was only their local computer and their clients' environment. Nothing to protect it.
AI writes good code. The problem isn't the code, it's everything around it.
In this article, I go over what I deliver around each of the custom web applications I develop, for an architecture that holds up. Four topics: the database, the environments, the tests and the documentation.
1. The database: protecting your data
An application is three building blocks. The front, what the user sees on screen. The API, which does all the work behind it. And the database, where the data is stored.
What the user sees. An interface, nothing more.
What does the work. It checks who's talking to it on every call.
Where the data lives. Only the API is allowed to talk to it.
Rule #1: the database never on the internet
The database must never be accessible on the internet. The rule is simple: only your API is allowed to talk to your database.
Rule #2: the API checks who's talking to it
An email and a password aren't enough. They live at the front level, which is only an interface to make use easier. Anyone can talk directly to your API, without going through the front.
So your API has to check for itself who's talking to it: that's the role of the token. No token, or an invalid token, no response.
Data is all that matters
You lose your front or your API, it's not a big deal: you can rebuild them. You lose your database, it's over.
At a client I work with, we collect more than 3,000 leads per day. Losing the forms that collect them isn't a big deal. Losing the database, the one their CRM reads, is a real problem. Stay in control of your database and make regular backups.
Fluvia · Dashboard & CRMCRM dashboard for 3,000 leads a day
Every lead structured and qualified, all the forms managed from a single screen.
Before going live, you must be able to answer these questions clearly:
- How is your database secured?
- Where is it hosted?
- Who can access it, and how?
If you hesitate on even one of these answers, there may be a problem.
2. Dev, stage, prod: the environments
Your data is secured. One question remains: how do you put your application online without breaking everything? This is where we really get into architecture, because you need several working environments.
Dev and prod aren't enough. You work on your computer, you didn't notice that something stopped working, you push straight to prod: if it breaks, your users can no longer use the application. Same thing if your release script makes a wrong move.
| Environment | Who goes there | What it is for |
|---|---|---|
| Development | You, locally | Build the features |
| Stage | You | Test the deployment in a replica of prod |
| Prod | Your users | Run the application |
I recommend three environments at minimum, and your application goes through all three, one after the other. Stage is a replica of prod: same servers, same architecture. Except it isn't your users who test, it's you.
What local doesn't show: the network
On your computer, the front, the API and the database are in the same place. Nothing goes through the internet, everything is instant. On servers, everything goes through the network. Stage lets you check that no link in the chain is broken.
3. User tests
Your application is online and everything works. How do you make sure it still works in three months?
Unit tests, which test the code, aren't enough. You need user tests: tests that launch your application and do what a real user would do. It's the only way to know it really works, and they can be automated.
The result: nothing breaks when you add a feature. The tests tell you whether it works. They don't tell you why things were done a certain way.
4. Documentation (and BMAD)
Whether you develop by hand or vibe code, write documentation. It may seem useless, yet it's the most important thing. The docs keep a record of what was done, and above all of why it was done that way.
At first, the application is simple, you keep everything in your head. When it grows, the questions come:
- How do you make sure a new feature doesn't break, or overwrite, the old one?
- How do you remember why things were done a certain way?
- How do you know AI won't contradict what was done before?
The answer to all of this: documentation and specifications. To manage it, I use BMAD, a method I'll probably dedicate a video to. You can already look into it, it's a good start.
For Korya, a web agency, I developed a cockpit: CRM, onboarding, project preparation, SEO reporting, AI agent. With that many features, without documentation, each new one risks breaking the old one. That's why I deliver documented projects.
Korya · Web agencyInternal cockpit driven from Claude
Automated onboarding, production and reporting: 2 to 3 days gained per week.
I specify, AI codes
The way applications are built has changed. AI writes code, and even very good code. Before, my work as an engineer was writing specifications and then developing the features that meet them.
Today, I write the specifications and AI codes. If you don't tell it exactly how to do it, it executes anyway: sometimes badly, often because it didn't understand what you wanted.
You put together your application, vibe coded or not, and you want to know whether it will hold up over time, or what needs improving in its architecture? I can audit it.
Frequently asked questions
Because the code generated by AI is often good, but nothing is put in place around it: exposed database, no test environment, no user tests, no documentation.
No, never. Only your API should be able to talk to it, and the API checks a token on every call.
Three at minimum: development, stage and prod. Stage is a replica of prod where you test the deployment and network behavior before your users.
No. They test the code. User tests launch the application and reproduce what a real user would do, and they can be automated.
To keep a record of what was done and why, to prevent a new feature from breaking the old one, and to keep AI from contradicting what exists. I use the BMAD method.
Amory Rouault · Freelance AI engineer
I design and code AI agents, automations and custom applications. On YouTube, I share what I learn in the field.
Will your app hold up over time?


