---
url: /docs/en/agentbuff-stack/quick-start.md
---
# Quick start

## Prepare an isolated local project

Install Bun 1.4.2+, Python 3 and local PostgreSQL. Use a separate database and a unique authentication secret for every product.

```sh
bun install --frozen-lockfile
cp .env.example .env.local
bun -e 'console.log(crypto.randomUUID()+crypto.randomUUID())'
```

Put the generated value in `BETTER_AUTH_SECRET`. Set `DATABASE_URL` to your own loopback database. Keep `APP_ORIGIN` and `PUBLIC_SITE_URL` equal to the configured product preview origin, normally `http://localhost:4410`.

```sh
bun run config:check
# Run only against the newly prepared, isolated database:
bun db:migrate
bun preview:build
bun run preview:start
bun run preview:status
```

The launcher does not install PostgreSQL or create a production database. Local mail is captured in `.local/outbox.jsonl` rather than sent through Resend. That file can contain verification codes and links; keep it local.

## Preview the three surfaces

| Surface                   | Default local URL       |
| ------------------------- | ----------------------- |
| Template official website | `http://localhost:4400` |
| Complete product demo     | `http://localhost:4410` |
| Documentation             | `http://localhost:4406` |

English public pages use the original routes. Chinese pages use `/zh/`. Documentation defaults to Chinese, with English core guides under `/en/`.

Ports are managed by `preview.config.json`. Build documentation with `bun run docs:build`; start/stop owned previews with `bun run preview:start` and `bun run preview:stop`. Rebuild after frontend edits, and restart the API after backend changes. `bun dev` provides development hot reload.

## Check a change

```sh
bun run config:check
bun typecheck
bun web:check
bun website:check
bun run test -- --run
bun lint
bun format:check
bun preview:build
bun run docs:build
```

Type checking generates Astro collection types but does not replace Astro page checks. None of these checks performs a deployment or a database migration. Existing preview accounts and data are local fixtures, not defaults to ship to a new product.
