# Deployment

## Local

```bash
cd nextjs_space
yarn install
yarn dev            # development, http://localhost:3000
yarn build && yarn start   # production mode locally
```

## Hosted (Abacus AI)

The app is built and hosted on the Abacus AI platform. Deployments are triggered from the platform (Deploy button or
agent deploy action), which runs a standalone production build and publishes it to an `*.abacusai.app` hostname or a
custom domain.

- No environment variables are required for the mock build.
- `.md` files, `docs/`, `scripts/`, and `.github/` are not part of the deployed bundle.

## Self-hosting notes

- Node.js ≥ 20 (22 recommended).
- Standalone output: `NEXT_OUTPUT_MODE=standalone yarn build`, then run `node .build/standalone/server.js` (or the
  equivalent path for your configured `distDir`).
- Put the app behind TLS; set strict security headers at the edge (CSP, HSTS, Referrer-Policy). Do not set
  `X-Frame-Options: DENY` if you need the platform preview iframe.

## Pre-deploy checklist

- [ ] `yarn lint` and `yarn build` pass
- [ ] CI, CodeQL, and security-scan workflows green
- [ ] CHANGELOG updated
- [ ] No UI text asserts unimplemented security controls
