How to build a web app with AI
Jul 20, 2026 · 10 min read · By Marcus Lee, Engineering
You build a web app with AI by scoping one feature at a time, handing it to an agent that writes the front-end and back-end code together, running your test suite on the result, and reviewing the pull request before you merge. The demos that build a whole app from a single prompt are real, but they produce a starting point, not a maintainable product. The dependable way to ship is closer to how you already work: small, reviewed changes, one after another.
This guide walks through that loop for a team that has a real codebase, or is starting one they intend to keep. It is not about no-code builders that generate a throwaway site. It is about using an AI agent as a working member of a web team.
Start from a repo, not a blank prompt
The single biggest decision is where the code lives. A prompt-to-app tool that hosts everything inside its own platform is fine for a quick prototype, but the moment you want your own stack, your own deploy pipeline, and code your team can read, you want a normal Git repository. Begin with a minimal scaffold in the framework you actually use, commit it, and put it on GitHub or GitLab.
From there, an agent works the way a developer does: it reads what is already there and adds to it. That grounding is what makes the output mergeable instead of a parallel codebase you have to reconcile. An AI web developer that edits your real repository and opens a pull request keeps you inside the tools your team already trusts, rather than a walled sandbox you have to escape later.
What can AI build for a web app, and what should stay with you?
Scope tracks how well the task is bounded and whether there is a way to check the result. Web work splits cleanly along that line, which is why so much of it is a good fit for an agent and a specific slice is not.
| Hand to the agent | Keep for a person |
|---|---|
| A page or component wired to an existing API, with loading and error states | Information architecture and the core user flows |
| A CRUD feature end to end: migration, model, endpoint, form, tests | Visual design and brand, where "correct" is a matter of taste |
| Integrating a documented third-party API | Security and performance calls on critical paths |
| Accessibility and responsive fixes, and backfilling tests | Deciding what the product should do next |
The pattern is that agents are strong at the bounded, testable middle of the work and weak at the two ends: deciding what to build and judging whether it feels right. Keep those with your team and let the agent do the volume in between. For the mechanics of turning a description into working code, see code generation.
Build one feature at a time, as a pull request
Resist the urge to ask for the whole app. Break the product into features the size of a single pull request, and hand them over one at a time. "Add a user settings page with name, email, and password change, following the pattern in the dashboard page" is a task an agent can finish and you can review in one sitting. "Build the account system" is not.
Each task should carry three things: the outcome you want, an example in the codebase to follow, and a way to check the result. When those are present, the agent plans the change, edits every file it touches, runs your tests, and returns a pull request. When they are missing, it guesses, and you spend the time you saved on rework. We cover the specifics in writing a task for an AI coding agent.
Some features pull in the outside world. If your app needs to read and act on incoming mail, for instance, you can point it at a service that connects every mailbox in one place and have the agent build the handling around it. The agent writes the integration; the service supplies the plumbing it integrates with.
Let it run your tests, then review like you mean it
The reason to route agent work through pull requests is that it lands inside the checks you already run. Your linters, type checks, and test suite run on the agent's PR exactly as they would on a colleague's. That is your first line of defense, and it is why a real test suite is the highest-leverage thing you can give an agent: it lets the agent catch its own mistakes before you ever see the diff.
Your review is the second line, and it is not optional. Read the plan before the diff so you can correct the approach cheaply, then read the diff the way you would review a teammate: does it fit the codebase, does it handle the edge cases, does it do only what you asked. Review-first is the whole point. A good agent never merges on its own, so a person stays accountable for every change that ships. If you want the reasoning behind that stance, is AI-generated code safe for production lays it out.
How long does it take to build a web app with AI?
A working prototype can take an afternoon; a maintainable product takes as long as the review and the hard decisions take, which is most of the real time. AI compresses the writing of the code, not the thinking about what to write or the checking of what came back. Teams that adopt agents tend to ship more features with the same people, because the routine build work stops being the bottleneck. The bottleneck moves to review capacity and to deciding what matters, which is where you want it.
So the honest timeline is: faster on the parts that were always mechanical, unchanged on the parts that were always judgment. Plan the project around that split and the tool helps. Expect it to replace the judgment and you will be disappointed, and probably shipping something nobody asked for.
A repeatable loop
Put together, building a web app with AI comes down to a loop you run over and over:
- Scope one feature to the size of a pull request, with an outcome and an example to follow.
- Hand it to the agent and let it write the front end and back end together.
- Run your tests on its branch, in your normal CI.
- Review the plan and the diff before you merge, the same way you review a person.
- Merge, then start the next feature.
Nothing here is exotic. It is the workflow good teams already use, with an agent doing the middle step. Compare the tools that fit this loop on our best AI for coding roundup, or read whether AI can build a whole app for where the ceiling actually is.