# Several apps in one project

A site and its API, a shop and its admin — deployed together, sharing one database and one set of people.

Many projects are more than one app. A school website with a separate admin area for updating it. A shop with its own API. A blog and the tool that writes to it. Your AI may have built these as separate folders in one repository — `apps/web`, `apps/api`, `apps/admin`.

Run the one command at the top of the repository and all of it goes live, as **one project with several parts**:

```
detected  3 apps in one project: web (apps/web), api (apps/api), admin (apps/admin)
web       Next.js · Postgres (drizzle)
api       Hono API · Postgres (drizzle)
admin     Next.js · Postgres (drizzle)

✓ pack       412 files · 2.1 MB
✓ live       https://quiet-harbor-4471.uarpie.app/#k=7f3a…
✓ api        https://quiet-harbor-4471-api.uarpie.app
✓ admin      https://quiet-harbor-4471-admin.uarpie.app/#k=9c1e…
```

## What "one project" means

- **One database.** Every part reads and writes the same data. The admin area changes what the site shows, with nothing to wire up.
- **One set of people.** Claim the project once and every part is yours. Invite someone and they can open every part. Private stays private across all of them.
- **One name.** The first part gets the project's address; the others get it with their name on the end — `quiet-harbor-4471-api`. Rename the project and every part follows.
- **One command.** `npx uarpie` at the top of the repository deploys every part, in order. A part with nothing new is skipped.
- **Removed together.** Delete the project and its parts go with it. Delete one part and the rest stay.

Each part is still its own app underneath: its own versions, its own rollback, its own logs, its own spending on the meter. **Each part counts as one app on your plan** — a project with three parts uses three of your apps.

## Which part is the main one

The part whose folder is called `web`, `site`, `frontend`, `www`, `app` or `client` comes first and gets the project's main address. If none is, the first folder alphabetically does. The order is recorded in `deploy.json` under `services`, and your AI can reorder it before the first deploy.

## When you want only one of them

If the repository holds several apps but you only want one online, tell the command which: run it inside that folder, or set `"build": { "rootDirectory": "apps/web" }` in `deploy.json`. Then it is an ordinary single app.

## What is recorded

`deploy.json` at the top of the repository lists the parts and, after the first deploy, their ids:

```json
"services": [
  { "name": "web", "rootDirectory": "apps/web", "project": { "id": "prj_…" } },
  { "name": "api", "rootDirectory": "apps/api", "project": { "id": "prj_…" } }
]
```

Names are short, lowercase, letters, digits and hyphens, because they become part of an address. Detection refreshes the list on every deploy; the ids are kept.
