Source: https://www.hype-stack.dev/stacks/how-to-build-an-app-with-ai

# How to Build an App with AI: Pick the Route, Copy the Setup

> "AI builds the app" covers two arrangements. In one, a platform writes the code and runs it for you. In the other, an
> agent edits a codebase you own and host. Most of what goes wrong later follows from which one you chose.

Tutorials on how to build an app with ai usually walk through one tool and call that the method. That skips the first
decision. A hosted AI builder such as Lovable, Bolt, Replit or v0 takes a description and returns a running app on its
own platform. A coding agent such as Claude Code, Cursor or Codex edits files in a repository on your machine, and the
hosting, the database and sign-in are yours to arrange. The scope here is building a web app with AI, meaning something
people open from a link and sign in to.

Either one can make an app with AI this week. They break in different places, so this page picks the route first, then
gives the agent route as a setup you can copy.

## Builder or agent: which route is yours

**Who runs the app once it works?**

- **A hosted AI builder:** The platform does. Pick it to learn whether the idea deserves an app.
  - Describe the app in a browser and get a link, with hosting, a database and sign-in arranged
  - Building is metered, and the finished app assumes the platform under it
- **A coding agent on your codebase:** You do. Pick it when the app is meant to last and take real users.
  - The agent edits a git repository, so the app outlives the tool that wrote it
  - A typecheck and tests can fail a wrong guess before a user finds it
  - A slower first hour: tools to install, a database to run, hosting to arrange

## When a builder is the right call

A builder is made for the person who wants to create an app with AI and not look at code. Stay on one when three things
are true. Nobody on the project uses git or a terminal. The goal is something to put in front of five people, not
something to run for a year. And the app will not hold data you would be in trouble for losing. Under those conditions a
builder is faster than anything further down this page. [Best AI App Builder 2026](/stacks/best-ai-app-builder) compares
the four main ones, and [How Do I Make an App?](/stacks/how-do-i-make-an-app) ranks every route by cost, the no-code one
included.

The agent route starts to win when any of these shows up: people pay you, the app stores other people's data, a second
person needs to work on the code, or you expect to maintain it next year.

## "It worked in the demo and broke with real users"

Sessions log people out. A payment fails now and then. A fix to one screen breaks another. An API key turns up in
frontend code. Reports like these usually trace back to three things an agent in an empty folder does not have.

**What an empty folder is missing**

- **Code to copy** An agent writes in the shape of what it reads. With nothing to read, it picks a layout per session, and Thursday's permission check does not match Monday's.
- **A check that can fail** Without a typecheck and tests, done means the agent stopped. With them, a changed response field that a screen still reads fails before you open the browser.
- **Reviewed code for the risky parts** Payment providers retry and reorder webhook events, and code written from memory tends to assume each one arrives once. Sign-in and permissions fail the same quiet way.

So before the first prompt, check whatever you start from for four things: sign-in and permissions that work, a
typecheck and a test command, conventions written in the format your agent reads, and one command that runs it locally.

## What the agent route asks you to bring

A builder hides these behind one subscription. On a codebase you own, each is a separate account with its own bill,
whichever starter you pick.

**Accounts in your name**

- **The agent** Claude Code from Anthropic, Cursor, or Codex from OpenAI. You pay them for the model.
- **A host and a Postgres database** Where the app and its data run once they leave your laptop. Not needed on the first evening.
- **A payment provider** Stripe, or Lemon Squeezy or Polar if you want a merchant of record handling tax. Skip it until you charge.
- **Email sending** A provider such as Resend, with a verified sending domain. Password reset emails go through it.

A browser the agent can drive is the first MCP server worth adding, and it is somebody else's too.
[Best MCP Servers for Claude Code](/stacks/best-mcp-servers-for-claude-code) lists the rest.

## What to start from tonight

The repository we make for this is Hype Stack: a TypeScript web app with a React frontend and a Hono API on Postgres,
scaffolded by one CLI command and kept as source in your own git history. It needs Node 20 or newer and pnpm 12, plus
Docker for the local database.

**From an empty directory to the first feature**

1. **Scaffold an app that already has accounts** — Run in an empty directory, the template command scaffolds the project, installs the starter, layout and billing, then offers to start Docker and migrate. (npx @hype-stack/cli template better-studio)
2. **Tick the agents you use** — The wizard writes the same conventions in each tool's format: .claude/rules/*.md for Claude Code, .cursor/rules/*.mdc for Cursor, AGENTS.md for Codex. Eleven skills land in .agents/skills.
3. **Connect the MCP server** — Eleven tools that go through the real CLI. plan_install flags a pack your licence does not cover before anything is written, add_packs copies the code in, and setup_project runs Docker and the migration once the agent has asked you. (npx @hype-stack/cli@latest mcp install)
4. **Type the keys in yourself** — The onboard command walks the variables your packs need: the Stripe secret, the plan ids, the signing secret for the webhook at /checkout/webhook. The MCP tool env_status reports what is still empty and takes no secrets. (npx @hype-stack/cli onboard)
5. **Ask for your feature, not for plumbing** — Sign-in and organizations exist, so the first prompt is the workflow only your app has. Point at an existing feature folder as the pattern, then have the agent run pnpm typecheck and the tests.
6. **Put it online early** — The deploy command creates the apps and Postgres on your own Fly.io or Railway account. It shows the plan and waits for a yes before creating anything billable. (npx @hype-stack/cli deploy web --dry-run prints every command first)

The flow is the same whether you build an app with Claude Code, Cursor or Codex. The Claude Code half (`CLAUDE.md`, plan
mode, permissions) is step by step on [How to Vibe Code with Claude](/stacks/how-to-vibe-code-with-claude), and the
order to add accounts, teams and billing in is on [How to Build a Web App](/stacks/how-to-build-a-web-app).

`better-studio` is the multi-tenant SaaS template: the Better Auth starter, the Glass layout, Stripe subscriptions, a
marketing landing page and revenue widgets in the admin app. The layout and the billing pack in it are paid. To try the
route first, `npx @hype-stack/cli compose --packs starter-saas-betterauth,layout-basic` installs the two free pieces:
email and Google sign-in, organizations, invitations, roles and the admin app, without billing.

**Templates an agent can start in** Each one is a running app with accounts, an admin app, rules files and a test setup.

[Browse the templates](https://www.hype-stack.dev/templates)

## What you still write yourself

The product. Concretely: the Prisma models for your own records and their migration, the routes and screens for the core
workflow, the rule for which role may do what to those records, what each paid plan allows, and the landing page copy. A
feature such as "members can archive a project" is a status column, an endpoint with a permission check, and a button.
The agent writes most of it. You read the plan and open the result as a second user to see whether the check holds.

## What is not in the box

We ship no agent, no prompt box and no visual editor, and we host nothing. You get a repository and a terminal, and the
first screen comes after an install and a database start. Because the files are yours, improvements we ship later do not
arrive on their own: you re-run the CLI and merge what you want. The rules files know the conventions of the repository
and nothing about your product.

## Where this route stops

If you have never opened a terminal, expect the first evening to go on setup. Errors appear on your machine, and the
agent will sometimes repair a symptom and report the job done, so commit after each working step. Rules files are advice
the agent usually follows, and the typecheck only catches what is typed, so reading the plan stays your job. If that
trade is wrong for where the idea is today, stay on a builder for now.

The sections below show the template this page recommends and the command that installs it.



For the files that steer the agent, see [Claude Code Templates](/stacks/claude-code-templates) and
[Cursor Skills](/stacks/cursor-skills). If the app already lives on a builder,
[Lovable vs Claude Code](/stacks/lovable-vs-claude-code) covers moving it in stages.
