# Preview and Production: how your app goes live

> Your app moves through three places as you build it: first `localhost:3000` on your own computer, next a private Preview link on Vercel created automatically for every branch you push, and finally Production, the public website updated from `main` only after you approve.

## Analogy

Think of rehearsing a play. First you practice in your living room (`localhost`), then you hold a dress rehearsal on the real stage for invited friends only (**Preview**), and finally you open the doors on opening night (**Production**).

## How it works

While your coding-agent is building a task, your app runs on localhost, usually at `http://localhost:3000` (where `3000` is the numbered port). Only you can see `localhost`: it lives entirely on your computer and stops as soon as you close the app.

When a task works locally, your agent sends the branch to GitHub with a push and opens a pull-request. Because vercel watches your GitHub repo, it automatically builds a preview and gives you a private web address so you can test the change on a real server or on your phone.

Your real users never see unfinished work while you test in Preview. Only when you try the Preview link and say “publish it” does your agent merge the pull request into main, which tells Vercel to deploy the new version to production at your public address (such as `my-first-app.vercel.app`).

If you ever notice a problem on the live site after publishing, you don't have to panic. In Vercel's **Deployments** tab, you can click **Instant Rollback** on the previous working version to restore it in seconds (a rollback) while your agent calmly fixes the code on a branch.

## In your project

After finishing a task on a branch, your agent pushes to GitHub, opens a pull request, runs the checks, and hands you the Vercel Preview link. It always waits for your explicit approval before merging into `main` to update Production.

## Copy for your agent

```text
Push our current branch, open a pull request, and share the Vercel Preview link so I can test it before we merge into main.
```

---
Source: [Agentic Makers](https://agenticmakers.app/en/learn/preview-and-production) · License: CC BY 4.0
